Programming Assignment Guide For CS Students 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!)"
rule 1 (Score:2, Funny)
Additional Advice (Score:5, Funny)
Comment removed (Score:5, Funny)
Programming Mistake #1 (Score:5, Funny)
One thing not to do (Score:5, Funny)
if (condition);
{
myvar = 1;
}
The block was a lot bigger than myvar = 1, and my eyes kept skipping over the ;
Re:Compiler Warnings (Score:1, Funny)
Re:Additional Advice (Score:5, Funny)
Re:Most of the Prof's lecture notes are plagarized (Score:2, Funny)
Re:Additional Advice (Score:3, Funny)
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:Slashdotted. Already. Here is article text. (Score:3, Funny)
Guide to programming languages (Score:5, Funny)
Re:Ye old Slashdot Effect (Score:1, Funny)
Re:Additional Advice (Score:5, Funny)
Re:Advice from a fellow student (Score:5, Funny)
My motto: code drunk, debug sober
Re:For the guys... (Score:2, Funny)
Sad part is this is all true.
your code should read like a novel (Score:5, Funny)
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.
While we are on the subject (Score:5, Funny)
http://mindprod.com/unmain.html/ [mindprod.com]
My favorite:
Another Tip (Score:5, Funny)
I was playing with obfuscated Perl code, and got about 300 lines out. It was a script to go through my gaim [sf.net] logfiles, and generate stats for how much I talked to each person, how verbose they were, and so forth. It mostly just shelled various shell commands like wc, and my PIDs jumped by about 1,000 at the end (meaning that it was spawning about 1,000 processes from start-to-finish.) It wasn't well-written or anything, but it was kind of cool. And writing obfuscated, hack-job code is kind of fun. It ended up producing an HTML file.
I finally decided that it'd be cool to have the program read its own source and output it to the HTML file. It was pretty easy, and, as with anything else done just for fun that isn't too challenging, I just assigned stuff to random variable names. $hats and $fog were the most commonly-used.
I simply opened the source as $hats, and opened $fog for write, and then wrote $fog to $hats. No errors or anything!
The output file was blank. So I went back to edit the source code. Umm, it's blank too. And, of course, I was just messing around, so I had no backups.
Then one day it suddenly occured to me: I probably screwed up the variable names for the input and output, reading the blank output file and writing it over the program's source code.
So, remember, kids, use meaningful variable names. Using $hats instead of $fog could be the end of your program.
Re:Advice from a fellow student (Score:5, Funny)
Re:Most of the Prof's lecture notes are plagarized (Score:1, Funny)
Re:Additional Advice (Score:2, Funny)
Re:Most of the Prof's lecture notes are plagarized (Score:2, Funny)
Re:Additional Advice (Score:5, Funny)
No, no, no. Just patch the iterpreter or compiler to allow floating point line labels!
Funny incident (Score:1, Funny)
As we, in the software community know, manual find and replaces are prone to errors. So, he submitted the code to his professor, who approved it and executed it.
Unfortunately, the output started with something like:
THIS PROGRAM IS WRITTEN BY BILL GATES
Luckily, the professor did not see the message printed, and gave him a high score.
Re:Cheating. (Score:0, Funny)
Nobody ever figured out my method of cheating. But I got great grades and I sure didn't have to waste time thinking of how to write those silly assignments!
Re:Additional Advice (Score:3, Funny)
You might goto line 1.9999 when you meant to goto line 2. But hey, that's one of the prices you should be willing to pay for living on the bleeding edge of line numbering technology.
Re:Compiler Warnings (Score:5, Funny)
Old comments:
-1 Missing ";"
-1 Changed case of variable; not recognized by the compiler.
-2 Need a closing bracket "}"
-3 Trying to write from an unassigned pointer.
New comments:
-1 Missing weasels exception error.
-1 I just felt like taking a point off here.
-2 For great justice
-3 Disco Inferno at this point in the code.
I never got up enough nerve to actually do it. Plus, I don't really want to risk any students suing the school.
How about... (Score:4, Funny)
-Bullseye
Re:For the guys... (Score:2, Funny)
A woman says she'll do anything for your help and the best you can think of is dinner? She said ANYTHING! Are you a man or what!?! Think bigger my friend!
Have her buy you two dinners!
Re:your code should read like a novel (Score:1, Funny)
Re:Cheating. (Score:5, Funny)
Yeah. Thats what the college of business is there for.
Re:My advice for young programmers (Score:1, Funny)
Re:While we are on the subject (Score:1, Funny)
Re:Most of the Prof's lecture notes are plagarized (Score:3, Funny)
Suggestion for Instructors (Score:3, Funny)
MAVADDAT SPEECHLESS!!! (Score:5, Funny)
mavaddat work very long time downloading lecture notes for ungrateful kids paying only $700!
mavaddat remind you 30" lcd monitor needing to purchase but cost much more!!!!
MAVADDAT THE PROFESSOR!!!!! MAVADDAT BREAK HEAD WITH PLAGIARIZED CD!!!!!
FOR and WHILE loops are for babies (Score:3, Funny)
That'll teach those dirty corporate &%*@!s. Lay me off will you? I hope the Indians like puzzles!
Besides, nothing's cooler than that which has the rule "Just have faith it [recursion] will work."
this copy thing seems... (Score:3, Funny)
They forgot (Score:3, Funny)
Time wasted coding error handlers is better spent implementing more features in your program. You can always wait for version 2 to implement real error handling where it is needed based on user reports.
Re:Slashdotted. Already. Here is article text. (Score:5, Funny)
Re:Advice from a fellow student (Score:2, Funny)
BS.
True story (Score:4, Funny)
Half the class confessed.
Re:Slashdotted. Already. Here is article text. (Score:3, Funny)
erm, The kind of person who is being satirical??
But of course, I could be wrong since I'm not a PhD student....
Re:Advice from a fellow student (Score:1, Funny)
Re:Advice from a fellow student (Score:1, Funny)
Uh dude... they're just pretending. They're acting like that because they want you to fuck them.
Re:Finer points of Spanish-English translation (Score:1, Funny)
Re:your code should read like a novel (Score:1, Funny)
most likely you're using a custom language, which will be unfamiliar to the reader, and therefore will require a novel to explain it!