Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Programming Assignment Guide For CS Students

timothy posted more than 9 years ago | from the don't-do-this dept.

Education 761

kennelbound writes "For those students just getting started in a Computer Science degree or a career in software development, this guide has been written to help you understand what NOT to do when coding a project. Those with a little more experience should still read it to get a good chuckle (and hopefully the mistakes stated within will not seem too familiar!)"

cancel ×

761 comments

Sorry! There are no comments related to the filter you selected.

FIRST POST (-1, Troll)

Windplume (262613) | more than 9 years ago | (#10572459)

First POST

Re:FIRST POST (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10572489)

flame bait? wtf?!

good FP!!! After a long time, am seeing someone -say- FP and actually make it.

here's to frosty pists! I love frosty arm pits. yummmmmmmmmmmmmmmmmmmmmmmmmm.

*BEHEADING is dying (0, Troll)

CmdrTaco (troll) (578383) | more than 9 years ago | (#10572552)

It is now official. Headcraft confirms: *BEHEADING is dying

One more crippling bombshell hit the already beleaguered *BEHEADING community when Headcraft confirmed that the total number of executions by *BEHEADING dropped yet again, now down to less than a fraction of 1 percent of all executions worldwide. Coming on the heels of a recent Headcraft survey which plainly states that *BEHEADING has dropped dramatically after the US invasion of Iraq, this news serves to reinforce what we've known all along. *BEHEADING is collapsing in complete disarray, as fittingly exemplified by failing dead last in the recent Ruthless Dictators comprehensive execution test.

You don't need to be a Jailed Dictator [floogie.org] to predict *BEHEADING's future. The hand writing is on the wall: *BEHEADING faces a bleak future. In fact there won't be any future at all for *BEHEADING because *BEHEADING is dying. Things are looking very bad for *BEHEADING. As many of us are already aware, *BEHEADING continues to lose market share. Rivers of blood of blood of blood no longer flow from headless corpses..

Ruthless dictator *BEHEADING is the most endangered of them all, having lost 93% of its core dictators. The sudden and unpleasant deaths of long time *BEHEADING evangelists Uday and Qusay Hussein only serve to underscore the point more clearly. There can no longer be any doubt: *BEHEADING is dying.

Let's keep to the facts and look at the numbers.

*BEHEADING leader Qusay stated that 500,000 Iraqis 'dissappeard' during Saddam's regime. How many of them died by *BEHEADING? Let's see. Executions were generally carried out by hanging, bullet to the head, or *BEHEADING. With *BEHEADING being to most difficult to clean up after, let's conservatively estimate that only 5% of the Iraqis that 'disappeared' were *BEHEADED, so 500,000 / 20 = 25,000 deaths by *BEHEADING during Saddam's regime. Saddam took power in 1979, meaning his regime lasted 24 years. Therefore there were (25,000 / 24) ~ 1041 *BEHEADINGS PER YEAR during Saddam's regime. This is consistent with human rights reports. Since the US invasion, there have been approximately 50 *BEHEADINGS. Therefore there have been (50 / 1.5) ~ 33 *BEHEADINGS PER YEAR after the US invasion. Clearly, the terrorists are not as efficient at *BEHEADING. *BEHEADINGS have dropped 97% in the past 18 months. Clearly *BEHEADING is dying.

Due to the troubles of Saddam's Regime, what with it being gone and everything, massive amounts of *BEHEADING stopped and was taken over by a dismal few but high profile *BEHEADINGs that were carried out by nothing but cowardly terrorists Now *BEHEADING is also dead, its corpse turned over to yet another charnel house.

All major surveys show that *BEHEADING has rapidly declined in market share. *BEHEADING is very sick and its long term survival prospects are very dim. If *BEHEADING is to survive at all it will be among terrorist networks. *BEHEADING continues to decay. Nothing short of a miracle could save it at this point in time. For all practical purposes, *BEHEADING is dying.

Fact: *BEHEADING is dead.

© 2004 CmdrTaco (troll)

Slashdotted. Already. Here is article text. (4, Informative)

Pig Hogger (10379) | more than 9 years ago | (#10572464)

How NOT to go about a programming assignment

Computer programming students invariably fall into more than one bad habit. It can be extremely difficult to eradicate them (and many lecturers and professional programmers keep succumbing to them time and again). I wrote this when, in the days leading up to an assignment deadline, I saw these things happening so often that I couldnt help but recall my classmates and I a decade earlier doing exactly the same things as my students.

This article is an attempt to show these irrational attitudes in an ironical way, intending to make our students aware of bad habits without admonishing them.

NOTE: This text was published by ACM [acm.org] 's SIGCSE [sigcse.org] in the June 2004 issue of Inroads, the SIGCSE bulletin [sigcse.org] .

All about programming, in the strictest sense of the word Ignore messages

Compilers, operating systems, etc. generate error messages designed only to be read by their creators (maybe to justify their salaries). Precious time is wasted reading these messages; time that could be better spent writing code, of course! Error messages make us less productive. Dont fall into the trap. Ignore them.

As for warning messages, ignoring them makes you feel like a professional programmer whos not scared of computers. What better way of showing ones experience as a programmer than delivering a program that generates dozens, no, hundreds of warning messages when it compiles without its author feeling the slightest bit concerned? Everyone can see that youre an experienced, laid-back programmer who is too busy to waste time on drivel.

Dont stop to think

Lets not kid ourselves here. What are we building? A program. What is the only thing that really matters in a program? Code. What really works? Code. Why use outdated resources like pencils, pens or paper? You are a paid-up member of the SMS generation; you dont make a fool of yourself writing time-consuming syllables, right? Then, stop messing around thinking about nothing when theres so much code to write.

You should never stop coding. We all know that error messages are an unacceptable interruption, a pointless obstacle as we go about our work. So what do you do if you get a compiler error message? As you should know by now, reading and understanding it is just not an option.

You can try making some random change to the source code. You never know, you might pull the wool over the compilers eyes. But if this doesnt work, dont waste any more time. NO, dont be tempted by trying to read the message or understanding it. Just keep churning out code - thats the only way of finishing off this horrendous assignment. Youll get to sort the error out later on. And as we all know, errors tend to disappear by themselves if theyre ignored. At the end of the day youll compile, youll run, and even if you had tested (not that you needed to) youd have seen that everything was OK.

If the code compiles but does something wrong, it doesnt really matter; sort it out later, when its finished. Anyway, you might get lucky and find out that the lecturers have changed the assignment outline and that it fits in with your program after all. So dont take the risk of fixing programs that seem to be off track you might be wasting your time.

I don't want any trouble

If your program contains a bug that crops up every now and again, it will be difficult to find and it wont probably show up during the exam demo. Maybe it will disappear by itself. Dont worry. But if the bug comes up again and again, change things at random until it disappears. Weve already said that pausing for thought is not an option. If you decide to get rid of the bug - simply because the urge takes you - just write the same code in different ways. Maybe the problem will disappear; something youll have achieved without 1) understanding what caused it, and 2) having to stop writing code. Clearly, this is the most professional approach.

Dont compile on a regular basis, dont tiptoe your way forward. Youre a professional and professionals take giant steps. Write thousands of lines of code first and leave the compiling for later; it will be far more entertaining and worthwhile to look for compiling errors.

The same rule applies for runtime errors. If you try to keep your program correct as it grows, it will be too easy to pinpoint a new bug. Only cowards do that. A real programmer writes the entire program and then digests it whole like a boa constrictor. Looking for a bug hidden in the last 10,000 lines is exciting but if there are only 10 or 20 lines, well, what fun is there in that?

And why use debuggers? Its up to the lecturer to look for your bugs. Programming errors are the exception, not the norm, and when you become a pro you wont have to face them. Why waste time then or expend your energy learning to deal with them as part of your education?

If only I could find the words Reading

Outlines and specifications are a real drag. These tedious and long-winded tracts refer to irrelevant problems and are nothing more than an opportunity for lecturers to display their narcissistic traits. You only need to take a quick look at them and get the gist of what they are after. Reading them for a second time only gets in the way of our real mission, which is nothing other than writing code. So once youve got a rough idea of whats expected from you just stick the assignment outline at the bottom of the biggest heap of paper on your table.

On the other hand, coding and presentation rules show how arrogant our lecturers are. They like controlling us, forcing us to do pointless exercises - thats why they write rules in the first place. Dont play their game. Reading or applying rules wont make our work any better or worse. And as for making our exercises easier to handle, well, they get paid to correct them, dont they? Dont even bother to put your name or your class on them. Lecturers will have little trouble remembering your face and your unmistakable programming style so theyll know its yours anyway.

Writing

Dont write comments. Weve said it before and well say it again: whats the point of all this? To create a program, i.e. code. Non-executable stuff is unnecessary and explanations are an insult to a programmers intelligence - after all, he or she can read the source, right?

If there are mandatory comments to write (function descriptions and stuff like that) then write them, even if you have nothing interesting to say. Lecturers like this drivel and youll get higher marks.

As for the docs, write them at the end. How can you write a document describing a program that doesnt exist yet? Whats the point in writing documents for yourself about what youve just done? The only reason for writing documentation for a program is that the lecturers ask for it. Its something you can sort out the day before the deadline. Whats more, theres no chance of you forgetting anything as it will all be fresh in your mind.

Also, use abbvns n strange konsonants when u write. Lecturers are old fogeys. You are a member of the SMS generation. Try to write messages that are difficult to read. Although he might not notice it, the lecturer will have to make an extra effort, after a long day stuck in front of a computer screen. All of which should help raise the old concentration levels and put him or her in a really good mood.

What about spelling? Spelling is a drag. Even Juan Ramón Jiménez put his letter js wherever he wanted and Gabriel García Márquez once called for spelling to done away with for good. Obviously, youre just as good as them and so youve just as much right to write however you want.

Lets face it, who doesnt make spelling mistakes? Its all too easy. And theres a brutal poetry in abrupt contractions and semantic hijackings that fling treacherous letters at the reader. Ever wanted to give your lecturer a slap in the face but never had the guts to do it? Drop him a line such as:

Im trying to do youre exercise. I think its two difficult.

Itll have the same effect, dont worry.

NOTE: Juan Ramón Jiménez: Spanish poet who won the Nobel Prize for Literature in 1956. He liked to flaunt spelling rules by writing almost phonetically (in Spanish the change involves only a handful of letters, g/j among them).

Your relationship with your lecturer Don't ask for help

If theres something you cant do, if you have a query or if youre lost, dont look for help, dont ask questions during the lecture and dont go to your tutorials. There are thousands of reasons why you shouldnt but heres just a few of them:

  • Going to a tutorial and asking questions is tantamount to admitting youre stupid.
  • Better to be ignorant than to run the risk of revealing that you dont know something you should.
  • Ask a question during the lecture and your fellow students will think youre stupid. You dont think that of them when they ask a question, but they will about you. This argument holds true for each and every student in a lecture room at any given moment; thats why none of them ask any questions.

Conclusion: never ask for help or go to a tutorial. There is, however, an exception to this rule; you are allowed to turn to the lecturer in the last few days before a deadline. There may well be a long queue, he will dedicate his time to helping students while neglecting other duties but dont worry, he wont be able to resist helping you in those dark, gloomy hours of need.

Challenge your lecturer

If, despite everything we've said, you decide to ask for help, always remember a golden rule thatll also help you in your professional career - after all a whole host of pros and computer users follow it too. NEVER give a detailed description of a problem.

Heres an example. If something untoward happens while youre building a program, go and see the lecturer and tell him: Something strange happened with my program yesterday. Hell look at you expecting more details but dont give in, dont say anything else. Dont even think of going into details such as:

  • Whether the strange event happened while compiling the program or while running it.
  • Whether the strange event caused the program to end suddenly or to keep running indefinitely, or simply, the program didnt do what you expected.

Heres another one. If the strange event happened while you were compiling, dont tell the lecturer what the error message said or the line of code where it appeared. Just say something like: It gave some error message, or something.

Heres yet another example. If the strange event happened during runtime and caused the program to terminate suddenly, never write down the error message or tell the lecturer what it said. Just say: It gave some error message, or something.

Of course, if the strange event involved the program not doing what you expected it to do, dont even think of telling the lecturer the exact circumstances of how it happened. Avoid descriptions like: This error comes up whenever I load a second file and the first one was empty. Just say the magic words: It gave some error message, or something. Have you got that?

Lets suppose that youre a stubborn ingrate who goes see the lecturer to ask about a specific problem. Thats two mistakes rolled into one but you can at least get something right - take the wrong source code with you. If you have a bug and the things you try out only make the situation worse, take the most recent code to your tutorial but ask about the original problem. That way the lecturer will embark on a fruitless search for an error when, in actual fact, another one will show up. When it does, just say something like: Oh yeah, I tried something out. Delete that line there ... Perfect this art and youll be able to do a whole coding session in the tutorial. I know - Ive seen it done.

If you insist on being irresponsible and asking for help in tutorials, dont even think of pinpointing the problem before you go. If there is an error in a 1-MB input file, dont try smaller files until you identify the cause of the error. Dont try to create a mini-program with that selfsame error. If you do, the lecturer will probably find the problem straightaway. What kind of challenge is that for him? Better to make him read thousands of lines of code and make traces with hundreds of steps. Thatll give him a chance to practice his clairvoyance skills and youll be able to check out his powers of deduction.

Be clever using electronic mail

Some questions are almost impossible to answer by e-mail, if you put them in the right way. Nurture this skill and make your questions completely vague. Heres an example: It gave some error message, or something. Ive attached the source code. You can go the other way as well, if you want, by asking a more specific question but forgetting to send the code. The constructor in my TDevice class gave some error message, or something.

It goes without saying that you should write your message straightaway and send it. Never reread messages.

Theres another reason why email is so much fun. You can sound off without the guy knowing which group youre from or your name. Everything will be OK if you take the informal approach it makes it all so much cosier, making your name an irrelevant detail.

And, of course... Leave it all for the last minute

Right from day one your lecturers will tell you to hand your work in the following week. Theyll tell you to work at a steady, constant pace from the off.

Dont listen to them.

Although it might be a relatively new discipline, computer programming has already built up a number of sacred traditions, one of which is the last-minute rush to get your work in on time. Subjecting yourself to this stress is an essential part of preparing yourself for the world of work. Relax. Let your work pile up gradually and blithely ignore all the warnings and telltale signs that youre behind schedule. Dont let studying get in the way of your life. Dont duck out of that skiing trip in a vain attempt to make up for lost time. And just when youre on the edge of the precipice, just when youve only got two weeks to hand in a program that youve had four months to do, then the codell start to flow like theres no tomorrow.

What attraction would computer programming have if we didnt put together programs in a breathless, last-minute dash? What would become of the image of the long-haired, bearded, smelly (theres no time to shave, trim your beard or have a shower, you see), Megadeth-T-shirt-wearing programmer (remember that stains show up less on dark Heavy Metal T-shirts with their elaborate designs) tapping away at a keyboard for 48 hours non-stop? Would you have the stamina to go to the local LAN Party, park your bum down on a plastic chair and spend three days cooped up in a marquee in 35-degree heat gunning down monsters on a screen? What right would we have to call ourselves heroes if we had a kip every day just because we felt a bit tired? Just think about it. What would happen to Coca Cola and all its factories? What would happen to Juan Valdés ? And what would happen to all the coffee factories that dedicate half of their production to computer programmers? When Sandra Bullock and Robert Redford became hackers, did they put their notes down by the side of the computer, sit and think for a while and then methodically tap away on the keyboard for an hour or two before heading off to the gym or the bar on the corner, day after day for four months? And what about that bloke in Operation Swordfish? Would he have cracked the Pentagon password if one of Travoltas hitmen hadnt been pointing a pistol at his head while another Travolta hitwoman was trying to distract him?

The answer, my friend, is no. You want an easy life? Go and take another course.

Being up to date with your work and understanding whats going on in the lecture room is for swots and wimps. You know what to do - leave it all for the last minute.

NOTE: Juan Valdés is the name of the coffee grower in Café de Colombias TV adverts.

Cheat with your assignment

Copy the programs. Lecturers will probably have to mark dozens of them, making it difficult to spot similarities between them. And even if they do, it sure as hell aint easy to prove. Appeal against your mark and take it to the High Court if necessary. That will take much more money and effort than writing the programs, but the goal is to prove that you're smarter than the lecturer and never, ever give way.

Finer points of Spanish-English translation (0)

Anonymous Coward | more than 9 years ago | (#10572555)

Would you have the stamina to go to the local LAN Party, park your bum down on a plastic chair and spend three days cooped up in a marquee in 35-degree heat gunning down monsters on a screen?

If that's not Celcius, I'd love to know where the Spaniards are getting their heatsinks from...

Re:Finer points of Spanish-English translation (2, Informative)

attonitus (533238) | more than 9 years ago | (#10572662)

:-). But maybe a more appropriate title for this comment would have been "Finer points of living on a diverse planet for ethnocentric Americans". In the rest [ernet.in] of [weather.ca] the [bbc.co.uk] English [weatherzone.com.au] speaking [ireland.com] world [weathersa.co.za] , we have no problems with Celsius.

Re:Slashdotted. Already. Here is article text. (2, Funny)

roman_mir (125474) | more than 9 years ago | (#10572582)

And what about that bloke in Operation Swordfish? Would he have cracked the Pentagon password if one of Travoltas hitmen hadnt been pointing a pistol at his head while another Travolta hitwoman was trying to distract him? - I think it should be mandatory for every CS class to have their own hitmen who would point guns at the students' heads while some hitwomen would try to distruct them. Then everyone would be like those hackers in movies, hacking away those 128bit encryption algorythms in just under 60 seconds.

Re:Slashdotted. Already. Here is article text. (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10572589)

Red Sox RULE!!!! Down With the evil empire! Down with the Yankees! The red Sox In Seven!!! Woo-hoo!!!

your code should read like a novel (5, Funny)

Simonetta (207550) | more than 9 years ago | (#10572734)

Yes, seriously...
your code should read like a novel.

After finishing the program, compiling, and debugging it, get out your microphone and one of those speech-to-text programs. Train it if you haven't done so already by reading the presented text for twenty minutes or so. Do the training twice: once when sober and properly intoxicated. (Myself, I grew up in the 1970's and consider alcoholic beverages déclassé, but everyone has their own favorite intoxicant).
Get a picture of your favorite dreamboat celebrity and put it next to the screen. Load your source code on the editor and start the speech-to-text converter in the background.
Take a deep breath and gaze adoringly in eyes of the person in the photo. Pretend that they are hopelessly infatuated with everything that you say and just love to hear you talk about your programming.
Then start talking. Talk about your code. Start at the beginning. Talk about every line and what it does. How it works. How it fits. How totally cool it is. Just go on and on.
When you're done, turn off the speech-to-text generator running in the background and save the hopefully rather large text file.
Go back and cut and paste lines from the source file into the spoken description text file. (Use the speech-to-text engine to make this step go fast.)
Hopefully you will now have about a half a page or more of rambling, but technically dense and accurate, speech text for every line of source code.
This is the proper amount of commentary that every line of code needs.
Put comment markers around your spoken text and lots of white space above and below the actual source lines.
Your program is still good: it compiles and runs. But it now looks like a novel.

This is good! The single line coding format that we all use is an obsolete product from the 1950's when a byte of computer RAM memory cost more than a good restaurant dinner. Those days are gone.
Now you want to be able to read and understand the code quickly. It's far easier to glance and read through pages of rambling dictation describing the code than it is to try to understand 'normal' code with little pissant comments pasted randomly through it.
You're a professional now. Anything that makes your job easier is good .
If your CS professor disagrees, give them a copy of your speech-to-text software and a picture of Lindsey Lohan to place next to their screen and have them try it themselves.

rule 1 (2, Funny)

Anubis350 (772791) | more than 9 years ago | (#10572465)

rule one: do not post vulnerable servers on slashdot without a mirror

Re:rule 1 (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10572595)

i thought it was "you do not talk about fight club"

Bad Idea (5, Insightful)

Anonymous Coward | more than 9 years ago | (#10572467)

I'm sure many people will say this, but you learn much more from making mistakes and working out the problems than by reading a book on common mistakes.

Re:Bad Idea--To Play The Red Sox (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10572606)

Go Red Sox!!! Down with the evil Yankees!!! all Yankee fans are losers! Die Yankees Die! And the Cheating A-Rod! Heh. Cheaters!!!!

Re:Bad Idea (4, Insightful)

xs650 (741277) | more than 9 years ago | (#10572642)

No need to repeat others mistakes, learn from theirs then go on to make you own unique mistakes.

A smart man learns from his mistakes
A wise man learns from others mistakes.

Cheating. (2, Insightful)

mikeleemm (462460) | more than 9 years ago | (#10572469)

Not cheating would be a good important one.

OBVIOUS, but always missed. If you need to cheat, change majors.

Re:Cheating. (0)

Anonymous Coward | more than 9 years ago | (#10572627)

The Yankees are Big Fat Cheaters!!! Stupid Cheating A-Rod. Big fat overpaid Cheaters!!!!

slashdotted... almost! (1)

stilist (753415) | more than 9 years ago | (#10572473)

Wow... this story has been up for no more than 5 minutes, and already the site's almost dead...

Regardless, it's a clean, informative setup.

i can't get to the article, but... (5, Insightful)

ansleybean (618941) | more than 9 years ago | (#10572477)

a HUGE thing is not to plagarize code. I was a TA for CS101 at my school, and plagarism is not only rampant, but really really easily detectable. besides, you don't learn anything; although, as one of my professors said, "if you can copy someone else's code and alter it so I can't tell, you may as well have actually done the assignment."

Most of the Prof's lecture notes are plagarized (4, Interesting)

Cryofan (194126) | more than 9 years ago | (#10572521)

I found that if you googled most of the CS lecture notes, most of them were plagiarized from some other school....

Re:Most of the Prof's lecture notes are plagarized (2, Funny)

ansleybean (618941) | more than 9 years ago | (#10572536)

haha, i had a prof that did that. although i have to say that original powerpoint slides aren't any more interesting than plagarized ones.

Re:Most of the Prof's lecture notes are plagarized (1)

Cryofan (194126) | more than 9 years ago | (#10572615)

Not only were many of MY professors' notes plagiarized, but I found that the best sets of notes for any particular CS core class (OS, Prog langs, automata, etc) had been plagiarized multiple times by many professors all over America, Canada, etc.

Re:Most of the Prof's lecture notes are plagarized (1)

Yartrebo (690383) | more than 9 years ago | (#10572636)

How hard would it be just to give credit. I believe it would be fair use, so copyright wouldn't be an issue?

Re:Most of the Prof's lecture notes are plagarized (1)

Lord Omlette (124579) | more than 9 years ago | (#10572655)

If the compiler course used something called JOOS, guaranteed the entire damn thing was cribbed from some other school >_<

Re:Most of the Prof's lecture notes are plagarized (4, Informative)

Sir Joltalot (66097) | more than 9 years ago | (#10572688)

I had a prof that did that, at the University of Waterloo [uwaterloo.ca] , of all places.
It's one thing to use somebody else's lecture notes. But this guy clearly didn't even read them before coming to class. You'd ask him a question and he'd just say "Uh, I don't know, these aren't my notes." For crying out loud! And I was paying $700 or so for that course! The prof was Mavaddat [uwaterloo.ca] in case you're curious. If you're ever scheduled to have a course with him, SWITCH as fast as you freaking can! You're better off Googling for stuff and reading other people's PowerPoint slides by yourself.

Re:i can't get to the article, but... (5, Insightful)

gcaseye6677 (694805) | more than 9 years ago | (#10572542)

This really depends on how well the professor defines the assignment. If every aspect of the programming assignment is spec'd out to the point that there would only be one correct answer, it would be easy to get away with cheating since all of the good submissions would look the same. If, however, the professor assigned a creative problem solving exercise and a proper solution could take many different paths, 2 or more identical submissions would be a dead giveaway of cheating. If professors really want to stop cheating, they need to take the initiative to assign work that requires creativity on the part of the students as opposed to submitting code that could be a cut and paste of textbook examples. Having had both kinds of professors in school, I saw first hand what kind of work students provide in each environment.

Compiler Warnings (-1, Flamebait)

Compholio (770966) | more than 9 years ago | (#10572490)

As for warning messages, ignoring them makes you feel like a professional programmer who's not scared of computers. What better way of showing one's experience as a programmer than delivering a program that generates dozens, no, hundreds of warning messages when it compiles without its author feeling the slightest bit concerned? Everyone can see that you're an experienced, laid-back programmer who is too busy to waste time on drivel.

A lot of compiler warning messages are there for a reason, at least in gcc, and they should not be ignored. This arrogance is what causes many of the bugs we see in software today, there are some messages that can be ignored but you will eventually learn what they are and find out there was probably a better way to try and do whatever is was you were doing and that way won't involve a warning.

Re:Compiler Warnings (1, Funny)

Anonymous Coward | more than 9 years ago | (#10572509)

It's satire dude...

Re:Compiler Warnings (2, Insightful)

Anonymous Coward | more than 9 years ago | (#10572531)

Irony - look it up. [reference.com]

Re:Compiler Warnings (5, Insightful)

nwbvt (768631) | more than 9 years ago | (#10572699)

So let me get this straight, you didn't get that the article was a work of satire, yet this is the only part of it you felt needed to be challenged?

Re:Compiler Warnings (1)

introverted (675306) | more than 9 years ago | (#10572707)

A lot of compiler warning messages are there for a reason, at least in gcc, and they should not be ignored.

One of the banes of my existence is "normal" warning messages. Warnings that everyone expects to see and just ignores, completely unaware of the very important message (e.g. An uninitialized variable) that got lost in the noise.

Unfortunately, the VC6 compiler we use has a few useless messages that can't be disabled. (e.g. "Symbol too long for debugging" when a template is being expanded.) Those cause some serious grief on occasion.

Additional Advice (5, Funny)

nebaz (453974) | more than 9 years ago | (#10572491)

Use the minimum number of keywords in the language as possible. For example, all loops (for, while, do) can all be handled by a simple if and goto statement.

Re:Additional Advice (5, Funny)

nebaz (453974) | more than 9 years ago | (#10572530)

Oh, and also, always use labeled line numbers in multipes of 10. That way, if you need to insert lines later in the middle, you have some line numbers to use later.

Re:Additional Advice (0)

Anonymous Coward | more than 9 years ago | (#10572585)

who the heck labels lines? i hope that's not as common as commenting code, which itself is something only squares do. real programmers don't comment code.

Re:Additional Advice (0)

Anonymous Coward | more than 9 years ago | (#10572611)

BASIC

Re:Additional Advice (0)

Anonymous Coward | more than 9 years ago | (#10572645)

..?

even worse...

Re:Additional Advice (1)

Drishmung (458368) | more than 9 years ago | (#10572729)

Line s ? What is this plural of which you speak? Since "Brevity is the soul of wit", truly cool and efficient programmers code in suitably compact languages. [wordiq.com]

Re:Additional Advice (4, Funny)

gcaseye6677 (694805) | more than 9 years ago | (#10572651)

In a pinch, you could just use GOTOs to branch your code farther down on the screen. But don't forget to include the GOTO to bring it back up, or your execution will be off. Ah, fond memories.

Re:Additional Advice (1)

Yartrebo (690383) | more than 9 years ago | (#10572716)

Actually, this isn't a bad idea.

When I was learning how to program (using QBASIC on MS-DOS), I only knew of the CLS, PRINT, IF, GOTO, +, -, *, /, statements. I didn't know how to make functions or use loops, so I had to use gotos for everything. I even had developed a primitive method for calling 'functions' with a clever usage of gotos, but since I didn't know about arrays, no less stacks, recursion or calling more than one function deep would not work.

If I numbered lines 1, 2, 3, then my GOTOs would all break when I had to insert a line, so that 10, 20, 30 numbering is very useful.

Re:Additional Advice (0)

Anonymous Coward | more than 9 years ago | (#10572547)

mod this funny

Re:Additional Advice (2, Funny)

dtfinch (661405) | more than 9 years ago | (#10572569)

Declaring local variables will just add unnecessary typing. Just put it all in globals for maximum code reuse.

And classes, they don't add anything you can't get with functions. All they do is restrict you.

But why even use functions? All that happens is you try to make one piece of code serve multiple uses when you'll be better off tailoring the code to each instance where it's needed.

Re:Additional Advice (1)

antispam_ben (591349) | more than 9 years ago | (#10572602)

...all loops (for, while, do) can all be handled by a simple if and goto statement.

I've always done that when coding in assembly language.

Advice from a fellow student (5, Funny)

cloudkj (685320) | more than 9 years ago | (#10572493)

Do not, under any circumstances, code under the influence of alcohol.

Re:Advice from a fellow student (4, Interesting)

jschottm (317343) | more than 9 years ago | (#10572538)

I highly (so to speak) advise avoiding coding under the influence of daytime cold medicine. The nighttime ones are not so bad, as they make me go to sleep and stay away from my keyboard. Dayquil on the other hand...

Well, the code was 100% accurate and fast, but when I went to refactor it, the logic was so bizarre that it was easier to rewrite it from scratch. It didn't run any faster [insert snide comment about my lack of skill here], but at least some random person could sit down and figure out what was going on afterwords.

Re:Advice from a fellow student (3, Interesting)

YouHaveSnail (202852) | more than 9 years ago | (#10572559)

Do not, under any circumstances, code under the influence of alcohol.

This was actually a rule at a company for which I worked. We'd occasionally have beer or wine at company parties and such, and writing code after drinking was verboten. You could go back to your desk and work on design, documentation, etc. But no programming after drinking.

It's a damn good rule.

Re:Advice from a fellow student (1)

allden (748789) | more than 9 years ago | (#10572592)

You would had proves highy superior documents which even you couldn't have understood (hic. - later)

Re:Advice from a fellow student (0)

Anonymous Coward | more than 9 years ago | (#10572577)

I can just imagine someone passing out halfway through a CVS commit and breaking the whole project, hehe.

Re:Advice from a fellow student (1)

dtfinch (661405) | more than 9 years ago | (#10572590)

Why not? As long as you can diff it the next day...

Re:Advice from a fellow student (0)

Anonymous Coward | more than 9 years ago | (#10572656)

Why not? As long as you can diff it the next day...
Thats fine if your working on a project alone, but if its a team project you will probably wake up to an angry mob of people because you submitted a bunch of BS code that doesn't work.

Re:Advice from a fellow student (1)

flycrg (801803) | more than 9 years ago | (#10572617)

hmm, does that mean I need to stop working on my java project due tomorrow in class? I mean I followed the rules that said to wait till the last minute!

Re:Advice from a fellow student (1)

mongoose82 (823665) | more than 9 years ago | (#10572652)

I find that with a little alcohol in my system, I code better, my programs seem to be more readable, as well as perform better. Not to mention that the comments in my code seem more complete.

Re:Advice from a fellow student (5, Funny)

ErichTheWebGuy (745925) | more than 9 years ago | (#10572717)

I heartily disagree. Personally, being buzzed (but not hammered) provides my otherwise erratic brain the opportunity to focus intently.

My motto: code drunk, debug sober

Programming Mistake #1 (4, Funny)

Rufus211 (221883) | more than 9 years ago | (#10572495)

Get your site linked from slashdot.

Slashdotted ... (5, Informative)

ggvaidya (747058) | more than 9 years ago | (#10572497)

but also mirrordotted [mirrordot.org] :).

ExtremeGoatse Story Time! (-1, Offtopic)

ExtremeGoatse! (778447) | more than 9 years ago | (#10572498)

So I was sitting there the other day watching my girlfriend change the oil in my car, and I was getting pissed because she kept struggling when she tried to unscrew the filter. I was even more pissed than usual because I was playing videogames as I supervised her from inside the house, until I finally had to put the controller down and go outside to yell at her.

I stood out there in my underwear on a Saturday morning screaming at the top of my lungs. Then my neighbor, who's a total pussy, comes by and says "you shouldn't be yelling at your girlfriend like that." I wasn't going to stand there and just take it, so I socked him one right in the colon. His wife was bringing groceries inside when this happened, and as if it wasn't bad enough that I had to stop playing video games to go outside and yell, now this bitch was screaming at me like it was my fault.

I couldn't understand what she was shrieking about, as she was flapping her arms in the air and screaming. She started crying when she saw the busted colon I gave her pussy husband, so she took one of her shoes off and threw it at me. I caught the shoe between my pecs and I started to laugh like a pirate. Then she started walking towards me to take her shoe back, and there was no way I was going to let this bitch get near my chest so I body slammed her into a cactus that happened to be there. She got up and was uglier than before, so I did what I always do when women start to cry: I went back inside to play video games.

That wasn't the end of it though, it turns out the cranky old hag across the street saw all of this going on, so she came over to do what women do best: bitch. When I opened the door she was standing there in a partly transparent night gown, and it totally ruined the prospect of having a boner for at least 50 years. I was just starting to change my mind about the night gown when she started screeching at me and her stupid cat that she was holding started to hiss. So I took the cat and punted it over my neighbor's fence. She started crying "oh no! My cat! What have you done with my cat?!" I was laughing my ass off, then the bitch tried to scratch me so I gave her a round house kick and dislocated her hip. I was laughing so hard I shit my pants.

Re:ExtremeGoatse Story Time! (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10572695)

plagiarizing that maddox fag..
you give goatse a bad name!

Re:ExtremeGoatse Story Time! (0)

Anonymous Coward | more than 9 years ago | (#10572720)

that fills me with so much shame i just want to rip my anus open really wide.

You have to be new at programming (1)

NaCh0 (6124) | more than 9 years ago | (#10572502)

Because this stupid text (or a variation of it) goes around the internet every 3 weeks.

One thing not to do (5, Funny)

esac17 (201752) | more than 9 years ago | (#10572507)

I spent 2 days looking for a one character bug the other day, I hate these!

if (condition);
{
myvar = 1;
}

The block was a lot bigger than myvar = 1, and my eyes kept skipping over the ; .. of course when I found it I felt stupid .. and well I should have :) hey wait, maybe I should have posted this Anonymously ...

Re:One thing not to do (1)

lpp (115405) | more than 9 years ago | (#10572545)

Maybe I'm being dense, but I'm missing the issue. Or should we assume that condition in some way involved checking the non-zero-ness of myvar?

Re:One thing not to do (2)

esac17 (201752) | more than 9 years ago | (#10572565)

if (condition);
{
myvar = 1;
}

because of the semi-colon at the end of "if (condition);" the {} are simply considered a block and myvar is set to one no matter if condition is true or not.

Or maybe you are being sarcastic and trying to make fun of my stupidity.

Re:One thing not to do (1)

tntguy (516721) | more than 9 years ago | (#10572580)

if (condition);

The semicolon ends the if(), making it do nothing. The block inside the braces will always be executed.

Do I get a cookie?

Re:One thing not to do (4, Insightful)

LeiGong (621856) | more than 9 years ago | (#10572570)

Maybe you should have used a debugger and stepped through the code. A good programmer knows when he's defeated and when he has to step through the code. Maybe that should be one of the rules. Use the debugger, it's there for a reason. Don't assume you're wiz and will fix the problem by just reading the code line by line. If you're a neophyte, chances are you're going to mess up existing working code.

Re:One thing not to do (4, Insightful)

Yaztromo (655250) | more than 9 years ago | (#10572608)

Oh I just know I'm going to open up a huge bag of worms with this one, but this is why I vastly this sort of syntax:

if (condition) {
myvar = 1;
} // end-if

It makes it easier to identify which statement the block is intended to begin with, and makes it easier to spot if there are un-intended characters between the condition and the block-opening (besides reducing vertical space wastage).

Yaz.

Re:One thing not to do (1)

mrchaotica (681592) | more than 9 years ago | (#10572675)

I vastly this sort of syntax
vastly what? ; )

Anyway, I agree. Thanks for coming up with some reasons why it's better -- now I can win when I argue about it with my friends.

Incidentally, is there any good reason why people like the other way?

Re:One thing not to do (0)

Anonymous Coward | more than 9 years ago | (#10572678)

I've got no problem with the using the opening brace on the same line.

But do you really use comments like "// end-if"???

I'd hate to read that code.

Re:One thing not to do (2, Informative)

Bonkers54 (416354) | more than 9 years ago | (#10572633)

Both (sp)lint _AND_ gcc with -Wall should have picked up this error immediately. Try using the tools available to you.

Re:One thing not to do (1)

Sir Joltalot (66097) | more than 9 years ago | (#10572713)

Meh, don't feel bad dude, I've done that a few times :) I know to look for it now when things just don't seem right...

high school (5, Informative)

Anonymous Coward | more than 9 years ago | (#10572510)

This may sound a bit odd, but I went back to my home country Iran for 2 years as a teenager. This is when I had my first insight into computer programming.

At the time I along with most students didnt have a computer, not did I have access to one properly.

I did my first BASIC coding on paper. Looking back, working that way worked extremely well.

Since then I always do some sort of rudimentary pseudo code on paper before implementing using a computer.

note: I never finished high school and I haven't been to university

Re:high school (1)

fireboy1919 (257783) | more than 9 years ago | (#10572567)

The more modern approach that I use for the same thing is creating module/class declarations/headers before I actually code it.

The skeleton tells me where the crap is going to go, and then I put it there.

But...sometimes I succumb to temptation and just use a fourth generation language that makes the code so small I hardly need to plan. Just looking at it I can tell what it's supposed to do conceptually.

Re:high school (1)

flycrg (801803) | more than 9 years ago | (#10572658)

I do that as well, although for different reasons, my psych class is quite boring.

Re:high school (0)

Anonymous Coward | more than 9 years ago | (#10572703)

Pff, that's nothing. In my theocratic dictatorship, we didn't have any fancy paper to write our code on. We had to write in the snow with our fingers without mittens on a hot day-- uphill both ways!

did you sign up as a terrorist instead? (-1, Troll)

Anonymous Coward | more than 9 years ago | (#10572712)

no need to finish high school for that career.
just learn to be hnady with a knife I guess.

i thought it was going to be something serious... (3, Insightful)

Fluidic Binary (554336) | more than 9 years ago | (#10572514)

I was hoping for something educational and instead I found a collection of jokes that I don't find very amusing. I mean sure I'm smirking, but shouldn't something that took that many bytes at least make me chuckle?

Re:i thought it was going to be something serious. (1)

lakiolen (785856) | more than 9 years ago | (#10572654)

Try doing the opposite of what it talked about in the article and it might actually get you somewhere

Re:i thought it was going to be something serious. (1)

adamjaskie (310474) | more than 9 years ago | (#10572672)

Here's somethign useful: Apparently, some graders do not like you to use the ? : operator. They get confused, and mark you down. Getting the points back can be annoyingly time consuming.

Ye old Slashdot Effect (4, Interesting)

beacher (82033) | more than 9 years ago | (#10572522)

Anyone want to see it? If you can get the page to load, click on the chart icon which leads you here [nedstatbasic.net] ...
12:32 EST 20 octubre 2004 1223... Took 300 hits since 2 minutes ago.. Neat

Re:Ye old Slashdot Effect (2, Funny)

ral315 (741081) | more than 9 years ago | (#10572612)

From 6:00p-12:43a EST, it's taken 2407 hits- 48140% more traffic than it did the previous day.

An example from the article (-1, Troll)

teamhasnoi (554944) | more than 9 years ago | (#10572533)

10 Print "Here is my great new program!":Print
20 Input "Are you voting for George Bush? Y/N";A$
30 IF A$="N" THEN PRINT "A+ for the Semester!"
40 If A$="Y" THEN GOTO hell you dumbass
50 END
60 REM Released under the GPL : Copyright 2004 teamhasnoi

Re:An example from the article (0)

Anonymous Coward | more than 9 years ago | (#10572596)

I hope you don't work for Diebold.

GO RED SOX!!!! (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#10572573)

Go Red Sox! Down With the Evil empire! Down Down Down!!!!

For the guys... (0)

Anonymous Coward | more than 9 years ago | (#10572579)

If you are very good at programming and there are cute gals in your class take it upon yourself to offer then help and late night tutoring (if they ask for it.) If you are the typical geek who is akward in social situations then trust me there is never any easier way than this.

Re:For the guys... (2, Funny)

vranash (594439) | more than 9 years ago | (#10572725)

Yeah, I mean I once had a girl in a programming class say she'd do *ANYTHING* to pass the class, so I had her buy me dinner in exchange for helping her study, then never saw her again!

Sad part is this is all true.

Guide to programming languages (4, Funny)

prostoalex (308614) | more than 9 years ago | (#10572584)

Re:Guide to programming languages (0)

Anonymous Coward | more than 9 years ago | (#10572696)

that was perfect! thanks

Re:Guide to programming languages (0)

Anonymous Coward | more than 9 years ago | (#10572704)

The parent post isn't informative at all. It's _funny_. Apparently the moderators only read the titles and perhaps some of the body. Maybe we can spur a whole new form of posting! Just post cool-sounding titles and relevant-sounding links!

"Cheat with your assignment" - ETS (2, Informative)

Anonymous Coward | more than 9 years ago | (#10572598)

I go to the ETS, (Superior Technology school) in Montréal, and currently strudying CS. The part : "Copy the programs. Lecturers will probably have to mark dozens of them, making it difficult to spot similarities between them. And even if they do, it sure as hell ain't easy to prove..." don't really apply to us.
You see, they have a kind of program, which they use to compare all the assignement that are handed in. Not only does it compare it with everyone in your class, it compares your code with the code of all the students from the last four year.

Try and copy anything now... good luck!
This is how you run a school ... at least with respect to CS assignment handling...
Any other school has a similar setup?

For the curious (2, Informative)

ICECommander (811191) | more than 9 years ago | (#10572604)

Here are the site's hit statistics (scroll down to October 20):
http://www.nedstatbasic.net/s?tab=1&link=1&id=3111 461 [nedstatbasic.net]

Re:For the curious (0, Offtopic)

888 Geek Help (607631) | more than 9 years ago | (#10572710)

watching the /. smackdown in realtime
A new all time low in spectator sports

Golf clap anyone?

The best advise.... (5, Interesting)

cjjjer (530715) | more than 9 years ago | (#10572640)

For those students just getting started in a Computer Science degree or a career in software development.....

Quit now and take up a skilled trade. The odds that you will be employed in the future are marginal at best. While most here might think that as trolling or flame-bait it's the cold reality. I have several friends who are tradesmen who say in the next 5-10 years there will be a significant shortage of highly qualified tradesmen. Where as everyday more software jobs are going off shore, it's pretty hard to send manual labor off shore and be competitive.

My $0.02

My advice for young programmers (4, Informative)

jschottm (317343) | more than 9 years ago | (#10572641)

This is stuff aimed at people without a whole lot of experience programming in first year CS courses.

1. Get a software engineering book, and study the concepts of software design. Even if you're just doing some small little "print a schedule" type assignment, thinking about how you would design a bigger project will help you.

2. Get a good book on algorithms. I'm partial to Introduction to Algorithms [mit.edu] but there's lot's of good choices. So when your prof assigns you to do a project using a circular linked list, think about what might be better. But resist the temptation to smart off and try to do better, and complete the assignment the way (s)he says to. Perhaps ask the instructor what they wanted you to learn from the assignment if you feel that the algorithm is particularly inappropriate.

Don't just read the alogrithms, write them from scratch as well until you understand them. Be aware that some algorithms are completely different if you're using a language that starts arrays at [0] than at [1].

3. Take good technical writing courses. Many CS majors can't write well. Being able to clearly communicate is a great skill to have, regardless of what your position is, and it's a good way to differentiate yourself from the masses. Being able to write in American style English is something that many Indian/Chinese/etc. programmers won't be able to offer.

Take business courses, etc. Broaden your horizons in profitable ways.

4. Network, network, network. Not LANs and wireless, but people. They are the ones that will get you jobs in the future, who will provide you with sales leads and consulting. Mingle with people in the field. Mingle with business majors. Start it now, not in your senior year. Today's seniors may be the one's e-mailing you about a great position three years from now when you're about to graduate. I've seen very smart, very talented people sit for months without a job because they didn't start this process early.

5. Get out and enjoy yourself. You have the rest of your life for LAN parties and coding sessions. If you're in college and not working, you are likely never to have the same freedom that you do now. (Excepting unemployment...) Get out, go hiking, meet people of the appropriate sex, see concerts, learn to cook. Virtually no one dies wishing they'd spent more time in front of an LCD screen.

Wait until the PENultimate minute. (2, Informative)

emarkp (67813) | more than 9 years ago | (#10572648)

Nearly every assignment I received was modified between assignment and due date when earlybirds ran into difficult or unsolvable snags. These were the only classes I found in which waiting to start was really did help.

my guide (0)

Anonymous Coward | more than 9 years ago | (#10572664)

Already slashdotted, so i'll write my own guide.

Problem: Need a balanced 2-3 tree implemented in C++ due tomorrow?
Solution: Google it.
Problem: The Junit test fails at line: assertTrue(true);
Solution: Switch majors.
Problem: Mutual exclusion is not guarenteed in your critial section.
Solution: Use a single thread.
Problem: Deadlocks occur when you access the disk controller and main memory, but only in that order.
Solution: Get more memory from Dell.
I hope the rest of your deadline riddled, extreme programming and debugging sessions are as enjoyable to you as they were to me.

Hrmm did you know a java constructor will call super() for you if you dont do it yourself? Even if you have no super() without parameters? And that it will refuse to compile without telling you it has done this?

Real Programmers (3, Informative)

gustgr (695173) | more than 9 years ago | (#10572667)

Thanks, but I have my very definitive programming guide [welho.com] already. Mwaahahha

Why aren't people learning to code properly? (3, Insightful)

Indy Media Watch (823624) | more than 9 years ago | (#10572669)

The proliferation of 'happy-clicky' programming environments has led to sloppy inefficent coders who have limited understanding of how to write clean code.

The result? Word Processors which ship on 5 CDs and do little more than similar products from a decade ago.

More RAM, bigger hard-drives, faster processors, and for what? A new version of software that doesn't do a whole lot more to justify the upgrade?

Meanwhile, a lack of formal coding education also means we still see buffer overflows and other security nasties that should never have happened in the first place.

The good news, is devices like the Palm have forced people to operate in the limited hardware/memory environments of years ago. The result, clean efficient code in just a few kilobytes.

Time to go back to school people...

Wait, shouldn't this be in Hindi? (0, Redundant)

Anonymous Coward | more than 9 years ago | (#10572679)

After all, all the coding jobs will be in India now, no?

You know, (1, Troll)

HoneyBunchesOfGoats (619017) | more than 9 years ago | (#10572691)

I appreciate that you're trying to point out common mistakes and misconceptions, but the whole tone of the thing just seemed like it was aimed more at making fun of students past and present than at helping them. Am I the only one that thinks constructive criticism is better than being a jackass? Almost all the tips had nothing to do with actual coding. ("Ignore error messages, you'll be soo c00l!!11!") Somehow I doubt that this will endear you to your students.

In my experience.. (1)

Soldevi (776054) | more than 9 years ago | (#10572706)

.. most CS students should not be in the program much less touching computers. A good programmer is usually found in someone who does it outside school or work requirements. Someone who touches the command line for the first time in their Intro to Java class (one of the first ones in most CS programs today) is not one of these people. That is the majority of CS students. The ones who do the tihngs listed on that page.

Bad Joke (3, Interesting)

cookiepus (154655) | more than 9 years ago | (#10572711)

Dont compile on a regular basis, dont tiptoe your way forward. Youre a professional and professionals take giant steps. Write thousands of lines of code first and leave the compiling for later; it will be far more entertaining and worthwhile to look for compiling errors.

Actually that's uncalled for. Compiling frequently is not good because you should not be thinking about such details as syntax and var name spelling until the very end.

For most of the time you're writing code, what you have should not be compileable. Well, doesn't need to be. Since you (hopefully) are doing things top-down, at first you're going to have a lot of empty functions and comments.

Then you're going to fill in code. During coding, why bother compiling? Who cares if you get a 100 compiler errors at the end when you compile once, vs. getting 1 error each time, but having to compile 100 times?

Don't bother. Focus on the higher picture. Implement your vision. Only once you've done that, fix what the compiler is bitching about. Doing the same things along the way can sidetrack you from your higher-level view of the program.

Besides, it's a lot less annoying. Say, you're done coding. All you have to do is go make tiny changes to shut up the errors. Probably won't have to think too hard how to fix them. And then you're DONE!

The other way, you go fix your errors, and you still got mad code to write. And now you're annoyed and distracted so it won't even come out as good.

Also, sometimes I actually shock myself by writing code for an entire day and then having it compile w/o errors the first time! I really don't expect that, and it's a "wow" thing when it happens.

Read Asimov, do assignment later (1)

xtermin8 (719661) | more than 9 years ago | (#10572728)

Read one of Asimov robot books. You're probably going to be working on positronic brains and doing robot psychology, anyways. Humanoid robots are going to do all the coding for us in the near future. ;->

Hint for programming. (4, Insightful)

Spy der Mann (805235) | more than 9 years ago | (#10572733)

Here's a VERY GOOD hint for those of you who are starting to program:

THINK UML.
THINK OBJECTS.
THINK MULTI-TIER.
THINK BOTTOM-UP.
USE A NOTEBOOK.

If you start designing on paper the functions/object/interfaces/etc for your program, then start coding. As you begin to code, you'll start realizing that you'll need auxiliary functions (like an array searcher or something - most of the time lazy guys like you or me want to do everything in one function or method. Don't fall in the trap. If a series of steps is going to be very difficult, thing bottom-up and put it in a separate function or method. But before you start coding it, add it to a "to-do" list in your notebook.

That way you can keep coding your current function, by calling the not-yet written function that only exists as a declaration on paper. But the idea is there.

In the end, you'll end up with practically a completed .h header file or UML diagram on paper.

That helps a lot when programming (specially for low-termed memory guys like me). When you're finished designing the code, all you got to do is start typing and see which functions need to be coded, or which details . Why? Because you've already solved the problems in your code.

In one day i could design an OOP SQL wrapper (business tier) for my database project, and i only had to adjust minor details (i.e. bugs) when finished coding.

So, believe it or not, paper SAVES TIME. Trust me.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>