Slashdot Mirror


Programming Assignment Guide For CS Students

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!)"

761 comments

  1. Slashdotted. Already. Here is article text. by Pig+Hogger · · Score: 4, Informative
    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's SIGCSE in the June 2004 issue of Inroads, the SIGCSE bulletin.

    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

    1. Re:Slashdotted. Already. Here is article text. by roman_mir · · Score: 2, Funny

      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.

    2. Re:Slashdotted. Already. Here is article text. by Anonymous Coward · · Score: 0

      This article is kinda stupid. The writing is unimpressive and the humor is banal.

    3. Re:Slashdotted. Already. Here is article text. by Anonymous Coward · · Score: 0

      hear, hear!

    4. Re:Slashdotted. Already. Here is article text. by Anonymous Coward · · Score: 1, Insightful

      The moderators have been on crack ever since the moderation system started.

    5. Re:Slashdotted. Already. Here is article text. by k2nysis · · Score: 0, Redundant

      Don't ask for help If there's something you can't do, if you have a query or if you're lost, don't look for help, don't ask questions during the lecture and don't go to your tutorials. There are thousands of reasons why you shouldn't but here's just a few of them:
      * Going to a tutorial and asking questions is tantamount to admitting you're stupid.
      * Better to be ignorant than to run the risk of revealing that you don't know something you should.
      * Ask a question during the lecture and your fellow students will think you're stupid. You don't 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; that's 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 don't worry, he won't be able to resist helping you in those dark, gloomy hours of need.



      What kind of person would advise someone not to make questions because he/she will be intepreted as stupid?
      the answer is people with low sel-esteem and confidence.
      Im a PHD student and im also demonstrating for some of the courses in my Uni. I have to say that people who ask questions, people who seek help are those who succeed. People who have the above attitude are closed to themselves and they do not accept the help provided to them. Im there for answering questions to the best i can.
      I have to say that such an advice is ridiculous to say the least. The intelligence is something everyone is born with, that is constant. The effort you put in something is what is dynamic, what changes. So give me a break, i want to see people who try, and yes make questions. Thank you very much!!

    6. Re:Slashdotted. Already. Here is article text. by Anonymous Coward · · Score: 0

      * Better to be ignorant than to run the risk of revealing that you don't know something you should.
      you should?! you should?!?! you are a student for gods shake!! the goal of a student is to acquire knowledge that does not possess already.
      and to generalise the above, everyone is a student in this life throughout his/her lifetime, so noone is obliged to know anything. What on the other hand we need to do is to make our best to learn new things, in order to evolve ourselves.
      (sorry for replying to my own message...)

    7. Re:Slashdotted. Already. Here is article text. by slashdotnick · · Score: 1

      I think you may have missed the 'NOT' in the title of that article.

    8. Re:Slashdotted. Already. Here is article text. by cozziewozzie · · Score: 4, Funny

      You're a PhD student, and the only thing wrong you noticed with this heap of advice was the little part you quoted? Oh my. Good luck with your PhD! :-)

    9. Re:Slashdotted. Already. Here is article text. by MrPoopyPants · · Score: 1
      What kind of person would advise someone not to make questions because he/she will be intepreted as stupid?

      Man, what a stupid question. stupid stupid stupid. I cannot believe somebody would ask that.

      OK, I was kidding... but seriously, the article reads like a list of things not to do, so this is saying that you shouldn't be afraid of being thought stupid for asking a question. (In the quoted text a bit of a humorous clue about the true nature of the statement: "You don't think that of them when they ask a question, but they will about you.")

    10. Re:Slashdotted. Already. Here is article text. by sm1979 · · Score: 2, Insightful

      Sorry to say that man, but you really got lost on the irony in the text. Or you are so used to skimming over 100+ pages of literature at insane speeds doing your PhD research that you just can't slow down while reading anymore. :-)

    11. Re:Slashdotted. Already. Here is article text. by JudicatorX · · Score: 3, Funny
      What kind of person would advise someone not to make questions because he/she will be intepreted as stupid?

      erm, The kind of person who is being satirical??

      But of course, I could be wrong since I'm not a PhD student....

      --
      "It is a good divine that follows his own instructions" - Portia, The Merchant of Venice
    12. Re:Slashdotted. Already. Here is article text. by FreeForm+Response · · Score: 1

      Or they'd die happy.

    13. Re:Slashdotted. Already. Here is article text. by AvantLegion · · Score: 1
      >> Im a PHD student and im also demonstrating for some of the courses in my Uni.

      Did you lose your apostrophes back in undergrad?

    14. Re:Slashdotted. Already. Here is article text. by Rei · · Score: 1

      They omitted one important point:

      Drastically expand the scope of your project. It's one thing to do everything that the lecturer asked of you, but if you do 10 times as much, they'll be 10 times as impressed! Give that data structures project a 3d OpenGL interface. Make that FFT code be remotely operable via your own UDP-based protocol. Need to program a database? Have it be optimized by a neural net! Sure, the original project was designed to be finished in the time allotted, but you're a much better programmer than everyone else, so you'll have plenty of time to spare!

      --
      Did you really name your son "Robert');DROP TABLE Students;--"?
    15. Re:Slashdotted. Already. Here is article text. by hackerm · · Score: 1

      I could do without the hitman, though.

  2. rule 1 by Anubis350 · · Score: 2, Funny

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

    --
    "goodbye and hello, as always" ~Prince Corwin, from Zelazny's Amber series
    1. Re:rule 1 by Anonymous Coward · · Score: 0

      see rule 1

    2. Re:rule 1 by Mad+Marlin · · Score: 0, Flamebait
      MIRROR

      Why thank you.

      FUCK BUSH

      There is at least two meanings to this one. Either way though, I must say your mind is quite a skilled and tactful machine.

      GET OUT OF IRAQ

      That does sound like an excellent idea. How about they take an eastern march out? They might even find something useful to do on their journey.

    3. Re:rule 1 by rendermaniac · · Score: 1

      Rule 2:

      Do not read Slashdot whilst you are meant to be doing a programming assignment.

    4. Re:rule 1 by RealityMogul · · Score: 1

      Or use Mirrordot for all your Slashdot needs.

    5. Re:rule 1 by Phisbut · · Score: 1
      Rule 2: Do not read Slashdot whilst you are meant to be doing a programming assignment.

      D'OH!!! You got me there...

      --
      After 3 days without programming, life becomes meaningless
      - The Tao of Programming
    6. Re:rule 1 by Anonymous Coward · · Score: 0

      No no no...

      The first rule of writing a programming assignment is: You do not talk about writing a programming assignment.

      The second rule of writing a programming assignment is: You do not talk about writing a programming assignment!

    7. Re:rule 1 by EugeneK · · Score: 1

      Oh yeah by all means. Iraq was so easy and is now nice and peaceful and not a problem for the US at all. I'm sure Iran will be even easier!

  3. Bad Idea by Anonymous Coward · · Score: 5, Insightful

    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.

    1. Re:Bad Idea by xs650 · · Score: 4, Insightful

      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.

    2. Re:Bad Idea by Ignis+Flatus · · Score: 1

      That's silly. It's not either/or, do both.

    3. Re:Bad Idea by Concerned+Onlooker · · Score: 4, Insightful
      It's not about not making mistakes, it's about bad habits being formed. Of course we're going to make mistakes starting out, but this is about avoiding the mistake of forming harmful habits.

      We cement our knowledge by doing hands on programming and working out problems, but we have to learn from someone/something in the first place, otherwise we'd be always reinventing the whole process.

      --
      http://www.rootstrikers.org/
    4. Re:Bad Idea by SvendTofte · · Score: 1

      A witty saying proves nothing.

      Reading others mistakes DOES NOT equate having gone through them yourself. When you make a mistake, in your effort to solve it, you will often head in the wrong direction, and explorer. Maybe time wasted now, but the broader understanding you're hopefully picking up, while looking for the correct answer, will more then pay back any time lost.

    5. Re:Bad Idea by ChuckSchwab · · Score: 0

      Or, to put it another way, make only new mistakes.

    6. Re:Bad Idea by HawkingMattress · · Score: 2, Insightful

      There are mistakes you can learn from by reading, e.g you can understand that reading a stream using a particular technique is bad in whatever circumstance because of this and that.
      But the most important mistakes generally seems obvious when you read them, and you only realize you felt in the trap, and why it's so easy to fell in it once you've made it using your own flawed logic. Then you realize you're in the exact situation this damn book told you was bad, and you start to realize why the book tried to warn you. No it wasn't so obvious, because it seems so logical and fits well at first glance.
      What the book didn't tell you is how to recognise the start of a reasonment that will lead to this error...
      A detailled modelisation should be able to see those problems before implementation, but the modelisation is never detailled enough to spot everything.

    7. Re:Bad Idea by Erik+Hollensbe · · Score: 1

      Plus, think of all the code you'll keep for a later use!

      Last week I was working on a suite of programs for some web application, and I came up with a few useful concepts that I scrapped in favor of simplicity later.

      This week, I'm working on another suite of programs where the scrapped ideas are now becoming a useful facet of my project.

      A much more witty man said (paraphrased), "Science is 99% Perspiration and 1% Inspiration". It would be stupid to ignore the inspiration you get while wiping your brow.

    8. Re:Bad Idea by nameer · · Score: 1
      Except for learning to fly. Much better to learn from others mistakes.

      The point is (I'm an American, I'm compelled to explain my own point), there are a number of circumstances where it is completely unacceptable to make your own mistakes.

      --
      "Uh... yeah, Brain, but where are we going to find rubber pants our size?" --Pinky
    9. Re:Bad Idea by Anonymous Coward · · Score: 0

      True, if and only if you make the effort to learn from your mistakes.

      Many of the examples he presents could counter your statement. If you spend the time to properly design your code (to some extent, at least) before coding, your end product may come in faster and better quality. If you always wait until the last moment, and you always skip that step because you perceive it as wasting time on something besides coding, then you will never learn how valuable it can be.

      Where I work, I am the intellectual. We have a lot of very smart, talented people, but when a problem comes up they quite often go for the most obvious way to attack the symptom. They are doing what this guy is talking about. I stop and think for a bit to understand the problem's cause, and determine the available solutions, then think about the time and cost associated with each. Sometimes, their way is the best, and I'll agree with them. Somtimes I can beat them hands down.

      They have been doing this for a lot longer than me, and still haven't figured out that 'stop and think' step. Or, maybe they just do it faster, but don't understand the things as well as I do. In any case, many of them could use a 'common mistakes' book over the head.

    10. Re:Bad Idea by AvantLegion · · Score: 1
      >> A smart man learns from his mistakes
      >> A wise man learns from others mistakes.

      A drunk man pays alimony for his mistakes.

    11. Re:Bad Idea by Anonymous Coward · · Score: 0

      Unfortunately this does not apply to things that no one has tried before.

      Only the brave can determine if it works or not...

      Or at least try not to look that stupid when it fails.

    12. Re:Bad Idea by smithmc · · Score: 1

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

      I'm not so sure about this. Not that I would consider The Matrix to be a good source for philosphical truth, but it did contain at least one nugget: "Knowing the path is not the same as walking the path." In many cases, you can't really understand, in your guts, why a mistake is a mistake until you make that mistake yourself, and experience the consequences yourself.

      --
      Downmodding is the refuge of the weak. Don't downmod, make a better argument!
  4. Cheating. by mikeleemm · · Score: 2, Insightful

    Not cheating would be a good important one.

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

    1. Re:Cheating. by Anonymous Coward · · Score: 0

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

    2. Re:Cheating. by Anonymous Coward · · Score: 0

      RTFA

    3. Re:Cheating. by sqrt(2) · · Score: 2, Informative

      Why? It's giving you real world experience. Do you think professionals don't steal code?

      --
      If you build it, nerds will come. Soylentnews.org
    4. Re:Cheating. by Anonymous Coward · · Score: 0

      bwahahahaha

      Once, someone handed in an assignment nearly identical to mine. We were naturally both questioned by the prof.

      This is where being a keener comes in handy. The prof knew me, knew that I took way too much pride in my work to cheat, and had me go over the internals just for good measure.

      From the fact that I never saw the other person again, I infer that he was not similarly capable of deffending his position.

      It was never clear how he got it. It was thought that one of the lab TAs gave it to him. No one ever proved anything though.

    5. Re:Cheating. by Concerned+Onlooker · · Score: 2, Insightful
      It's hard for me to imagine cheating on a coding project (or anything else, for that matter). I've gone back for a second degree after many years out and I'm taking all that math I avoided the first time around. I do not like the math so much, but I'm putting on my game face.

      I feel like I'm taking more math than CS so when I get into a CS class it's just plain fun. If you have to cheat at something that is your major, for crying out loud, what are you doing in that major?

      --
      http://www.rootstrikers.org/
    6. Re:Cheating. by Anonymous Coward · · Score: 0, Funny

      Allow me to be completely honest. I was such a lazy slacker in school that I almost NEVER bothered putting in the thought or brainpower into writing an assignment. Instead, what I usually did was find a way to hack into the time sharing system, bypass file access privileges, and grab other students' finished code. I would then compile them into executables, and tested them to ensure they worked. I would keep discarding until I found one with the least possible number of run-time bugs. I would then use a disassembler and generate an assembly language version of the executable. Finally, using the assembly language version as a reference, I would begin coding in the appropriate high level language.

      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!

    7. Re:Cheating. by demonbug · · Score: 5, Funny
      OBVIOUS, but always missed. If you need to cheat, change majors.


      Yeah. Thats what the college of business is there for.

    8. Re:Cheating. by Anonymous Coward · · Score: 0

      TROLL!?!?!?!? I think it was intended as a JOKE, people! Anybody with half a fucking brain cell could tell that it would involve substantially more work in his/her method of cheating than it would have if he/she had just done the assignment to begin with.

      I swear, they give mod points to anybody these days.

    9. Re:Cheating. by Anonymous Coward · · Score: 0

      I dunno... I have, erhm, a friend... that sometimes will spend more time getting around the system than just actually sitting down and doing the assignment.

    10. Re:Cheating. by opqdonut · · Score: 1

      I realise your post might've been somewhat tongue-in-the-cheek, but i wouldn't count "Arben" as a professional even in a joke. He's what I'd call a "opportunistic SCO-like bastard" :)

      --
      yes > /dev/dsp
    11. Re:Cheating. by ppz003 · · Score: 1

      You really don't want to cheat in a programming class with tools like this freely available. Working as a teaching assistant for a C and JAVA class, several students were caught and failed the class. Some were even expelled from the university.

    12. Re:Cheating. by chialea · · Score: 1

      Enjoy the math. Math is your friend! You know by now, I'm sure, that it will help you, not only with direct skills but with additional training in critical thinking.

      If you're not enjoying your math classes, please allow me to suggest a few that I've really enjoyed, and that you might enjoy and find helpful as a CS person (in decending order):
      * General discrete math
      * Combinatorics
      * Number theory (a special case of...)
      * Abstract algebra

      All of these things are applicable to computer science (none of them involve real numbers ;) ), and are incredibly helpful in terms of logic and foundational math for a large part of CS.

      Hope you enjoy em :)

      Lea

    13. Re:Cheating. by deunhido · · Score: 1


      If you need to cheat, change majors.

      Changing majors is cheating.

  5. slashdotted... almost! by stilist · · Score: 1

    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.

  6. i can't get to the article, but... by ansleybean · · Score: 5, Insightful

    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."

    1. Re:i can't get to the article, but... by gcaseye6677 · · Score: 5, Insightful

      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.

    2. Re:i can't get to the article, but... by Christopher+Thomas · · Score: 5, Interesting
      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.

      There are a few things that you can still look for, here:
      • Nearly identical style.
        This includes names, indenting, order of functions, spacing conventions, and so forth. Some similarity could be coincidence. Nearly identical style is very suspicious, especially if any of the other flags come up too.

      • Nearly identical discussion.
        Many assignments (like the ones I'm currently marking, for instance) require a short write-up explaining what they did. This may only be a few sentences, but people who cheat tend to either copy it word for word, or do a broken copy of it taking key words and trying to paraphrase the rest. Usually badly. This leads into the next point.

      • Identical mistakes.
        Two assignments. Both would fail on their own lack of merits, but curiously, they both made exactly the same set of errors, in addition to having very similar style. Not likely to be concidence, that. Especially since they were...

      • Handed in on top of each other.
        These assignments are put in a drop box. Electronically submitted assignments are usually datestamped. Cheaters, once they finish cheating, tend to submit at the same time (at least in this course). Finding two matching assignments in a stack of a hundred would take a good memory (or a heuristic checker). Finding two matching assignments that are right on top of each other, or within a few entries of each other, is much easier.


      Despite the fact that it's _possible_ to cheat without detection, a large number of people don't. Remember, the people who are cheating are the ones who can't hack a first-year CS course. While there will be exceptions, the kind of person who can't figure out how to make "hello, world" or set up a very simple Excel spreadsheet, with the instructions in front of them, is probably not going to be very good at cheating either.

      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.

      The problem is that it's very hard to do this in a way that's easy to mark. In an ideal world, that wouldn't matter, but in practice, some poor TA is going to have to try to mark 200 assignments in 3 hours. That's hard enough when they _are_ written to be easy to mark (I still wince at the memory of one marking assignment that involved digesting a 5-page report and then visually determining whether another 5 pages of non-trivial code worked or not).

      In summary, despite the fact that we're stuck giving cookie-cutter assignments for practical reasons, the cheaters (that I see, at least) seem to be as bad at cheating as they are at doing the work.
    3. Re:i can't get to the article, but... by delco · · Score: 1
      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."

      Your professor obviously had no idea what he was talking about. It only takes a few seconds to make the most complex program easily plagiarized and virtually undetectable.
      1. Change the "Author" name in the header, not the formatting of the actual header - just the name.
      2. Change all of the variable names to things that would be superficially associated with you - and ONLY YOU. For example, change a variable named intCounter to myCounter or theCounter.
      3. Add some extra white space before and after all while loops - actually, go ahead and change all occurrences of the word "while" to "until" - they do the same thing anyway.
      That should be enough to get your started. Now just kick back and relax at your favorite watering hole. Throw down a couple extra beers tonight - your secret'll be safe with us!
      -Jay
    4. Re:i can't get to the article, but... by sahala · · Score: 1
      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.

      While yes, it's a great idea for professors to put out creative assignments, students should be expected to have enough backbone to not cheat simply because it's risky, a bad idea, counter-productive to their education, and simply wrong.

      That's not to say that students shouldn't collaborate and share information -- it's a good thing for CS majors to be able to actually communicate with each other. Students just need to complete and submit their own work.

    5. Re:i can't get to the article, but... by Anonymous Coward · · Score: 0

      My brother teaches CS at a major university. He was telling me that one student clearly cheated on his assignment for a machine organization course.

      I guess he was used to copying someone else's program and changing variable names to make it appear original. Unfortunately in this case it was an assembly language assignment, and he renamed the registers.

      Ooops.

    6. Re:i can't get to the article, but... by A+beautiful+mind · · Score: 0

      "Throw down a couple extra beers tonight" ... and watch how they will stick a huge F on your work.

      I'll give you an example. Your prof wants you and 300-400 others to write crappy bash scripts doing some functions. He will never check 400 scripts manually, but he can code good scripts. Guess what, he coded a nice script to check your script if its working correctly to some test input, check the format requirements, and here comes the interesting part, will strip all whitespace, assign variables a global name( so its the same in two scripts), and compare scripts. I can assure you, this works. At my university, 90 out of 400 people were caught cheating... Writing the code yourself is much more fun anyway - i enjoy coding...

      --
      It takes a man to suffer ignorance and smile
      Be yourself no matter what they say
    7. Re:i can't get to the article, but... by Anonymous Coward · · Score: 0

      Plagiarism is too much trouble to fight against. I say just give it up and don't grade the homework assignments anymore.

    8. Re:i can't get to the article, but... by simong_oz · · Score: 1

      ... the cheaters (that I see, at least) seem to be as bad at cheating as they are at doing the work.

      What always amused me was that when you stop and think about the lengths most cheaters go to it would have taken far less time to just do the assignment on their own in the first place. And they would have gotten a better mark too!

      --
      "Because it's there." - George Mallory, when asked why he wanted to climb Mt Everest, March 18, 1923 (New York Times)
    9. Re:i can't get to the article, but... by WeiszNet · · Score: 1

      At our school they developed a tool that would show a 100% match score when comparing an original and a derivative created as you suggested.

      The tool would only match structure not presentation. It parses the source code and compares the ast, but only after throwing away lots of stuff (identifiers, ...) and then sorting it in a certain way (so reshuffling functions won't help either).

    10. Re:i can't get to the article, but... by JohnFluxx · · Score: 2, Interesting

      "Your professor obviously had no idea what he was talking about. "

      This is what arrogance is. When you put down a professor, when you aren't even right.

      Sometimes just a little rephrasing can make a world of difference. Instead of "Your professor obvious had no idea what he was talking about", how about: "How would the professor spot plagiarism if I did: ..."

    11. Re:i can't get to the article, but... by multipartmixed · · Score: 2, Interesting

      > The problem is that it's very hard to do this in a way that's easy to mark.

      I used to have prof who did the semi-creative assignment thing, and this assessment is bang on the money.

      I once had to write a blackjack game in SmallTalk. The only mark I lost is because I made the dealer inherit from the player class, instead of the deck.

      WTF?! The deck? HELLO! Maybe, MAYBE I could see him wanting to inherit from the game, and make him part of game play. But making him inherit from the deck means replicating draw and hit methods, and makes no sense whatsoever.

      10 years later and about a billion lines of code later, I'm still pissed at that TA.

      --

      Do daemons dream of electric sleep()?
    12. Re:i can't get to the article, but... by ca1v1n · · Score: 1

      As a TA, I can attest to this. TAs remember mistakes. Copied code is even more likely to have mistakes, since the person doing the copying doesn't really understand the code. When we see the same mistakes in the span of 2 hours when grading, we notice. Then we mark through their original grade on the grade sheet, write PLAGIARISM in large red letters, and provide them with the URL for the code of student conduct where it says if they do it a second time after receiving a written warning, we get to send them to the committee with the authority to suspend and expel people.

      Sometimes I wish corporal punishment were still permitted.

    13. Re:i can't get to the article, but... by Anonymous Coward · · Score: 0

      This is what arrogance is.

      Uh...no. This is what sarcasm is. You obviously have no idea what you're talking about...

      Tee hee, I'm just freakin' hysterical.

    14. Re:i can't get to the article, but... by enbody · · Score: 1

      A very useful tool for cheat checking of programs is MOSS. It is free, sorts out the cheating candidates, and provides a useable interface. Of course, one must check by hand for true cheating vs. false positives.

    15. Re:i can't get to the article, but... by Christopher+Thomas · · Score: 1
      A very useful tool for cheat checking of programs is MOSS. It is free, sorts out the cheating candidates, and provides a useable interface. Of course, one must check by hand for true cheating vs. false positives.

      This was alluded to by my "heuristic checker" comment, above. Downsides:
      • It won't check things like the MS Excel assignments the profs have decided should be in the course this year (insert "how is this CS?" grousing here).

      • I seem to recall there being controversy at some point with MOSS keeping a digest of statistics from all submitted assignments (or maybe even keeping them on file).

      • The good cheaters, however many of them there are, still won't be caught.


      It does, however, help a lot catching the bad cheaters who _didn't_ hand in their assignments on top of each other.
    16. Re:i can't get to the article, but... by delco · · Score: 1

      This is what arrogance is ... Instead of "Your professor obvious had no idea what he was talking about", how about: "How would the professor spot plagiarism if I did: ..."

      Interesting opinion. You should have probably read the entire post before your replied. I take that back. "How would you have spotted the sarcasm if you did't read..."

    17. Re:i can't get to the article, but... by toremini · · Score: 0

      Speaking of plagiarism: My college had a shell script, called big brother that would run diffs against everyone's shell scripts in the same section, as well as other ones to check for similarity. It was funny enough that two people got caught with a rate of about 96% (the shell scripts were only like 150 lines or so). Basically they copied everything, except the name and student numbers. They were warned! I guess they have a nice note on their transcript.

    18. Re:i can't get to the article, but... by JohnFluxx · · Score: 1

      hmm. Even on a reread, it doesn't sound like sarcasm.

      *sigh*
      Oh well.

    19. Re:i can't get to the article, but... by Soul-Burn666 · · Score: 1

      A method being used where I study goes like this:
      After the homeworks are checked, but the grades not yet published, and cheating has been noticed, a message to the course mailing list says something like: "We have found out several cases of cheating, we don't care who let who copy, both of you get a 0. If the CHEATER will come and confess, the one that let him copy will get his full grade. The cheater ofcourse will get a 0."

      This system worked much better than expected. The ones that let them copy push the cheaters to go and confess and generally they won't let them copy again. My brother was a TA in such a course, and eventually, more cheaters came than the assignments he found to be cheated.

      --
      ^_^
    20. Re:i can't get to the article, but... by Anonymous Coward · · Score: 0

      Wow, things have changed, back in my day (lol, I can say that now) I was actually told be a CS professor "the best programmers plagarize"

      Been doing that ever since

    21. Re:i can't get to the article, but... by david_reese · · Score: 1
      I once had to write a blackjack game in SmallTalk. The only mark I lost is because I made the dealer inherit from the player class, instead of the deck.

      Yeah, I really feel the pain with ya, brotha. That's one thing I *HATE* about single-inheritance object-oriented models, esp. in smalltalk... there are so many ways to do the right thing, that often times, flamewars are caused simply by difference of opinion on what way is more "appropriate". Also, single inheritance schemes sometimes seem right, but when scope changes, you have refactor simply because the object model doesn't make sense any more.

    22. Re:i can't get to the article, but... by Retric · · Score: 1

      I agree with the TA.

      There is no reason to thightly coupple the player and the dealer class. Make an abstact class that inherets from deck that has the draw and hit methods.

      That and the only thing you need to change would be the logic in there to hit or not to hit function So you seperate the game play logic from the drawing logic.

      As to droping point's that's a little harsh then again something should seperate 95% from 100%. AKA it's anoying to see a few 100's when some of them are shit and you spent a while makeing a much better project.

    23. Re:i can't get to the article, but... by Teach · · Score: 1

      As a computer science teacher who grades tons and tons of student work myself (no TAs or student aides here...), I agree with your whole list.

      One time I had a kid who turned in code copied from another student, but unlike most, he denied it when confronted. (He had a lot to lose if he failed the term.) So I was faced with trying to prove it to his parents, who believed him since he's normally a trustworthy kid.

      In this case, the cheating was so egregious that I made transparencies (like for an overhead projector) of both the alleged "original" code, and the "copied" code. Though this was a vaguely-specified doubly-linked list container data structure in C++ (and thus prone to be highly individual), the two assignments matched up character for character (except for one variable name) when the transparencies were laid over each other!

      Then, I just had to show who was the copier and the copyee, which I was able to easily do with file timestamps, and even a record in the "recent files" showing both students had accessed a floppy disk from their respective machines within five minutes of each other, and that half an hour before the alleged copier turned in his assignment. The copyee had turned his in three days prior.

      Needless to say, it was a slam dunk.

      However, students are often amazed at how I can detect cheating. One time I was grading one of their more major projects and I saw a distinctive line or two of code I remembered seeing before. I grepped through the other students' projects, but turned up nothing. So then on a lark I grepped through the same assignment done by students from previous years, and turned up a match.

      The copyee? A student who had graduated two years prior. Whose best friend was the older brother of the copier. Nailed!

      Suprising how highly variable code can be for loosely-defined programs, and how recognizable certain coding styles can be.

      --
      Graham "Teach" Mitchell, computer science teacher, Leander HS
  7. Additional Advice by nebaz · · Score: 5, Funny

    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.

    --
    Rhymes that keep their secrets will unfold behind the clouds.There upon the rainbow is the answer to a neverending story
    1. Re:Additional Advice by nebaz · · Score: 5, Funny

      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.

      --
      Rhymes that keep their secrets will unfold behind the clouds.There upon the rainbow is the answer to a neverending story
    2. Re:Additional Advice by Anonymous Coward · · Score: 0

      mod this funny

    3. Re:Additional Advice by dtfinch · · Score: 2, Funny

      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.

    4. Re:Additional Advice by Anonymous Coward · · Score: 0

      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.

    5. Re:Additional Advice by antispam_ben · · Score: 1

      ...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.

      --
      Tag lost or not installed.
    6. Re:Additional Advice by Anonymous Coward · · Score: 0

      BASIC

    7. Re:Additional Advice by Anonymous Coward · · Score: 0

      ..?

      even worse...

    8. Re:Additional Advice by gcaseye6677 · · Score: 4, Funny

      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.

    9. Re:Additional Advice by Yartrebo · · Score: 1

      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.

    10. Re:Additional Advice by Drishmung · · Score: 1

      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.

      --
      Protoplasm. Quiet Protoplasm. I like quiet protoplasm.
    11. Re:Additional Advice by Anonymous Coward · · Score: 0

      It's a good idea when using 2GL BASIC. The joke is that it's such an archaic practice anymore, because we've transcended the limitations of numbered lines. Even when using goto in C, you can use labels.

    12. Re:Additional Advice by Anonymous Coward · · Score: 0
      Hsh, I did this one. I had no one-line while() loops, I had zero-line for() loops. Drove my profs crazy. My particular favorite was

      for(p = string; isspace(*p); p++);
      string = p;
      for(p = string + strlen(string) - 1; isspace(*p); p--);
      *(p + 1) = 0;
      For those who don't read C, this removes leading and trailing whitespace from a string. I was also, and continue to be, a big fan of replacing one-line if/elses with the ternary (test ? true-expr : false-expr) operator.
    13. Re:Additional Advice by kngthdn · · Score: 2, Funny

      Thanks! Now I can write my first computer program... 10 DIM WITTED

    14. Re:Additional Advice by YOU+LIKEWISE+FAIL+IT · · Score: 4, Funny

      No, no, no. Just patch the iterpreter or compiler to allow floating point line labels!

      --
      One god, one market, one truth, one consumer.
    15. Re:Additional Advice by MrBlue+VT · · Score: 3, Funny

      Not a bad idea. I like it! It does get tough because floating point numbers are often non-deterministic when you are dealing with computers.

      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.

    16. Re:Additional Advice by Anonymous Coward · · Score: 0
      Hey, how about this coder we had working with us for a little while. She couldn't get any of the functions in any of her classes working until she put the word "static" in front of them all.

      Just being in a room with her made you think: "No fair! She's taking oxygen that the rest of us could actually be using!"

      Posting anonymously just in case she developed a latent ability to read, and might be embarrased if she could figure out I was talking about her...

    17. Re:Additional Advice by M.+Baranczak · · Score: 1

      If you're feeling particularly masochistic, try writing in a language that has no loops OR goto's.

    18. Re:Additional Advice by strider44 · · Score: 1

      It's depressing when they're labelling stuff as bad habits, and I used to do it all the time thinking how good the idea was.

    19. Re:Additional Advice by Flaming+Foobar · · Score: 1
      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.

      Strangely enough, I've always felt that

      loop:
      ...
      if(!done) goto loop;
      is easier to understand than
      do {
      ...
      } while(!done);
      But of course, we've all been brainwashed to think that "goto" is evil and should not be used. That's probably true in the wrong hands, but it can actually make code more effient, I've seen a lot of programs that look like this:
      do {
      if(!error_happened) {
      ...
      if(!error_happened) {
      ...
      if(!error_happened) {
      ...
      }}}
      if(error_happened) show_error();
      else {
      ...
      }
      } while(!error_happened && !done);
      I'm really tempted to write it like this:
      do {
      if(error_happened) goto cleanup;
      ...
      if(error_happened) goto cleanup;
      ...
      } while(!done);
      But of course, I won't because it would result in a lot of grief from anyone who ever reads my code. *sigh*
      --
      while true;do echo -e -n "\033[s\n\033[u\134_\033[B";done
    20. Re:Additional Advice by JohnFluxx · · Score: 1

      Or do it on a turing machine.

    21. Re:Additional Advice by JohnFluxx · · Score: 1

      The trouble with:
      loop: ...
      if(!done) goto loop;

      is that it's not clear if later on in the code whether there might be another "goto loop;"

      With do {} while, you don't have the possibility.

      With your later point, I usually try to do: do{ if(error_happened) break; } while(...);

      But then you have to set a flag or something to indicate an error, or however you are dealing with catching errors.

    22. Re:Additional Advice by Temporal · · Score: 1

      Posting anonymously just in case she developed a latent ability to read, and might be embarrased if she could figure out I was talking about her...

      Translation: She's hot and I don't want to ruin my chances of banging her.

    23. Re:Additional Advice by Anonymous+Brave+Guy · · Score: 1

      You mean if I need to insert more than 10 new lines in my code, I should just go change the compiler to use fractional line numbers? Wow, this open source thingy is L337 and I am the U83rhax0r!

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    24. Re:Additional Advice by Anonymous+Brave+Guy · · Score: 1

      I feel a sudden urge to publish a satirical paper entitled "Structured programming considered harmful", just to see how long it takes the academics to realise it's a joke...

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    25. Re:Additional Advice by Anonymous Coward · · Score: 0
      while true do
      print "Actually, I rather think SML has loops."
    26. Re:Additional Advice by Hellkitten · · Score: 1

      As a rule don't ever use goto

      But know when to break the rules.

      Another exaample of situations when goto is appropriate is breaking out of nested loops. Instead of writing something simple like:

      for (i = 0; i <= x, ++i){
      for (j = 0; j <= y; ++j) {
      do_stuff(i,j);
      if (condition()) goto double_break;
      }
      }
      double_break:

      They end up with some ugly cludge, probably checking the exit condition several times (which is bad if the check is expensive) instead of storing the result.

      --
      - We are the slashdot. Resistance is futile. Prepare to be moderated -
    27. Re:Additional Advice by Anonymous Coward · · Score: 0

      No, no, no. Just patch the iterpreter or compiler to allow floating point line labels!

      Or use FOCAL.

    28. Re:Additional Advice by Kehvarl · · Score: 1

      qbasic.. line numbers... it worked without them. GW-BASIC needed line numbers, but Q was... something differently the same.

    29. Re:Additional Advice by M.+Baranczak · · Score: 1

      Then I was misled by the professor. The sick fucker had us use recursive functions for everything instead of loops.

    30. Re:Additional Advice by dspeyer · · Score: 1
      Linux uses a fair bit of code like that. So does libvorbis. I'm pretty sure I've seen it elsewhere, too.

      Of course, the right way to do this is with exceptions, but implementing them in C is usually more trouble than it's worth. (Not always, go ahead and do it for a large project -- there's probably even a library for it.)

    31. Re:Additional Advice by v2 · · Score: 1
      Hrmh. This is why there are labels for loops:
      label: for (i = 0; i <= x, ++i) {
      for (j = 0; j <= y; ++j) {
      do_stuff(i,j);
      if (condition()) break label;
      }
      }
    32. Re:Additional Advice by Hellkitten · · Score: 1

      Labels for loops?. I don't think we're talking about the same language. In C (as it is in K&R2 not sure about what the C99 standard says) break stands alone (no way to specify a label).

      Other languages may allow them (such as java and perl) and the syntax differs. In perl you would put the label on the loop (but use the statement 'last' instead of 'break') as you do, but in java you would put the label after the loop (or risk an infinite loop as it would just start over again, unless the compiler chokes on that).

      Anyway my point is (and was) that somethimes there is no other way to break out of nested loops (when the language provides none) and you have to resort to goto (or a kludge)

      --
      - We are the slashdot. Resistance is futile. Prepare to be moderated -
  8. Comment removed by account_deleted · · Score: 5, Funny

    Comment removed based on user account deletion

  9. Programming Mistake #1 by Rufus211 · · Score: 4, Funny

    Get your site linked from slashdot.

  10. Slashdotted ... by ggvaidya · · Score: 5, Informative

    but also mirrordotted :).

  11. One thing not to do by esac17 · · Score: 5, Funny

    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 ...

    1. Re:One thing not to do by lpp · · Score: 1

      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?

    2. Re:One thing not to do by esac17 · · Score: 2

      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.

    3. Re:One thing not to do by LeiGong · · Score: 4, Insightful

      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.

    4. Re:One thing not to do by tntguy · · Score: 1
      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?

    5. Re:One thing not to do by Yaztromo · · Score: 4, Insightful

      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.

    6. Re:One thing not to do by Bonkers54 · · Score: 2, Informative

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

    7. Re:One thing not to do by mrchaotica · · Score: 1
      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?
      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    8. Re:One thing not to do by Anonymous Coward · · Score: 0

      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.

    9. Re:One thing not to do by Sir+Joltalot · · Score: 1

      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...

      --
      "Caffeine is not an option. Caffeine is a way of life."
    10. Re:One thing not to do by syynnapse · · Score: 1

      omg, im a CS student and this _very_same_error_ screws up everyone of my goddamn programs at least once. that or a carriage return...

      and i can never believe it when it happens.

      --

      System.out.println(syynnapse.getSig());

    11. Re:One thing not to do by Anonymous Coward · · Score: 0

      #include

      int main() {
      int i = 1;
      if(i==0);
      {
      printf("i == 0");
      }
      return 0;
      }

      I compiled the above with cc -Wall, and it gave no warnings (though I haven't tried (sp)lint)

    12. Re:One thing not to do by Yaztromo · · Score: 1
      I vastly this sort of syntax

      vastly what? ; )

      "Prefer" is the missing word. Sorry about that :).

      As to why many people use it the other way, I honestly have no idea. But one thing is for certain, people who do so are completely, totally, and utterly wrong :).

      Yaz.

    13. Re:One thing not to do by a1cypher · · Score: 1

      My damn profs all complain if we do it like that. I personally prefer it in that style, and I have been using it for years. Its really difficult to switch. Their reasoning behind it is that you can, at a glance, line up the brackets to figure out which } belongs to which {. Which to me seems irrelevent because after a while of coding the other way you begin to match up the } to the actual control structure. Not to mention the obvious nature of the indentation.

    14. Re:One thing not to do by canadian_right · · Score: 1
      I did that back in 83 on the job, but it was a long c for loop that scrolled off the screen by exactly one char: the semi-colon. And the editor did not indicate long lines so I see the last ), not the ; and can't figure out why my loop always runs once.

      There was no debugger. I still remember it because it was such a silly mistake and it took so long to discover.

      --
      Anarchists never rule
    15. Re:One thing not to do by canadian_right · · Score: 1
      We are used to the "other way" and are not changing after 20 years, ie we are stubborn.

      I learned my c indenting style on my first job with a bos that had strong opinions about indenting style. I only modified his style slightly over the years. I now will reformat any code I have to debug in "my style" as I cannot match up blocks of code to save my life unless it is in "my style" now.

      --
      Anarchists never rule
    16. Re:One thing not to do by cooldev · · Score: 1

      VC++ 2003 compiler catches this with the default settings. It catches even more of these types of programming errors if you crank up the warning level.

      deleteme.cpp(9) : warning C4390: ';' : empty controlled statement found; is this the intent?

    17. Re:One thing not to do by ggvaidya · · Score: 1

      that or a carriage return...

      Like, omg, how does that work? :P
      Programming in Python?

    18. Re:One thing not to do by Yaztromo · · Score: 2, Interesting
      But do you really use comments like "// end-if"???

      Yes, in fact I do. It makes it obvious what statement a close-brace goes with, in the event the indentation is screwed up, or if it's on a separate page from the block opening. Take this class, for example.

      I'll give you an example of where this is useful:

      (Note: I tried typing up this post using <ECODE> with spaces and non-breaking spaces, but /. appears to strip them all out. The code below was intended to be indented, but it doesn't look like /. is going to let me. The point is even more poignant without the indentation, but as very few people code without indentation, it doesn't make for as good an example IMO. So please imagine the code below as being indented).

      // The same useless code, but with block-closing comments.
      int x=0;
      while(x<10) {
      if (x%2==0) {
      for(int i=0;i<x;i++) {
      doSomething(x, i);
      doSomethingElse(x);
      }
      }

      This code is obviously incomplete, as it specifies more open braces than close braces. I coded it, but it's up to you to fix it.

      However, without knowing the algorithm, where do you add the extra close brace? Note that the first close-brace isn't at the same indentation level of anything else (due to developer typo) -- was it intended to close the if statement (and thus it's the for statement that is missing its closure), or is it the closure for the for statement, and it's the closure of the if statement that is missing?

      Using my syntax, this is brutally easy to fix without going through the algorithm to discover what was intended:

      // The same useless code, but with block-closing comments.
      int x=0;
      while(x<10) {
      if (x%2==0) {
      for(int i=0;i<x;i++) {
      doSomething(x, i);
      doSomethingElse(x);
      } // end-for
      } // end-while

      Thus, it's the if statement that is missing its close block. The code should look like:

      // The same useless code, but at least it's syntatically correct.
      int x=0;
      while(x<10) {
      if (x%2==0) {
      for(int i=0;i<x;i++) {
      doSomething(x, i);
      doSomethingElse(x);
      } // end-for
      } // end-if
      } // end-while

      You may think that looking at the indentation might tell you where the closing brace is missing -- but just try working in a development group sometime where some developer is using 2 or 4 character tabs instead of 3 character tabs, or where they're using spaces instead of tabs (or tabs instead of spaces). Indentation is easily munged in such a case, and it can creep into source very easily. Without close-brace comments, a missing close may be very difficult to insert in the correct position.

      So yes, I do add such comments to every close tag. They're quick to type, but generally I set-up my code editors to either insert them automatically, or to at least assign a macro to insert them. It makes the code easier to maintain if someone accidentally forgets to close off a block, and makes it easy to determine what statement a given close goes with if the close is on a different page from the block opening statement.

      Yaz.

    19. Re:One thing not to do by Simonetta · · Score: 1

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

      No one's making fun of you.. and you're not stupid. The fucking computer language is stupid for not making this kind of ambiguity easy to detect and for causing you to waste two whole days debugging.

      Everybody does this.

      The lower that you go in hardware, the more insane this kind of nonsense gets.

      Check out the documentation for the Intel 8251 interrupt controller (a chip designed into the original IBM PC and cloned into every PC since).
      It is a masterpiece of surrealism and parallel realities. It starts out like a normal text document and soon gets very weird.
      I suspect that the original PC designers got the thing to work right once by accident, and then used a logic analyser to find what configuration bytes were being sent to it on reset so they could write a stable and functional BIOS.

    20. Re:One thing not to do by Bill+Dimm · · Score: 2, Informative

      Incidentally, is there any good reason why people like the other way? (i.e. braces aligned)

      1) If you ever end up with mismatched braces you can do this:
      egrep '{|}' program.c
      to get an overview of the braces to more easily find the mismatch (no "if" or "for" stuff to clutter it). This is probably less useful with modern editors that do brace matching.

      2) Personally, I think it makes it easier to skim the code. For example, look at:

      if (condition)
      x = y;

      and then look at:

      if (condition)
      {
      x = y;
      a = b;
      }

      When reading either of the above, I think "If I care about what happens when the condition is satisfied, indent one level and read, otherwise skip to the next line with the same level of indentation." If you do braces the other way, when you skip forward to the next line with the same level of indentation you may or may not run into a "}", which seems out of place to me (i.e. the braces are part of the statement to be executed, not part of the "if"). Just my opinion though. Do whatever makes you happy.

    21. Re:One thing not to do by intangible · · Score: 1

      like this maybe?:

      if (con\rdition);
      {
      myvar=1;
      }

      You know darn carriage returns just pop in there sometimes.

    22. Re:One thing not to do by ErikZ · · Score: 1

      (blink)

      Why didn't I think of that?

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    23. Re:One thing not to do by plover · · Score: 1
      There's a trick I learned a few years back that I've wholeheartedly adopted to avoid this "sister" problem to yours:

      if (x = NULL)
      {
      printf("why won't this stupid line print, even when x is NULL?");
      }

      Instead, I now always place the constant on the left hand side of the "comparison" operator:

      if (0 = x)
      {
      printf("why won't this stupid if statement compile?");
      }

      Now, if I screw this up the compiler catches me first and emits "Error: idiot coder tried to assign a value to a literal"

      Even though I've only caught myself once making this error since I adopted the trick, (and yes I know lint and/or warning level 4 will catch this particular mistake already) just practicing it makes me more aware, which is always a good thing.

      --
      John
    24. Re:One thing not to do by UserGoogol · · Score: 1
      As far as I know, (I don't program much) if you throw a carriage return in the middle of a string, most languages will complain.

      Or perhaps...
      if (x == 2)

      do.whatever();
      --
      "Never attribute to malice that which can be adequately explained by stupidity." -- Hanlon's Razor
    25. Re:One thing not to do by Dun+Malg · · Score: 1
      Incidentally, is there any good reason why people like the other way?

      Code like this:

      if(foo == 666)

      {
      EekItsTheDevilHimself = true;
      }

      CallForA.Priest(foo);

      makes the bracketed subroutine stand out more because it's not only indented, but has a nearly empty line (the lines with the { and } ) top and bottom. It's also easier to make sure you don't forget the closing } --or find where it's missing when you HAVE forgotten it-- when it lines up with the opening { above it.

      --
      If a job's not worth doing, it's not worth doing right.
    26. Re:One thing not to do by Anonymous Coward · · Score: 1, Informative
      That's what -Wall (or whatever the specific warning is) is for. gcc says:
      warning: suggest parentheses around assignment used as truth value
      So the compiler catches me, even if I do:
      if (x = NULL)
      {
      ...
      }
    27. Re:One thing not to do by Yaztromo · · Score: 2, Interesting
      Why didn't I think of that?

      I don't know, but now that you know, feel free to use it in your own projects :).

      Actually, for anyone interested in how I typically write easy-to-read code, check out this PDF document (or the HTML version). These are the coding guidelines I wrote up (and follow) for the jSyncManager Project. And yes, they're enforced (albeit not in a draconian manner -- if another developer misses something, I usually just fix it for them as opposed to nailing them to the wall :) ).

      Good Open Source code needs to be readable and easy to work with IMO. If you want to attract more developers to your project, and/or want third-party developers to use your Open Source APIs, you need to make sure when they grab your code they can get working with it with an absolute minimum of hassle, and as much information as they need. The last thing you want to make them do is go through all your code with a fine-toothed comb trying to figure out what it's doing. They want to write code, not try to figure out what the existing code is doing manually.

      Just as nobody likes to read a novel with no paragraph breaks/indentation, no chapter breaks, and no formatting, nobody should have to read messy code. Writing elegant looking code with useful comments takes very little time (particularily if you're a fast typer), and is always worth the extra effort, especially in an Open Source project that is close to your heart.

      Speaking of which, if anyone out there is interested in developing code for an Open Source, pure Java data synchronization solution for Palm OS-based handhelds, or using such code in one of their own projects, send me an e-mail :) ).

      Yaz.

    28. Re:One thing not to do by Anonymous Coward · · Score: 0

      or you could just align the braces...

    29. Re:One thing not to do by ZorbaTHut · · Score: 1

      You don't even need a debugger for something like this. I spent a year and a half on a project that didn't have a working debugger (a PS2 game, for the curious - a debugger was included in the devkit but we were never able to get it working.)

      Luckily it had stream output, so we just used printf for everything. To this day I use printf for all my debugging. If you don't know why an area is failing, just sprinkle a dozen printf statements around and you can trace the execution easily by hand. The advantage is that you can look at a few dozen paths through the function without having to tangle with breakpoints - just scroll up and down in the several-thousand-line-buffer.

      Debugging is vital. Debuggers are not.

      --
      Breaking Into the Industry - A development log about starting a game studio.
    30. Re:One thing not to do by ectospasm · · Score: 1

      I agree. And using that egrep command works very well for just checking that the braces are matched up, without having to bounce between each pair of braces as long as you're using the opening brace on its own line style. Only time it doesn't show only the braces are for the closing brace of a do-while loop (or any identifying comments).

      Also, it's much easier to eyeball that two braces match by comparing the indentations. But saying one way is better than the other is just stupid.

      --


      We are the music makers. We are the dreamers of the dreams.
    31. Re:One thing not to do by renoX · · Score: 2, Interesting

      Well, unfortunately this is a pretty common mistake, blame it on K&R to introduce such an easy pitfall.

      Unfortunately, if I'm not mistaking neither C++ or Java designer had the guts to make {} mandatory after an if,for..

      C is a language with lots of pitfall, but usually they are not too difficult to catch:
      1. read a document which list the pitfall.
      2. when you have a problem, first a. stop 10min to free the mind, b. use debugger, printf to narrow the search, c. if it doesn't work ask for help: two are better than one. Of course it means that you two must work to solve it on the same screen, as you will probably be the one who catch the bug anyway (don't send by email the code waiting for the magic answer).

    32. Re:One thing not to do by Anonymous Coward · · Score: 0


      All property files must start with one of our two standard source headers. The header used depends on the license for the package the source file is contained within -- either GNU General Public License (GPL) or GNU Lessor General Public License (LGPL).


      I guess this licence is better than Gnu LGPL...

      oh, wait a minute, this license has the same acronym.

      Boy, you must be really confused when talking about all these licenses you use

    33. Re:One thing not to do by Anonymous Coward · · Score: 0

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

      Yes, in fact I do.


      And "// End Sub" too?

    34. Re:One thing not to do by loraksus · · Score: 1

      Yaz, meet tab; tab, yaz.
      (I kid)

      --
      1q2w3e4r5t6y7u8i9o0pqawsedrftgthyjukilo;p'azsxdcfv gbhnjmk,l.;/
    35. Re:One thing not to do by raehl · · Score: 1

      if () {
      statement;
      statement;
      }

      It should be blatantly obvious if you're missing a } when you undo indenting without a }

    36. Re:One thing not to do by fucksl4shd0t · · Score: 1

      This sentence no verb.

      Sorry, I not resist. I jargon file last night and this funniest sentence in the whole thing.

      --
      Like what I said? You might like my music
    37. Re:One thing not to do by raehl · · Score: 4, Insightful

      I read his objection differently than I think even he intended it...

      } // end_if

      should be

      } // if (x%2)

      Or some such. The point being that you should have meaningful comments, and chances are with oodles of If's, sticking end-if after each closing brace will probably be less than informative.

    38. Re:One thing not to do by fucksl4shd0t · · Score: 1

      Somehow I don't think your professors would like Python one bit. Working with Python is what finally got my { up on the line with the if(condition).

      Now I look at it and think "Duh!". Functions, claasses, everything, now.

      If I didn't do it, I'd code like this:

      if(condition):
      {
      this.sentence = noVerb;
      }
      --
      Like what I said? You might like my music
    39. Re:One thing not to do by JamMule · · Score: 1
      The block closing comments are good. But I actually prefer to put the block opener on its own line. The reason? There are cases, when your condition (or function's parameter list or declaration of class and its modifiers) spans two or more lines. I intend the continued lines two levels compared to the if-line (or for, or function or class) and then line the opening bracket up with the if-line. I have found it better to have each block-construct to be similar looking than to save that extra line.
      if ( someVery() &&
      LongCondition())
      {
      doSomeStuff();
      }
      Ok, apparently ECODE doesn't respect written in indentation, so it is kind of useless to have the example here. Anyway, LongCondition() has two level indent, doSomeStuff(); has one level indent.
    40. Re:One thing not to do by cheekyboy · · Score: 4, Insightful

      I used to do that in the previous millenium, but its crap, you cant just // comment out the condition and run the code as is, you have to move the { later.
      Besides it looks ugly the way you have it.

      --
      Liberty freedom are no1, not dicks in suits.
    41. Re:One thing not to do by Yaztromo · · Score: 1

      Now we're going in a big circle :).

      The thread started because of a developer who recently wasted a whole bunch of time because he was using the syntax you're advocating, but had put a semi-colon at the end of the condition, causing it to not be connected to the block (ie: the block become a free-standing block which would execute regardless of the result of the conditional statement). Such code doesn't (generally) result in a compilation error, but will result in runtime errors, and is very, very difficult to see using that syntax.

      My syntax makes it completely obvious which statement a block belongs to, and makes it vastly easier to detect such errors (and makes it harder to make them in the first place IMO).

      Instead of presenting the arguments as to why your syntax is problematic all over again, please iterate back to the top of the loop using this link.

      Yaz.

    42. Re:One thing not to do by thogard · · Score: 1

      The opening brace is "The One True Way" according to K&R. The if(cond) \n { is just
      wrong.

    43. Re:One thing not to do by Anonymous Coward · · Score: 0
      In C, it doesn't matter how much whitespace you have between the if statement and the clause associated with it, provided there isn't anything else in between (comments are considered whitespace for this discussion). You could have a gazillion linebreaks after that if statement, and it would make no difference whatsoever.

      In other languages, this may not be the case.

    44. Re:One thing not to do by beelsebob · · Score: 1

      Yes, but then K&Rs original syntax for C was the ugliest hack you've ever seen... Be glad you're using ANSI C, not K&R C. Bob

    45. Re:One thing not to do by Anonymous Coward · · Score: 0

      C was neat in its day. Its gotten beter with age. Pascal hasn't. Ada didn't. Fortran can't. Cobol repeats its uglyness. APL and Perl live in their own worlds of uglyness.

    46. Re:One thing not to do by ndixon · · Score: 1

      Been there, done that.

      Wasn't me, but a fellow student in an image processing class who coded something like:

      for (i=0; iY; ++i);
      for (j=0; jX; ++i);
      do_stuff(i,j);

      We spent a whole day trying to solve that one, until he suddenly yelled out "SEMICOLON!!!".

      How we laughed. Eventually.

      --
      Oh, how convenient: a theory about God that doesn't involve looking through a telescope.
    47. Re:One thing not to do by beelsebob · · Score: 1

      And Haskell surpasses all of them for beauty. Which is nicer: quicksort :: Ord a => [a] -> [a] quicksort [] = [] quicksort (x:xs) = quicksort (filter (=x) xs) or list *quicksort (list *xs) { if (xs.item == nil) { return xs; } else { split = xs.item; //............... (I can't be arsed carrying on, my point is made.) } }

    48. Re:One thing not to do by Subjective · · Score: 1

      This brings to mind an interesting idea:
      If you could look at how the compiler parses the code (the symbol tree), you'd automatically see the if statement is too short and that there is a block right after it.

      I only know a little about compilers, but we had this demo 'syntax-reader' which outputs XML. Don't think I still have a copy of it.

      I think this is the kind of output that'd be very helpful when a piece of code has an algorithm problems (runs with wrong output or loops/crashes)

      Does anyone know if I can tell gcc to output something like this? or some other program?

      --
      My other .sig is also this bad
    49. Re:One thing not to do by Master+Ben · · Score: 1

      This happens to me everytime I code. Usually when I'm on a "roll" thinking I'm a genius and have to get the code out before I lose it. I usually call myself an idiot, give myself a little physical abuse to teach me not to do it again, and finally fall into a short psychotic state of muttering and involuntary muscle movement. I love programming!

    50. Re:One thing not to do by gnu-generation-one · · Score: 1
      I spent 2 days looking for a one character bug the other day, I hate these!
      if (condition);
      {
      myvar = 1;
      }

      Even better, try commenting something out and wondering why some perfectly reasonable logic is screwed:
      if(condition)
      doSomething();
      else
      //doSomethingElse();
    51. Re:One thing not to do by secondsun · · Score: 1

      It happens sometimes dude. MY weekend experience was finding what ammounted to the bug in this line of code

      if ((*root)-)left!=null){
      traverse((*root)->right);
      }

      It was particularly bad because it worked most of the times and was showing up as if it were an error in another block of code entirely.

      --
      There is nothing wrong with being gay. It's getting caught where the trouble lies.
    52. Re:One thing not to do by minus_273 · · Score: 1

      printf() is your friend

      --
      The war with islam is a war on the beast
      The war on terror is a war for peace
    53. Re:One thing not to do by RogerWilco · · Score: 1

      I think my (Borland) compiler warns me if I do something like this.
      Can't check right now, but maybe you need to check your warnings more often.

      --
      RogerWilco the Adventurous Janitor
    54. Re:One thing not to do by Anonymous Coward · · Score: 0
      I used to do that in the previous millenium, but its crap, you cant just // comment out the condition and run the code as is, you have to move the { later.

      That's why real coders write
      if (condition) /**/ {
      do_stuff;
      }
      Then you can just /* out the condition! What do you mean, "ugly"? :p
    55. Re:One thing not to do by Haeleth · · Score: 1
      Yuck, what horrible syntax! I have a much better way.
      #define IF if (
      #define THEN )
      #define BEGIN {
      #define END }

      IF condition THEN BEGIN
      myvar = 1;
      END
      Much prettier!

      ...why are you looking at me like that?
    56. Re:One thing not to do by cybergrue · · Score: 1
      Careful, you might cause a coding style preference flame war here ;-)

      That said, I agree with you. Putting the opening brace on its own line is the only coding style element that has a warning about errors that can be introduced by using said practice (that I know about).
      The problem is that it is very easy to insert something between the condition and the opening brace when they are separated on different lines. The semi-colon is one example, another is adding a new statement or variable declaration outside the block but after the condition.
      The practice of putting the opening brace on the next line seems to be a left over from Pascal programming where a blank line was added after function declarations to enforce proper white space usage. When people started programming in C, the ones who had learned Pascal first kept the enforced white space by putting the opening brace on the next line. This style then got put into a few textbooks, and here we are arguing over it.

      Yet another thing I've noticed is that this style seems to be preferred by some editors (vi for one). I recently watched a programmer who I was working with who used vim to make the prototypes for the project we were working on. It was easier for him to move the brace to the next line so he could copy the whole function declaration line for the prototype then to just hi-light the parts he needed to copy. Needless to say, he didn't undo his changes to the code, but just saved it as is instead. I then told him to stop, opened the next file in nedit, and used the 'create prototypes' option to the same thing in a few seconds without modifying the code.

      I have also found that putting a comment at the end of a block is a useful practice to get into. It's sort of like the labels you see on pipes in large building (Steam->, Cold Water->, etc.) It helps identify which brace belongs to what. Technically, the // end if statement should contain the rest of the IF statement, but that can be difficult if the IF statement is complicated. Realistically, you only need enough detail to differentiate it from the other braces in the immediate vicinity. One additional practice that I have learned the hard way to use is to always use braces with statement where they are optional. The IF statement is the most common of these, but the WHERE and FOR statements can have the same problem. The problem I had was I had commented out the statement immediately following the IF statement during testing without commenting out the IF statement itself. (yes that was dumb, I know) Anyway, what happened was the IF statement then conditionally executed the next line in the code. It took me over a week to find that this problem. Anyways, to make things worse, the guy I was working with found the problem, but thought I had made a mistake with spacing, and 'fixed' it for me (it was the vi guy I talked about above, and yes he reads Slashdot). This combined with the fact I had to add braces when adding printf statements for debugging made me always use braces when they are optional.

    57. Re:One thing not to do by Chelloveck · · Score: 2

      There's no excuse, ever for indenting the braces as well as the code. We all know that this is the proper way to indent.

      if (condition)
      {
      ....a = b;
      }
      else
      {
      ....c = d;
      }

      (Come on, Malda, the <ecode> tag really needs to preserve spaces at the beginnings of lines, too!)

      One thing I've found is that this style helps with grotty #ifdef statements. I like to put superfluous braces around them, too.

      while (condition)
      {
      ....#if defined(FOO)
      ....{
      ........a = b;
      ....}
      ....#else
      ....{
      ........c = d;
      ....}
      ....#endif // #if defined(FOO)
      }

      This makes it really easy to track large blocks in nested #if..#endif directives, and makes them read more like regular if..else statements. And yeah, I know, preprocessor directives are ugly as sin, but they're sometimes necessary. Most of what I write is code for microcontrollers, and it must be portable from one target platform to another. I can't afford to waste memory or execution time to evaluate conditionals at runtime when they can be done by the compiler instead.

      --
      Chelloveck
      I give up on debugging. From now on, SIGSEGV is a feature.
    58. Re:One thing not to do by confusednoise · · Score: 1
      Oh, Jesus, tell me you DIDN'T just post something claiming that one bracing style is clearly superior to another.

      You might as well break into a rant about how emacs is clearly superior to vi and launch the whole ridiculous flame war much more efficiently.

      Oh, and by the way, java is a better language than perl, downloading music through P2P is clearly just copyright infringement not theft, and RedHat is obviously superior to Gentoo...

      And your favorite band sucks.

    59. Re:One thing not to do by Anonymous Coward · · Score: 0

      but no-one ever need write quicksort, it's been done.

      please don't make arguments based on toy cases. you'll be arguing for recursion over iteration just because it neatly traverses a tree next.

    60. Re:One thing not to do by Anonymous Coward · · Score: 0

      hmm, maybe I should try this

      #define lost if (
      #define the )
      #define plot {
      #define completely }

      lost condition the plot x=10 completely

      lowercase because #define is always followed by so much shouting

    61. Re:One thing not to do by Anonymous Coward · · Score: 0

      I've learned that if a bug is proving difficult to track down, it probably means it's something really simple. Looking for a simple mistake instead of some logic problem makes those simple mistakes easier to find.

    62. Re:One thing not to do by slaad · · Score: 1

      The fucking computer language is stupid for not making this kind of ambiguity easy to detect

      True true. It would be nice to have a compiler that would at least give a warning when something like this happens

      --


      ~Warning!~ The above is encrypted using rot676!
    63. Re:One thing not to do by dsplat · · Score: 1
      Sometimes, it is the intent:
      #ifdef DEBUG
      #define LOG_ERROR(msg) fprintf(stderr, "%s %s: %s\n", __FILE__, __LINE__, msg)
      #else
      #define LOG_ERROR(msg)
      #endif

      if (really_awful_error_flag != 0 )
      LOG_ERROR("The foobar subsystem is b0rked again!");
      Okay, I will grant you that there are more elegant ways of accomplishing the same thing. I tried to distill it down to a small example. I've seen lots of this sort of thing on big systems with homegrown system-wide error logging facilities. When you are unit testing them, sometimes you want to turn that off because you don't have a logging daemon on your workstation. At the same time, you want to turn on your own debugging aids, which are often crude, but effective.
      --
      The net will not be what we demand, but what we make it. Build it well.
    64. Re:One thing not to do by abiessu · · Score: 1

      A little extra work here and there might be worth missing a lot of extra work in other places...

      if (condition);
      {
      var = 8;
      }

      As mentioned previously, it's difficult to see this problem, and a compiler won't flag it (usually...). Plus, using a debugger to step through and find a problem like this would be annoying at best. However,

      if (condition) {;
      var = 9;
      }

      is a 'good' error for at least a couple of reasons:
      - you have a no-op instead of killing your conditional
      - the book 'Code Complete' (I'm pretty sure that's the one, and possibly others) recommends this as the best format for code (not the extra semicolon, the overall form)
      - if you ever find out that there's an extra semicolon hanging around, you can just delete it knowing that it really is a no-op and there wasn't a 'bad' bug there anyways
      - if you decide to remove the condition at some later point and comment it out to start the work, it isn't that difficult to do the following:

      //if (condition) {; { var = 9; }

      Again, only a little bit of work, and the // can be changed from one line to the other without much thought.

      Sadly, the coding standard where I work requires the former format. I completely disagree with the 'ugliness' comment... that's a personal opinion that holds little value when attempting to evaluate coding styles. Give me some *reason* that it's ugly, or perhaps your comment should be rated "4, inciteful".

      --
      Let S_n = {nst+us+vt : s,t in Z \ {0}, u,v in {-1,1}}. For all n in Z where |n| > 2, Z \ S_n is infinite... right?
    65. Re:One thing not to do by Anonymous Coward · · Score: 0

      People....people. Fighting over C coding styles?
      Remember there are people out there who still have to code in Cobol. Just be glad you get to code in C.

    66. Re:One thing not to do by Anonymous Coward · · Score: 0

      That's fine, but if you ever change the condition, you have to remember also to change the comment, or you will cause nothing but confusion.

    67. Re:One thing not to do by td · · Score: 1
      You don't need to comment it out, just change it to
      if(1 || condition){
      ...
      }
      Similarly,
      if(0 && condition){
      ...
      }
      bypasses the whole statement.
      --
      -Tom Duff
    68. Re:One thing not to do by Yaztromo · · Score: 1
      Careful, you might cause a coding style preference flame war here ;-)

      A bit late for the warning, don't you think? :).

      One additional practice that I have learned the hard way to use is to always use braces with statement where they are optional.

      Typically if an if, while, or for statement only has one line of code to process, I'll leave the whole line inline, such as:

      // Straight from the jSyncManager
      /** Export this database to a File.
      * @param s path and name of file to export to.
      */
      public void exportDatabase(String s) {
      java.io.File file=new java.io.File(s);
      if (file.isFile()) file.delete();
      if(!file.exists()) file.mkdirs();

      if(isResourceDB()) exportPRC(s);
      else exportPDB(s);
      } // end-method

      I find that keeping exceedingly simple one-line statements such as the above in very specific cases removes the problems you describe, and enhances readability. Take the last if...else block for example: there are only two possibilities, and as the actual processing for each is fairly lengthy, they're broken into their own methods. As such, no extra processing will ever be added or necessary to this statement, making it safe to keep these two simple items as inline statements.

      But otherwise, I find myself in agreement with you, and would work with you on a development project any day :).

      Yaz.

    69. Re:One thing not to do by marcosdumay · · Score: 1

      I just use EMACS...

    70. Re:One thing not to do by cayce · · Score: 1

      Some compilers create warning for this kind of things.

      For instance Borland C++ will issue:

      [C++ Warning] W8019 Code has no effect

      I suppose gcc would do the same if instructed to be on maximum warning level and in pedantic mode. I'm too lazy to test it out, too.

      That's why you should always compile your code with the maximum level of warnings that your compiler supports. I know it's boring and you're going to have to redo some perfectly valid code, but it's also going to save you time in the long run.

    71. Re:One thing not to do by syynnapse · · Score: 1

      actually no, but doing web stuff with java. those goddamn packet headers need carriage returns. I spent most of a lab being confused because i left one out.

      --

      System.out.println(syynnapse.getSig());

    72. Re:One thing not to do by Anonymous Coward · · Score: 0

      hehehehe
      damn. you should have said in your comment there were two semi colons cos i missed the first one after reading it about thirty times!!!

    73. Re:One thing not to do by Dun+Malg · · Score: 1
      if () {

      statement;

      statement;
      }

      It should be blatantly obvious if you're missing a } when you undo indenting without a }

      Blatantly obvious to YOU because that's what you're used to. It's not blatantly obvious to EVERYONE. I've heard people who prefer the other way say it's NOT obvious because the '}' is aligned with the UNindented code you're returning to, rather than the block of code it's actually defining. I've worked for both kinds of people and had to write code in both formats. The only thing I can say for sure is that anyone arguing the blatantly obvious superiority of one style over the other is a nutcase. It's just a coding style. The superior way is the one you're accustomed to.

      --
      If a job's not worth doing, it's not worth doing right.
    74. Re:One thing not to do by lpp · · Score: 1

      Whoops. Nope, I just missed the semi colon. Read right past it. Looks like I've joined your little club. Do I get a certificate or something?

  12. Re:Compiler Warnings by Anonymous Coward · · Score: 1, Funny

    It's satire dude...

  13. high school by Anonymous Coward · · Score: 5, Informative

    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

    1. Re:high school by fireboy1919 · · Score: 1

      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.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    2. Re:high school by flycrg · · Score: 0

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

    3. Re:high school by Anonymous Coward · · Score: 0

      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!

    4. Re:high school by roman_mir · · Score: 4, Interesting

      Since then I always do some sort of rudimentary pseudo code on paper before implementing using a computer. - congrats. You and me, both. I didn't have a computer at 11, and that is when my grandma bought me a book on programming. Only the book was an adventure story and in order to progress in the story, I had to solve tricky problems that became more and more complex as the reading went on. For each new problem set I had to learn yet another programming concept, conditions, loops, function calls etc. The book was structured in a way that would not allow one to understand what was going on without solving the problems.

      I didn't have a computer, but I became insanely interested in them and I did write my first dozens of programs on paper and traced them that way. Wrote games something like robots and FPSs on paper. Later was able to type them into translators and they worked.

      Argh, where is my childhood?

    5. Re:high school by APDent · · Score: 1

      Sounds interesting. Is the book still in print, and what was it called?

    6. Re:high school by roman_mir · · Score: 1

      Dude, it was like 17 years ago :) The book was in Russian but I am sure it was a translation, I read it around 87. Something like: Adventures of ... something... in the land of BASIC.... I think. I don't have it anymore, it got lost with all our travelling.

    7. Re:high school by Simonetta · · Score: 1

      An ultra-high tech book like this is story of Neal Stephenson's SF novel The Diamond Age. I read this from the library after someone alluded to it in a /. reply to a message. It's also found on Kazaa! occasionally.

    8. Re:high school by Anonymous+MadCoe · · Score: 1

      I must agree, the best way to learn is to start young and with limited means. I know the feeling of having to program on papaer, I was lucky to get hold of a 1K machine pretty quickly.

    9. Re:high school by mammux · · Score: 0

      > .. FPSs on paper ..

      You wrote a first person shooter on paper?

      -Magnus

    10. Re:high school by Terrasque · · Score: 0

      "Adventures of ... something... in the land of BASIC"

      Now THAT's a horror story if I ever saw one

      --
      It's The Golden Rule: "He who has the gold makes the rules."
    11. Re:high school by Drantin · · Score: 1

      One of the Magic Micro Adventures? I found some of those in a garage sale back when I was in 5th grade and typed 'em all in gwbasic... this was around 1995.... Some of those programs were just animations (one was supposed to hypnotize the antagonist into turning off a force field, was four Os that moved in and out from the center of the screen in a + pattern...) but others were a bit challenging (finding your way through a maze via directional commands... like a zork-lite kinda...) or figuring out the number sequence to disable a bomb.... geez.. I wish i'd thought to work them out without taking the trouble to type them in and then check the bak of the book for interpreter-specific code (included so the programs would work on many architectures....) ...

      Dodson, Bert.
      Superworld / by Steven Otfinoski ; illustrations by Bert
      Dodson ; cover by Bradley Clark ; programming by Susan M.
      Zakar. -- New York : Scholastic, 1985. -- 80 p. : ill. ; 20
      cm. -- (Magic Micro Adventure) -- (A Parachute Press Book)
      -- "The programs in the book are in BASIC." -- Call no.:
      PS3565.T45S8 1985

      --
      Actio personalis moritur cum persona. (Dead men don't sue)
    12. Re:high school by LiquidCoooled · · Score: 1

      I bet it still played faster than Doom 3 on my machine.

      Heck, a 3year old with a crayon could render the blackness in higher quality and with a quicker refresh than it!

      --
      liqbase :: faster than paper
    13. Re:high school by Anonymous Coward · · Score: 0

      I do something similar, but the pseudo code is typed into my source file as comments, then the code goes between it.

      I wouldn't recommend doing this for a "hello world" program, but when you get into nasty calculations and conditions it sure helps, besides you can grep the comments and read your notes just like before

  14. i thought it was going to be something serious... by Fluidic+Binary · · Score: 3, Insightful

    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?

  15. Most of the Prof's lecture notes are plagarized by Cryofan · · Score: 4, Interesting

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

    --
    eat shiat and bark at the moon
    1. Re:Most of the Prof's lecture notes are plagarized by ansleybean · · Score: 2, Funny

      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.

    2. Re:Most of the Prof's lecture notes are plagarized by Cryofan · · Score: 1

      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.

      --
      eat shiat and bark at the moon
    3. Re:Most of the Prof's lecture notes are plagarized by Yartrebo · · Score: 1

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

    4. Re:Most of the Prof's lecture notes are plagarized by Lord+Omlette · · Score: 1

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

      --
      [o]_O
    5. Re:Most of the Prof's lecture notes are plagarized by Sir+Joltalot · · Score: 4, Informative

      I had a prof that did that, at the University of Waterloo, 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 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.

      --
      "Caffeine is not an option. Caffeine is a way of life."
    6. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 1, Funny

      Dude , U just made a F in my course. U should at least wait till u get the grades before making stupid (though true) /. posts abt me Mavaddat

    7. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 2, Funny

      Although I agree the above post, I must point out that it wasn't written by me as I am the real Mavaddat.

    8. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      Ours were homegrown, but just flat out bad. Stuff like prototyping a function with one name and calling it with another. Or one of my favourites:

      if (x= =5){ ...
      }

    9. Re:Most of the Prof's lecture notes are plagarized by KingEomer · · Score: 1

      What courses does he usually teach?

    10. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      lol n00b

      'tis I, t3h tru M4\/4dd47

    11. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      No, I am teh true Mavaddat !

    12. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 3, Funny

      No, I am the true Mavaddat ! You can tell because i only write in italics, unlike my imposters

    13. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0
      I am the true Mavaddat.

      (but you may call me... Tim?)

    14. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      No! I am Spartacus! err... Mavaddat!

    15. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      There are no bad teachers, only bad students.

    16. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      Please stop imposting me.

      -- Mavaddat

    17. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      unless you took note of the disclaim the usualy have at the bottom

    18. Re:Most of the Prof's lecture notes are plagarized by uberdave · · Score: 1

      ...who become teachers.

    19. Re:Most of the Prof's lecture notes are plagarized by zx75 · · Score: 1

      Definitely... I've never had him (finishing my 4th year in CS now) because I've never signed up for a section he was teaching. But I have a number of friends who were in his classes... and your assessment is bang on.

      --
      This is not a sig.
    20. Re:Most of the Prof's lecture notes are plagarized by register_ax · · Score: 1

      It gets difficult to gauge the actual source due of credit because your source got them from another source ad infinitum. Of course by pointing them away from you, you direct attention to the next in line. I'm guessing the amount of heat produced from such an event would start to cause the ice sheets to melt, so maybe this isn't such a great idea ...

    21. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0
      What courses does he usually teach?


      Last time I checked, he taught CS 246 and CS 251, the courses on software engineering, and digital design/architecture, respectively.

    22. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 1, Interesting

      of all places?!?

      You are in an UNDERGRAD program at a RESEARCH university. You're lucky they're making pretenses at teaching you at all. They ony see you as funding their research projects. Waterloo's undergrad CS reputation is NOT that you receive a good education. It's that in one of the most massive CS programs in the country, they are barely able to scrape together 6 students that can perform on ACM (see performance of Waterloo 3 if you doubt this). It's that the students are willing to bend over and pay twice as much in tuition as any other university around. It's that they breed right-wing yes-men with absolutely no social conscience. It's that everyone there is falling over each other to fall into line and BE part of the machine. The reputation has NOTHING to do with undergraduate CS education.

    23. Re:Most of the Prof's lecture notes are plagarized by DuranDuran · · Score: 1

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

      did you ever stop to think that maybe each school just uses the same text, which comes with its own set of lecture notes? for intro courses, there's really no point writing lecture notes from scratch: students don't take well to notes which deviate from the text, and most of the topics are similar because accreditation bodies require these topics to be taught.

      --
      "You can justify anything by putting it in quotes, adding a famous name and making it a sig" - Albert Einstein
    24. Re:Most of the Prof's lecture notes are plagarized by darkstar949 · · Score: 1

      I'm sorry, but that is one of the worse lines I have ever heard. It is ignorant to think that there are not bad teachers, but it is also ignorant to think there are not bad students as well.
      In order education to be effective both parties need to do their job - the student has to pay attention in the class, and do the course work that is presented to then. Where as the teacher is expected to know the course material, and present it to the students in a coherent matter.
      If you try and teach something that you don't understand yourself then, yes, you are a bad teacher because the student may be presented mis-information and end up worse off then they were before.

    25. Re:Most of the Prof's lecture notes are plagarized by Proney · · Score: 1

      Well... someone either went to UofT or got rejected from U Waterloo's CS program...

      While it is true that there are some profs there who care about undergrads about as much as they do toe fungus (Mr. Buss, I'm looking at you), there are a legion of CS profs who are great for undergrads: Atlee, Becker, Vasiga, Pretti, Mann, Steve MacDonald, I could go on. Enrolling at St. Jeromes is also a great way to get a leg up as an undergrad in Math or CS there.

      To answer a few of your other assertions, tuition may be a shave higher in CS at Waterloo than other CS programs in Ontario, but nowhere close to double. Also if you've got the HS marks to get into their fantastic co-op program, it more than makes up for that fact. It's a program where you alternate terms between school and working (at a paying, relevant job) to help pay it off. Without any help from the folks or working a part-time job during terms I graduated debt free with 2 years of relevant work experience under my belt.

      I lean left politically, and I frequently argue over design and implementation details with my boss and colleagues.

      As for the machine stuff... well, I'm just trying hard not to laugh.

      In any case, I know of a plethora of companies, both American and Canadian, that would disagree strongly with your assertion that U Waterloo's CS program is sub-par.

      --
      require "something.clever";
    26. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      and he lived india for a while... he have Indu-trial experience....

    27. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      a lot of lecture notes allow you to use them for educational purposes as long as you credit the source. That is what I do.. I found some really good ones.. no sense in redoing the work. I don't hide this though..

    28. Re:Most of the Prof's lecture notes are plagarized by Anonymous Coward · · Score: 0

      I am Mavaddat. Uh, I don't even know if these are my posts.

  16. Ye old Slashdot Effect by beacher · · Score: 4, Interesting

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

    1. Re:Ye old Slashdot Effect by ral315 · · Score: 1, Funny

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

    2. Re:Ye old Slashdot Effect by 888+Geek+Help · · Score: 1


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

      Golf clap anyone?

      --
      -888 Geek Help (888-433-5435)
  17. Re:Compiler Warnings by Anonymous Coward · · Score: 2, Insightful

    Irony - look it up.

  18. Re:Advice from a fellow student by jschottm · · Score: 4, Interesting

    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.

  19. Finer points of Spanish-English translation by Anonymous Coward · · Score: 0
    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...

    1. Re:Finer points of Spanish-English translation by attonitus · · Score: 2, Informative

      :-). 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 of the English speaking world, we have no problems with Celsius.

    2. Re:Finer points of Spanish-English translation by giulienk · · Score: 1
      Brett : Because of the metric system?
      Jules : Check out the big brain on Brett. You one smart ____________.
      Quote from Pulp Fiction
    3. Re:Finer points of Spanish-English translation by Anonymous Coward · · Score: 0

      It's O.K, most of us are grownups. You can use the word motherfucker on Slashdot.

    4. Re:Finer points of Spanish-English translation by Anonymous Coward · · Score: 0

      You forgot South Africa.

    5. Re:Finer points of Spanish-English translation by attonitus · · Score: 1
      You forgot South Africa.

      ... world

      no i didn't.

      Although I did forget a few other African countries, and New Zealand.

    6. Re:Finer points of Spanish-English translation by fscking_coward_2001 · · Score: 1

      Ethnocentric? Whatever you call it, I don't think it's a question of enthnocentricity.

    7. Re:Finer points of Spanish-English translation by Anonymous Coward · · Score: 1, Funny

      So he's aware of what celsius is, and pays enough attention to notice the nationality of the author, and he's ethnocentric? NO, I charge that you, sir, are secretly a fundamentalist anti-Fahrenheitist! Yes you and your "rest of the entire planet" brainwashed lackeys will stop at nothing to eradicate the last traces of good ole F. Your attempts to whitewash history will fail! Don't turn your back on the tradition of your forefathers only to sell out to some cheap, glamorous, modern machine. Don't join the masses simply because they are numerous. Oppose the cultural imperialism of Celsius!

    8. Re:Finer points of Spanish-English translation by TENTH+SHOW+JAM · · Score: 1

      I wage war apon you with weapons of mass degrees and temperatureism. The good ole Faren of heit will be crushed under our superior decimalised thermometers. No more will people have to convert to an outdated imperialist measurement. We shall crush you. Until the Kelvinists crush us.

      --
      A sig is placed here
      To display how futile
      English Haiku is
  20. Re:Advice from a fellow student by YouHaveSnail · · Score: 3, Interesting

    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.

  21. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

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

  22. For the guys... by Anonymous Coward · · Score: 0

    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.

    1. Re:For the guys... by vranash · · Score: 2, Funny

      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.

    2. Re:For the guys... by Wescotte · · Score: 2, Funny

      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!

      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!

    3. Re:For the guys... by veg_all · · Score: 1

      so I had her buy me dinner

      You must be new at this.

      then never saw her again!

      Well, live and learn!

      --
      grammar-lesson free since 1999. (rescinded - 2005)
    4. Re:For the guys... by vranash · · Score: 1

      Hey, better than my C++ class.. I helped a girl in that class, and she didn't even give me dinner! (even worse, she gave another guy both dinner and her phone number, and he never called her back cuz he thought she drank and was promiscuous and thus not his type ;-p)

    5. Re:For the guys... by servognome · · Score: 1

      Sounds like the kind of girl who goes out on saturday partying instead of playing D&D, and IMing on the computer instead of compiling the latest open source program.
      Definately not the /. crowd type.

      --
      D6 63 0D 70 89 81 BB 8E 7B 7C 5F 5D 54 EA AB 73
    6. Re:For the guys... by vranash · · Score: 1

      Yeah well, it's what I get for going to a Junior College instead of a 4 year university ;p 5 years and still not a single decent girl ;p

    7. Re:For the guys... by servognome · · Score: 1

      Don't worry, I'm sure there are plenty of decent programming girls when you get out into the real world.
      *holds back laughter*

      --
      D6 63 0D 70 89 81 BB 8E 7B 7C 5F 5D 54 EA AB 73
  23. Guide to programming languages by prostoalex · · Score: 4, Funny
    1. Re:Guide to programming languages by Anonymous Coward · · Score: 0

      that was perfect! thanks

    2. Re:Guide to programming languages by Anonymous Coward · · Score: 0

      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!

    3. Re:Guide to programming languages by coolgeek · · Score: 1

      The COBOL one was the best.

      --

      cat /dev/null >sig
    4. Re:Guide to programming languages by fucksl4shd0t · · Score: 1

      No python?

      hmmmm........

      Python: You can shoot yourself in the foot by writing a simple wrapper over anything else on this page.

      --
      Like what I said? You might like my music
  24. Re:Advice from a fellow student by dtfinch · · Score: 1

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

  25. Re:Advice from a fellow student by allden · · Score: 1

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

  26. Re:An example from the article by Anonymous Coward · · Score: 0

    I hope you don't work for Diebold.

  27. "Cheat with your assignment" - ETS by Anonymous Coward · · Score: 2, Informative

    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?

    1. Re:"Cheat with your assignment" - ETS by nate+nice · · Score: 1

      Just about any CS program I have heard of does this. English teachers use this too. They pool all asssignments from all classes and run them against each other. Many schools share assignments for this as well. I'm sure just about every school uses this technique in various fields.

      --
      "If you are a dreamer, a wisher, a liar, A hope-er, a pray-er, a magic bean buyer ..."
    2. Re:"Cheat with your assignment" - ETS by goofy183 · · Score: 1

      The school I went to had an electronic submision program setup for turning in your assigments. It did diffs automaticly after the due date and would flag all the items that were over a certain threshold of common code. Seemed to work pretty well, know a few people that got letters from the dean about copied code.

    3. Re:"Cheat with your assignment" - ETS by 6th+time+lucky · · Score: 2, Interesting

      At the uni i go to, they have started testing out Turn-it-in (http://www.turnitin.com/). It can be used in all faculties for code, mathematics, and 'normal' written assignments. Checks all submitted assigments against each other and the web, highlights the similarities and gives a report.

      The good thing about it is that it is not just to catch cheats, but to educate students (particularly in the sciences) about referencing quotes etc, and to not just block copy other peoples work. Courses will either have the students submit to Turn-it-in and see the reports before they actually submit and fix it if necessary (at least one dumbass submitted his copied assignment anyway!), or markers can submit bits they think are suspicious.

    4. Re:"Cheat with your assignment" - ETS by Anonymous Coward · · Score: 0

      In the real world...

      I do anything I can to save time. Usually that means copying the shell of a module and then building up from there.

      If I were doing a CS course I'd take the same approach to the hw. I'd copy everything in sight. 'Course my deg. is in math. Never had a coding class.

    5. Re:"Cheat with your assignment" - ETS by Anonymous Coward · · Score: 0

      You got 4 as the answer to 2+2. The computer says your friend also got 4, so you must have copied him.

  28. For the curious by ICECommander · · Score: 1, Informative

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

    --
    All your Sybase are belong to us.
    1. Re:For the curious by 888+Geek+Help · · Score: 0, Offtopic

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

      Golf clap anyone?

      --
      -888 Geek Help (888-433-5435)
  29. Re:Advice from a fellow student by flycrg · · Score: 0

    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!

  30. The best advise.... by cjjjer · · Score: 5, Interesting

    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

    1. Re:The best advise.... by PedanticSpellingTrol · · Score: 1

      I'm 19, have a strong interest in computers, and decided to major in political science instead becasue I just didn't see a market for IT skills 4 years down the line, so I"m game. Do you have any leads as to which areas are going to have the most growth opportunity? (cabintetry, plumbing, etc.)

    2. Re:The best advise.... by Peyna · · Score: 1

      I recommend pipefitting or tool and die making.

      --
      What?
    3. Re:The best advise.... by coconutstudio · · Score: 1

      I agree about avoing CS but not entirely. Instead, find a major that you can apply computer science. My biggest mistake is majoring in CS and not business. There are plenty of CS jobs that requires extensive knowledge in fields like business, science, and others. That way, you'll be more well-rounded and have more possibility in career choice.
      http://www.zeia.net/

    4. Re:The best advise.... by Anonymous Coward · · Score: 0

      ...or quit school and join the army so they don't have to resort to conscription.

    5. Re:The best advise.... by Simonetta · · Score: 1

      I would recommend learning embedded systems programming. The tools are free or cheap, the microcontrollers are powerful, highly integrated, and very inexpensive. The skills that you learn as a programmer are nearly completely transferable.

      Embedded systems works a lot more on the hardware electronic component level than traditional CS stuff like system administration.
      In a few years the entire electical power distribution grid of the country will have to be rewired with microcontrollers to monitor and control the energy inefficiencies that are ignored today (due to the consequences of >$50/barrel of oil, along with the possible devaluation of the US dollar).
      That will open many opportunities for computer specialists with embedded-systems orientation.

    6. Re:The best advise.... by cheekyboy · · Score: 2, Informative

      Yeah, here trades people are in DEEP demand (au) and they are getting 80-100k plus, while programmers are being given 32-45k starters at best, (seek.com.au)

      What a joke, be a kitcken cabinet installer, get mega bucks, if you want to be creative, do it at home, why spend 9hrs/day being a slave and getting fat.

      --
      Liberty freedom are no1, not dicks in suits.
    7. Re:The best advise.... by Anonymous Coward · · Score: 0

      I think you will find that to be only a symtome of the houseing boom dude.

    8. Re:The best advise.... by Anonymous Coward · · Score: 0

      Goddamn... why does this shit get modded up as insightful? All it does is breed fucking STUPIDITY. The goddamn blind leading the blind.

      You know what the result of this is? Someone reads this thinking it's true and then they go tell other people. This is why people are stupid.

      Programming jobs aren't going anywhere, you retard.

      It's sad at the amount of people who replied to this agreeing. You all are a bunch of misinformed drones.

    9. Re:The best advise.... by Crash6-24 · · Score: 1

      Skip the tool-and-die making. The Wall Street Journal reported last month about how that extremely skillful job is moving offshore. Why pay $80K for a good design/mold here when you can get it for $40K overseas?
      Based on some other people here, 1) business, 2) engineering (if doesn't matter which kind) 3) science. Any of them will give you insights in to the customer's problem and processes that you are trying to solve or automate.
      For example, my current software development group has a manager with a chemistry degree; the programmers are a chem tech and a physicist; the QA person has a degree in criminal justice; and the project manager was an oceanographer. The group was support is a chemical analysis lab and the more we understand their business and problems the more questions we can ask early about what the system should do.
      The previous contractor on site had 2 lists - engineers and others. The engineers got preferential pay, promotion, and retention bonuses even hough they did the same programming as others. The engineers came from a mining, electrical, and chemical backgrounds. Didn't matter - they had the engineering degree and se were part of the privilieged class.

    10. Re:The best advise.... by Anonymous Coward · · Score: 0

      If you're still listening...

      One of your parenthetical examples (Cabinetry) was maybe one of the best. Another would be flooring.

      I have two friends who do nothing but kitchens and floors (laminate mostly) and they both pull in around $90k/yr which is pretty damn good in the midwest.

      But if you have the interest in computers... Do both. I'm working as a freelance web developer for a couple of companies in town here which is good for around $50k/yr and when I'm slow in that area, I go slap laminate floors down for my buddy which works out to another 10-15k/year.

      Play your career like the stock market... Diversify!

    11. Re:The best advise.... by AbbyNormal · · Score: 1

      There are going to be computers to be fixed right? What about in house coding? What happens if the software breaks on a critical system? What happens if the network goes down? What happens if the building catches fire and the system needs to be rebuilt.

      My advise: Diversify your talent in computers.

      --
      Sig it.
    12. Re:The best advise.... by DrFalkyn · · Score: 1
      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.

      Thats what I heard about the IT/Software development profession, 5-10 years ago...

    13. Re:The best advise.... by Black+Acid · · Score: 1
      The engineers came from a mining, electrical, and chemical backgrounds. Didn't matter - they had the engineering degree and se were part of the privilieged class.
      Would this include computer engineering?
    14. Re:The best advise.... by Crash6-24 · · Score: 1

      Computer Engineering isn't recognized as an engineering discipline here.

  31. My advice for young programmers by jschottm · · Score: 4, Informative

    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 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.

    1. Re:My advice for young programmers by xenocide2 · · Score: 1

      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].

      Which algorithm is it that is completely different, exactly?

      --
      I Browse at +4 Flamebait

      Open Source Sysadmin

    2. Re:My advice for young programmers by jschottm · · Score: 1

      Note to self:

      but there's lot's of good choices.

      Take good technical writing courses.

      may be the one's

      After drinking $BEER in an already long week, consider running posts discussing the importance of technical writing through a spellcheck before posting to /.

    3. Re:My advice for young programmers by KingEomer · · Score: 1

      Ah, Intro to Algorithms, how I love you.

    4. Re:My advice for young programmers by Anonymous Coward · · Score: 0

      6. Don't listen to know it alls.

    5. Re:My advice for young programmers by GridPoint · · Score: 1

      I don't know what algorithm the original poster refer to, but I believe that implementations of heap algorithms become slightly different depending on arrays start at [0] or [1]. I've fallen into this trap myself a few times when implementing said algorithms in C since C arrays start at [0] whereas the algorithms book I used denoted the first array element with [1].

    6. Re:My advice for young programmers by Anonymous Coward · · Score: 1, Funny

      What kind of fucked up language starts arrays at zero?

    7. Re:My advice for young programmers by Stormy+Dragon · · Score: 1

      I've always thought of "Intro to Algorithms" as the Bible of computer science.

    8. Re:My advice for young programmers by worf_mo · · Score: 1

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

      Very good point. Search for a field you are interested in, be it business, medical science, physics, or anything else.

      The extra knowledge you gain will be of advantage to both you and your future employers or customers.

    9. Re:My advice for young programmers by gardyloo · · Score: 1

      Get out, go hiking, meet people of the appropriate sex, see concerts, learn to cook.

      Huh. There's more than one?

    10. Re:My advice for young programmers by spamsk8r · · Score: 1

      Heapsort is, I know for a fact. I tried implementing it from a book one time (which used [1] as the first array element) and, needless to say, it didn't work :-( So I ended up rethinking the whole thing and then giving up on it :-) (not because I'm lazy but because I found that I didn't need to algorithm.)

    11. Re:My advice for young programmers by MonoSynth · · Score: 1

      Yes. There are also 3D versions, and you don't need a GeForce 6800 to view them.

    12. Re:My advice for young programmers by BubbleDragon · · Score: 1

      No offense, but Introduction to Algorithms by MIT is a terrible book. Not only is even the most recent revision riddled with pages upon pages of errors, but the majority of undergrads shouldn't be exposed to at least a quarter of the book. It really is a tedious text, even given the subject. I don't have alternatives to offer, since this is what my school chose to use this semester, and I haven't been exposed to others yet. Otherwise, your post was most excellent, particularly regarding writing and business courses. People - especially get to know your teachers. Not only will this help you when you're floundering about with a topic, but networking is key. (Of course, this doesn't help much if your teachers never actually did work in the field, but it still can't hurt.)

    13. Re:My advice for young programmers by NardofDoom · · Score: 1
      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.

      Know how to cook, check.
      Know how to fix a car, check.
      Met appropriate sex and got married, check
      Go geocaching, check

      Now I don't have *any* time to sit in front of a computer screen. I'd say LCD, but we don't have the money for new-fangled non-radiation-gun monitors.

      *I* find myself wishing I had spent more time learning about computers instead of using them to do other things.

      --
      You have two hands and one brain, so always code twice as much as you think!
    14. Re:My advice for young programmers by agent · · Score: 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."

      True, and this is why I would argue that we need a world language. So everyone can be bi or multi-lingual.

      no racism
      no war

      Take care,
      -Steve
      How would you define "appropriate sex" ?

    15. Re:My advice for young programmers by jschottm · · Score: 1

      True, and this is why I would argue that we need a world language. So everyone can be bi or multi-lingual.

      English is as close as it's going to get for a while. There will never be such a thing as a world language because humans invariably modify their languages with their peers. Witness the vast differences of English throughout the United States, not to mention England and Australia. Even though all three are tightly related, pronunciations and local slang can make it very hard for people to understand each other.

      Cultural situations and experiences greatly shape people, and this is part of why people form clusters the way we do. Even with people that grew up in a very similar lifestyle to my teenage years, I feel a rather large gap between myself and the teenagers at the college where I work, even though they're only a decade younger than me. I don't understand their music and movie references, some of their slang, etc. Multiply this by the vast differences between the US, Africa, Middle-East, Asia?

      It's a nice dream, but the last place I saw that takes Esparanto seriously is Red Dwarf.

      How would you define "appropriate sex"?

      Whatever male/female/transgender/whatever happens to please the person in question. So long as it doesn't harm anyone, I'm all for people doing whatever works for them.

    16. Re:My advice for young programmers by xenocide2 · · Score: 1

      I have to be in the courthouse soon, so I dont have much time to consider your statement, but I still don't see how renaming the indices means more than a simple renumbering of constants and maybe a calculation or two in the algorithm.

      --
      I Browse at +4 Flamebait

      Open Source Sysadmin

  32. Wait until the PENultimate minute. by emarkp · · Score: 2, Informative

    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.

    1. Re:Wait until the PENultimate minute. by veg_all · · Score: 1

      Aw, I prefer waiting for the the antepenultimate moment. Then I get the jump on "penultimate" suckers like you! ;-)

      --
      grammar-lesson free since 1999. (rescinded - 2005)
    2. Re:Wait until the PENultimate minute. by shic · · Score: 1

      You're definitely onto a winning strategy there - well - sort of. It's almost a decade since my undergrad, when I was always one of the first to start assignments. The vast majority of the assignments followed a common trend. Predicted to take about 1-2 weeks to complete, and after spending 3 weeks+ the early starters would discover the problem demonstrably impossible... the most amusing incident involved modification of a natural language parser in Prolog - where it would take the departmental line printer 12 years for each student to print the documentary requirements for the first of 5 parts. This assignment was radically simplified and clarified - hence those who only started in the last week had a significant advantage over those who started early. I always decided I wanted to be the one to find the problems first (always suspecting that the occasion would arise where the assignment would be possible but too difficult to complete in the final few days - even given clarifications) but only once did that prove to be the case.

      Judging by all the people I've met, the most important advice a computing student should take is to be VERY careful with any open-ended projects. In my final year everyone had to write an open-ended project... I chose mine to implement a compiler and runtime for a non-deterministic distributed language based upon Dijkstra's WP language which would survive network outages and fail-stop of individual processors. I worked around the clock for 9 months - I was stretching all the facilities at my disposal and while each problem I tackled was easily within my capabilities - the sheer number of time consuming steps was staggering. I attended the fewest lectures I could get away with (later relying upon revision time to learn much of the material required for my finals) and was to be found working on this project 7 days a week from 8am well into the small hours. With 48 hours to go before my formal presentation, the system as a whole would not demonstrate a credible execution (despite this having been my sole aim for over 6 months being painstakingly careful with the individual components.) After an all-nighter - a matter of hours to go before I had to "show all" I fixed the last bug preventing the demo... FAR too close for comfort. At the demo I couldn't help thinking the professors were more impressed with the coloured wool diagram on a mobile pin-board created just hours before than they were with the thousands of technical challenges I had faced down. If I were doing my final year again I'd pick a far more simple project - with no more than a month spent programming... this would have given me adequate time to make sure I understood the material which would feature in the courses assessed by examination and ample time to make the most of my project with slick presentation and substantially improved project report. While everything worked out great for me, I can't help thinking I did this the "hard way" - the most important advice I can give to any computer scientist who wrote code before starting their degree is that they must avoid being overly ambitious - the belief that you can tackle a large scale project to tight deadlines, when there are alternatives, is the biggest mistake you can make.

  33. Re:Advice from a fellow student by mongoose82 · · Score: 1

    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.

  34. Re:i thought it was going to be something serious. by lakiolen · · Score: 1

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

    --


    What are you expecting to find here?
  35. Re:Advice from a fellow student by Anonymous Coward · · Score: 0
    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.
  36. my guide by Anonymous Coward · · Score: 0

    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?

  37. Real Programmers by gustgr · · Score: 3, Informative

    Thanks, but I have my very definitive programming guide already. Mwaahahha

  38. Why aren't people learning to code properly? by Indy+Media+Watch · · Score: 3, Insightful

    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...

    --

    Indy Media Watch-Proctologist of the Internet

    1. Re:Why aren't people learning to code properly? by iMaple · · Score: 1

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

      I am pretty sure you havnt used one of those. Compare Wordstar for DOS (which btw was state of the art) to the open office writer and you'll know what I am talking about. The fact is there always have been (and I guess will be) good programmers and sloppy programmers and if u r hiring a programmer ur job is to weed out the sloppy programmers.

    2. Re:Why aren't people learning to code properly? by Indy+Media+Watch · · Score: 1
      if u r hiring a programmer ur job is to weed out the sloppy programmers.

      Naturally, but if people want to avoid becoming sloppy programmers, it's this sort of thing they need to think about, and think about hard.

      --

      Indy Media Watch-Proctologist of the Internet

  39. Re:i thought it was going to be something serious. by adamjaskie · · Score: 1

    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.

    --
    /usr/games/fortune
  40. Wait, shouldn't this be in Hindi? by Anonymous Coward · · Score: 0, Redundant

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

    1. Re:Wait, shouldn't this be in Hindi? by Anonymous Coward · · Score: 0

      Nope, only PAID coding jobs will go to india. Like Lars Ulrich before you, you might have to get used to doing it for the love, not the money... ;)

    2. Re:Wait, shouldn't this be in Hindi? by Kheturus · · Score: 1

      Your joke doesn't compute.

      English is the most widely spoken language in India.

  41. You know, by HoneyBunchesOfGoats · · Score: 1, Troll

    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.

  42. Re:Compiler Warnings by nwbvt · · Score: 5, Insightful

    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?

    --
    Mathematics is made of 50 percent formulas, 50 percent proofs, and 50 percent imagination.
  43. In my experience.. by Soldevi · · Score: 1

    .. 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.

    1. Re:In my experience.. by nate+nice · · Score: 4, Insightful

      That's a pretty pretensions comment. Many people don't have access, either through finance or friends, etc to get interested in CS things like programming at an early age. Granted, while in it you ought to be interested and enthused about, else you should probably be doing something else that does. But, that's the whole point of college; to discover what interests you if you haven't already and experiment with things. Many of these "majority of CS students" are taking a Java class to see if they enjoy it, thus it is the first time they have touched a command line. Many of them will find it's not for them and drop. Some will stick around for some reason.

      Besides, if you knew anything of CS you would know Java and command lines have as much to do with it as telescopes do to astronomy, to paraphrase Dijkstra. In fact, I had professors who could care less about Java or command lines because their interests are in theoretical computer science, algorithms, math, theory, etc.

      Perhaps you are in the wrong major. Maybe you belong in a traade school for programming?

      --
      "If you are a dreamer, a wisher, a liar, A hope-er, a pray-er, a magic bean buyer ..."
    2. Re:In my experience.. by iMaple · · Score: 3, Insightful

      .. 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.

      Well I was under the impression that they join the program to learn CS and not the otherway round. I have seen smart students who have never used a computer before do really well in my course. Also CS is not just about programming, its like other engineering branches ... i.e. about solving problems ... programming languages are just the tools. Your argument is similar to saying that unless u have experience constructing bridges and buildings dont go into a Civil engg. program. (anyway most analogies are as dumb as a bat :)

    3. Re:In my experience.. by xenocide2 · · Score: 1

      Well, not every student in MY graduating class, or even the majority of students, were people who got in it for the money, because they liked games, etc. These people generally learn quickly and fill the ranks of your MIS programs. Maybe my school is somehow different, or maybe you havent made it past the classes of attrition.

      They say they aren't weed out classes, but in essence they are; its only gonna get harder there-on in, and nearly everything you learn will be useful later. If the classes were curved to where a normal number of people passed, the next class in the chain would become the "weed out" class, or suffer the same degree factory atmosphere.

      --
      I Browse at +4 Flamebait

      Open Source Sysadmin

    4. Re:In my experience.. by Soldevi · · Score: 1

      I never said anything about an early age. I said prior experience. Virtually anyone in college or going into college will have a computer now. It's not feasible to not have one anymore. It makes no difference whether you've had it for a month or two prior or several years. No one will make it through the CS program without a fundamental knowledge of computers and how to fix them as much of the stuff done in CS if done wrong will royally screw it up.

      I have to disagree that college is to discover what interests you. I see college as a source of enhancement for what you already have an interest and slight knowledge in. Primarily because it DOES cost money and the more time you spend taking classes that will have no bearing on your major the more it will cost you. It is very expensive to experiment and find something you like.

      I also have to disagree about Java and the command line. I seem to remember using a shell quite frequently when doing Java assignments. You know, when doing that pesky compiling thing. And while it was little more than using cd/ls/rm/find/whatever, it was still the command line, and it was very suprising how many people didn't know how to find their way around in it.

      Programming in most any language is fundamentally a command line activity. IDEs are usually just ways to put a fancy wrapper around it to hide all the details and automate some things.

      As for theoretical computer science, what use is that if you don't figure out how it really applies by trying it? You can manually trace all the AVL trees and B-trees that you want, but unless you actually create some programatically and see what works and what doesn't work, then what's the point? Both the theoretical and the applied need to be present.

    5. Re:In my experience.. by Anonymous Coward · · Score: 0
      "IDEs are usually just ways to put a fancy wrapper around it to hide all the details and automate some things."

      Translation: IDEs are usually just ways to be more productive and not waste time on simplistic tasks.

      In other words, get used to them, because if you want to accomplish anything in the real world, you're going to find that productivity tools quickly become your best friends.

    6. Re:In my experience.. by Anonymous Coward · · Score: 0

      I was in one of these "totally not a weed-out class" weed-out classes once. The weeding out in this case wasn't about seeing who could actually handle the assignments - it was about seeing who could bear being insulted the most. The professor would begin obvious observations with, "I know it's hard to believe, guys...", tell us we weren't going to make it anywhere in the real world and then give us these multiple-guess tests where we hacked up the answers to questions he'd fed us over and over like some sort of educational hairballs. It sucked, especially since it wasn't even my major and I was just taking the class to do something interesting with my time.

    7. Re:In my experience.. by Anonymous Coward · · Score: 0

      And in school, you need to dig deeper and learn how it works on the inside because you need to know how to fix it if your (or someone else's) productivity tool fucks something up when you're up against an insane deadline!

  44. Re:Compiler Warnings by introverted · · Score: 1
    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.

  45. Bad Joke by cookiepus · · Score: 3, Interesting

    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.

    1. Re:Bad Joke by Martian_Bob · · Score: 5, Insightful

      I've got to disagree - for beginning CS students, compiling frequently is an excellent thing to do. I'm a CS TA, and most of the panicky emails I get from students the night before a project is due revolve around small, simple problems that get blown way out of proportion. A single misplaced semicolon can make the compiler spit out dozens of errors for lines of code below it, none of which will make any sense. Errors propogated through code are terribly difficult to detect; your program's output might be incorrect due to something that you wrote two class files ago and have already forgotten about. And then there's the problem of poor program planning combined with infrequent test compilations - namely, the design sucks donkey balls and you just spent three hours laying down the foundation for a code base that is completely useless. I wrote code like this until I because a grad student, and it shows - I spend way less time designing and write far better programs due to multiple test compilations.

    2. Re:Bad Joke by Anonymous Coward · · Score: 0

      Holy shit dude you must be joking, that is such terrible advice, whatever moderator gave you anything other than -1 for that comment deserves to have their mod points removed permanently. I actually feel like I lost an iq point or 2 after reading your comment.

    3. Re:Bad Joke by jjohnson · · Score: 2, Interesting

      You're an excellent example of a freak who does a particular thing very well, and so convinces others to do it not nearly as well as you can.

      If you can code all day with minimal errors and minor cleanup afterwards, great, you've found what works for you.

      But compiling frequently is sound advice for the vast majority of programmers, in line with the maxim to keep your code in a shippable state at all times so that bugs don't fester. Also, you're violating another maxim that may be false in your case, but is generally true and sound advice: design first, code later. According to you, the design is happening at coding time, which is something most programmers don't do well.

      A top down programmer can still be an incremental developer by stubbing out the design, thus leaving it compilable without getting distracted coding helper methods.

      --
      Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
    4. Re:Bad Joke by Anonymous Coward · · Score: 0

      "Compiling frequently is not good"

      "During coding, why bother compiling?"

      I have a feeling that a small exposure to unit testing would blow your mind. You really ought to give incremental development a try before you bash it.

    5. Re:Bad Joke by aussie_a · · Score: 5, Insightful
      Why am I not seeing +4 Funny? Oh well, time to argue your ridiculous post point by point (I've got 2 assignments due tomorrow, I'm using this time as a break from coding, dear god I'm a nerd).

      Compiling frequently is not good because you should not be thinking about such details as syntax and var name spelling until the very end.
      As of tomorrow I will have done 5 assignments in C++ this year. For 4 of those assignments I didn't have a compiler at my home (our program had to compile in Turbo C++, you could tell who used different compilers at home). Instead I had to go to school to debug my programs, so what I did was I'd write out my code at home in a day, go to school and then spend a few days debugging it. For 1 of my assignments (my last one) I had a compiler at home so I could debug as I go. Guess which assignment I actually enjoyed. That's right, the last one. Not knowing if my code will work makes coding unfulfilling. Spending days debugging is tedious and stressful.
      For most of the time you're writing code, what you have should not be compileable.
      This just sounds plain lazy. Your code should (with as minimal effort as possible) always be compilable. If you've got a menu that calls 5 modules, write stubs for the modules. Utilise flags. This allows you to compile as you go along.
      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?
      Actually it's closer to "create 100 errors get 10000 error messages, try to sieve through all the messages to find the correct 100." Whereas it's much easier to go through 10 error messages to find the correct 1. You'll notice you tend to get the same 9 error messages each time, whereas having 1000 makes it a lot more difficult. And this is just syntax errors. We're not even talking about logical errors (and yes, there will be some, no-one's perfect).
      Focus on the higher picture. Implement your vision.
      Actually you won't be implementing anything. You haven't implemented it until it's working. And focusing on the higher picture should be done in the PLANNING STAGE. NOT the CODING STAGE. Ideally you shouldn't even be on a computer when writing the algorithm (which is where you focus on the higher picture). You should have a pencil, a rubber and lots of pieces of paper. But even if you are on the computer it should be done in Pseudocode.
      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.
      I bow before your intelligence, for you can write code without debugging it at all and only have "a couple of errors." You must truly be a coding genius. That or you're talking out you're ass. I haven't met anyone who can do what you just described. Not any students and not any teachers.
      Also, sometimes I actually shock myself by writing code for an entire day and then having it compile w/o errors the first time!
      Either you write simple code or you're a liar and/or a troll. Because the chances of that being true is (IMO) very small.
    6. Re:Bad Joke by Anonymous Coward · · Score: 0

      It's not impossible to write complex code that works on the first try, although it's rare. While most programmers can't work as described, some programmers can indeed write over a thousand lines of code at a stretch and have only a few minor errors to resolve. However, the vast majority of programmers (especially beginnning CS students) won't have this level of proficiency -- even if they have the native ability, they rarely have enough experience.

      I didn't author the original post, but I have had the experience of writing code for a number of hours (well over a thousand lines of non-trivial code) and have it work perfectly on the first try. It does happen. But usually there's at least a few minor errors to deal with. (And sometimes major ones, of course.)

    7. Re:Bad Joke by Cederic · · Score: 4, Insightful


      If you don't compile every few minutes, you're running your tests every few minutes.

      If you're not running your tests, how do you know your code works?

      If you're not compiling and testing, how are you figuring out what the code you're writing is meant to be doing?

      I used to code for a day without compiling, then sit in amazement as my code compiled first time. Luckily computers are faster now and it doesn't take the better part of an hour to recompile - it takes a few seconds - long enough to pick up my coffee, take a sip and think about the next test I'm going to write.

      Now that I compile more often, and run tests several times an hour, my code is immensely higher quality, I write it faster, I spend far less time sorting out compile errors and random bugs and I can safely walk away from the computer with just a couple of minutes notice without worrying about leaving a nasty mess that it'll take me a couple of hours to understand, finish and compile the next day.

      In other words, thanks for the advice, I'll follow it if I want to return to where I was a decade ago.

    8. Re:Bad Joke by Spykk · · Score: 1

      And then you find that one of those errors requires you to restructure your entire design. You just threw away a few hours of work. If your project is sufficiently modular, compiling takes little time. Do things one feature at a time and it will save you from rewriting alot of code.

    9. Re:Bad Joke by fucksl4shd0t · · Score: 1

      Whatever happened to "fix the very first error listed, then recompile"? It's usually a missed include anyway.... ;)

      --
      Like what I said? You might like my music
    10. Re:Bad Joke by fucksl4shd0t · · Score: 1

      Heh, I always get distracted coding helper methods. By the time I'm done, I've rewritten the API three times and only half-implemented each rewrite.

      Still haven't quite managed to find a solution other than periodically whipping myself and pulling out pubes with tweezers everytime I decide to redesign the API.

      --
      Like what I said? You might like my music
    11. Re:Bad Joke by fucksl4shd0t · · Score: 1

      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.

      I bow before your intelligence, for you can write code without debugging it at all and only have "a couple of errors." You must truly be a coding genius. That or you're talking out you're ass. I haven't met anyone who can do what you just described. Not any students and not any teachers.

      You've obviously never used Python before.

      --
      Like what I said? You might like my music
    12. Re:Bad Joke by Anonymous Coward · · Score: 0


      > Also, sometimes I actually shock myself
      > by writing code for an entire day and
      > then having it compile w/o errors the
      > first time!

      Either you write simple code or you're a liar and/or a troll. Because the chances of that being true is (IMO) very small.


      I used to think that way, and then I began using higher level languages. Things got a bit better when I used Java instead of Pascal or C, but this dream came true only when I started using Ruby. In fact, Ruby is not compiled, but most of the time, I can just write code and run it without syntax errors. Which doesn't mean it doesn't have semantics errors.

      When a programming language is more about the programmer that about the computer, you can feel the difference.

    13. Re:Bad Joke by Anonymous Coward · · Score: 0

      You must be using a rare 'compiled' version of Python, then.

    14. Re:Bad Joke by xenobyte · · Score: 1

      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?

      Well, almost all subsequent errors are usually the result of the first; I've seen multiple screenfulls of one-line error messages go away after fixing the first problem: A missing ". When the token state machine in a compiler gets out of sync the compilation result is unpredicable at best, and often just plain useless...

      --
      "For every complex problem, there is a solution that is simple, neat, and wrong." -- H.L. Mencken (1880-1956) --
    15. Re:Bad Joke by swillden · · Score: 1

      dear god I'm a nerd

      Don't worry, He already knows.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    16. Re:Bad Joke by CharlieG · · Score: 1

      Writing code without errors can be done, and back in school, I used to do it all the time, but then again, school projects are fairly "trivial"

      Back when (this is 20+ years ago folks) when I was taking into to machine language, we were allowed to work with a partner. I had a fairly good partner whos skills complimented mine. We'd get some assignment, due in say, 2 weeks. Next day, she'd ask me "did you start on it yet?" The answer would be "Nope - thinking about how to solve it" - and we bat around design ideas. This would go on every day for almost a week. The two of us refining the design - no paper, just talk (folks - my school still had PUNCH cards) The finally, she'd say "Have you started on the code yet?" And I'd say OK - and I'd sit down with a pad and pencil, and WRITE out the entire program, in Assembler, in ONE pass. Macros, etc - just filling page after page with code.

      When I was done, I'd take 1/2 the pages, she'd take the other half, and we'd go type it in. I'd say on more than 50% of the projects, it ran, error free on the first try. Sometimes we'd get an occasional typing error, and other times there would be design problems that took tweeking over the next couple of days

      So, it is possible to do. Then again, just about any CS1/CS2 program is by definition a simple program. Any project shorter than multiple man months is

      --
      -- 73 de KG2V For the Children - RKBA! "You are what you do when it counts" - the Masso
    17. Re:Bad Joke by Anonymous Coward · · Score: 0

      "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."
      For most of us it takes ony a few minutes to write:

      main()
      {
      prinf("Hello World");
      }

      But never the less I applaude your errorless coding skills.

    18. Re:Bad Joke by Crash6-24 · · Score: 1

      20+ years ago a customer, a statistician by trade, took a course in Fortran to understand what we were coding for him. His first program compiled and executed correctly for him the first time. He didn't understand why we had so much trouble writing and debugging programs.
      They are out there...

    19. Re:Bad Joke by GileadGreene · · Score: 1
      If you're not compiling and testing, how are you figuring out what the code you're writing is meant to be doing?

      That would be the part where you sit down and define the problem first, then create a design for a solution. Then you start coding. Note that I'm not saying that you shouldn't compile and test regularly. But you should be doing that to catch bugs incrementally, and to refine your design (and in some cases the definition of the problem). If you have no idea what the code is meant to be doing how can you write any code in the first place (or define tests for that matter)?

    20. Re:Bad Joke by Cederic · · Score: 1


      Thing is, almost nobody ever designs up-front to the level of detail where they know precisely and exactly what their code is doing.

      So you may well know at a macro level "This code is calculating tax" but while writing your code you need considerably more detail than that. Most people will go horribly wrong if they stop at that macro level; constant compile/test cycles help you break down the coding itself into small tasks, each of which you can then apply adequate thought to and perform the detailed design of that tiny piece of the puzzle - and then validate that you've implemented it correctly and it does what you expect.

      I didn't say, "Don't design up front."

    21. Re:Bad Joke by GileadGreene · · Score: 1
      I didn't say, "Don't design up front."

      Just as I didn't say "Don't compile/test periodically".

      I agree that compile/test cycles help to break the problem down into manageable chunks. I'd go a step further and say that defining tests helps to focus a developer's thoughts on what solving that particular chunk of the problem involves.

      Design is a hierarchical, fractal process: define problem at macro level (define preliminarysystem level tests - preliminary because they may change some by the time you're done), design at macro level, based on macro level design define at problem (s) at sublevel 1 (define tests at this level), design at sublevel 1, ....

      Whether you do this breadth first or depth first is a matter of taste, and may also depend on what type of problem you are dealing with at the macro level. And it's always an iterative process, traversing up and down the design hierarchy, because design is about learning the problem - otherwise it wouldn't be design it'd just be following a recipe to solve a known problem in a known way (which can work so long as you have correctly identified the problem in the first place).

    22. Re:Bad Joke by Cederic · · Score: 1


      We're saying approximately the same thing, just with different emphasis. So I'll just say: Yes, I agree. :)

    23. Re:Bad Joke by shish · · Score: 1
      Also, sometimes I actually shock myself by writing code for an entire day and then having it compile w/o errors the first time!

      Either you write simple code or you're a liar and/or a troll. Because the chances of that being true is (IMO) very small.

      Actually, I've done that - ~2000 lines of stub code (empty functions, classes that contained nothing but the empty functions; one or two functions called the empty functions, etc) - I did the entire overview of the program in a single coding session, and then spent the next ~3 weeks filling in the actual code part of it.

      Being very simple code-wise (ie, there was none), I could keep the overall design in mind at all times - that kept the logic bugs out too. With there being no functional code, and the logic being a single brainfull, the only bugs left were ~20 typos.

      --
      I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
    24. Re:Bad Joke by dsplat · · Score: 1

      Heh, I always get distracted coding helper methods. By the time I'm done, I've rewritten the API three times and only half-implemented each rewrite.

      That's one of the best reasons in the world for always keeping your code in a compilable state. When you discover that you need to change something in your interface, your compiler is one of the most valuable tools available. If you missed a caller that should have been changed, it can often tell you. (Yes, I know plenty of languages where that is far from true.)

      --
      The net will not be what we demand, but what we make it. Build it well.
    25. Re:Bad Joke by Anonymous Coward · · Score: 0

      ...You should have your pencil grasped firmly, a rubber, and lots of pieces of toilet paper. Even if you are on top of your computer...

      Or something like that ... Thank you! I'm here till Thursday, try the veal!

    26. Re:Bad Joke by Anonymous Coward · · Score: 0
      A single misplaced semicolon can make the compiler spit out dozens of errors for lines of code below it, none of which will make any sense.

      Which reminds me of my favorite advice to any CS student: your school probably offers a course in compilers. Take this course. It will be a lot of work, but in the future every time you see a big list of compiler errors, instead of being mystified you will go "oh yeah, that was silly of me" and fix it in 5 seconds, because you will have the ability to understand exactly what the compiler's weird error message is trying to tell you.

    27. Re:Bad Joke by GileadGreene · · Score: 1

      Heh. I meant to include the line "we appear to be in violent agreement" to my last comment, but somehow forgot in my haste to submit. So, I agree that we agree. :)

    28. Re:Bad Joke by cookiepus · · Score: 1

      Why am I not seeing +4 Funny?

      I dunno. It would have been at +5 if 2 dorks didn't think it was overrated ;-) Whether the modifier was going to be Funny or not.... Anyway...

      That's right, the last one. Not knowing if my code will work makes coding unfulfilling. Spending days debugging is tedious and stressful.

      Well if that works for you, then certainly this is the way you should work. For me, the bigger thrill of programming lays in having an overall idea, top down. The process of implementing the actual functions is something I leave for the very end, and sometimes give to another programmer. I enjoy that part of it a bit less. So for me it's more enjoyable if I could sit down and lay out my classes or modules, figure out what functions I will need, etc. For me, compiling frequently is a distraction from the real task. But that's just me, and you don't have to be like me, and that's OK.

      Your code should (with as minimal effort as possible) always be compilable. If you've got a menu that calls 5 modules, write stubs for the modules. Utilise flags. This allows you to compile as you go along.

      Actually you're right on that one, I miss-spoke. I usually begin implementing my programs as comments/pseudocode. So while that stuff is indeed compileable, it's not really meaningful to have it compile. Ok, so I will find that missing semicolon now and not later if I compile all the time. But.... It's not an issue for me. If it is for you (and it is) then do it your way.

      Actually it's closer to "create 100 errors get 10000 error messages

      Well since I only look at the top one, and know better than to shit my pants if there're a lot of errors, it doesn't matter how many errors are returned. I am talking about the number of actual issues you have to fix, not how frightening the compiler output looks.

      I bow before your intelligence, for you can write code without debugging it at all and only have "a couple of errors." You must truly be a coding genius. That or you're talking out you're ass. I haven't met anyone who can do what you just described. Not any students and not any teachers.

      Hang on a sec, are you talking about syntactic correctness or logical correctness? If you find it shocking that there are only a few compiler issues, then either you're a terrible typist and misspell "printf" frequently, or you have a habbit of not putting semicolons at the end, or your text editor should make a better effort at showing you missmatched parens and braces and such.

      If you find it difficult to agree that a program can come out logic-error free right away then, guess what, I agree with you. But frequently compiling doesn't do anything to help you spot those, unless you have logican unit tests to perform along the way. And I totally agree with testing a unit once you have a complete unit to test, but if you're implementing top-down, you won't have anything testable until towards the end. But certainly unit testing is great. Compiling just to see that it compiles, on the other hand, is of no real value (to me) but as I said before, if it makes you happier to find your missing semicolons now rather than later, that's cool.

      Also, sometimes I actually shock myself by writing code for an entire day and then having it compile w/o errors the first time!

      Either you write simple code or you're a liar and/or a troll. Because the chances of that being true is (IMO) very small.


      If you have as much trouble parsing code as you do parsing english, I believe your need for frequent compilation is a real one. In my comment I wrote that I am "shocked" at those "sometimes" when my code actually compiles the first time after a few hours of coding. I think the shocked and sometimes clearly imply that this is a rare occurance and I am poking fun at myself.

      So chill out, compile some more, take a sip of coffee, and have fun.

      And god help me next time I state my preference for whether the opening curly goes on the same line as the if statement, or by itself on the next one, if you should hold the contrary opinion. Surprisingly that you should hold so much hostility for people who employ other development methodologies than you do.

    29. Re:Bad Joke by cookiepus · · Score: 1

      And then you find that one of those errors requires you to restructure your entire design. You just threw away a few hours of work. If your project is sufficiently modular, compiling takes little time. Do things one feature at a time and it will save you from rewriting alot of code.

      I have a very hard time believing that compiler issues can/should force you to change your design. In fact, I can't imagine a situation where this can be.

      Compiler errors and warnings are there to enforce language syntax, and are corrected by changing your eroneous / missing language tokens to ones the language expects.

      Really, I can't imagine what you're talking about. Are you worrying about some guy writing a class hirearchy in Fortran only to find out from the compiler that he cannot make classes in Fortran?

    30. Re:Bad Joke by cookiepus · · Score: 1

      There's no mention of unit testing anywhere here. Obviously to unit test you must compile. The subject at hand is whether one should frequently compile to catch syntactical issues early.

    31. Re:Bad Joke by Spykk · · Score: 1

      Compiling isn't just for finding syntax errors. You can't find runtime errors until you compile the code and run it. Besides, we're talking about students here.
      When I was less experienced I sat down and wrote a whole lot of code for a project that used a vector of classes. Other classes needed pointers to these classes. Imagine my surprise when I realised adding new classes to my vector changed all the addresses, breaking all the pointers. Had I compiled earlier, I would have noticed the crash and fixed it with a trivial change. As it were I had to slog through a lot of code fixing tedious mistakes.

    32. Re:Bad Joke by Anonymous Coward · · Score: 0

      This is especially true for assembler coding/machine language, in my experience. Since the language itself is in a very complicated framework, and there's no handholding being done for you, you're forced to think _very_ carefully about the structure of the program and the problem you're trying to solve.

      However, even then, it is the exception, not the norm. In an introductory architecture class, I was the only one of 150 students who coded an assembler routine correct in the first pass. But many, many of the others had only made really trivial errors, due to the reasons above, and were effectively also correct the first time around.

      High level languages help us solve "easy" problems easier, and complicated problems in a more intuitive way. But the potential errors also get increasingly difficult to see through, because of the necessarily more complex structure of the language.

  46. Re:Advice from a fellow student by ErichTheWebGuy · · Score: 5, Funny

    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

    --
    bash: rtfm: command not found
  47. Re:ExtremeGoatse Story Time! by Anonymous Coward · · Score: 0

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

  48. Read Asimov, do assignment later by xtermin8 · · Score: 1

    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. ;->

  49. Hint for programming. by Spy+der+Mann · · Score: 4, Insightful

    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.

    1. Re:Hint for programming. by roman_mir · · Score: 3, Insightful

      Here is a better hint:

      get your hands on an old 386, a debugger and an assembler. Figure out your way through building simple tools for cutting and concatenating files, fixing file system, writing simple menu driven apps. Attempt a calculator, a text editor (try this one in assembler, I am dead serious,) try a few games. A labyrinth game, an FPS, maybe some sort of a space ship game.

      Write all this stuff first the way you like, don't worry about style and comments. Stick to it, work on your own spread sheet, graphics library, TSR programs (ah, good old DOS.)

      Once you are comfortable (this will take at least 6 months, maybe more,) go back and revisit your own code. Now you will learn that all your good old code will not stay in your own head forever, you will learn to appreciate structure and comments.

      Noone can make you do it unless you realize it yourself - structure is important.

      From procedural programming, move into something more esoteric - try to write an adventure game in Prolog so that you will have to learn more and more about that way of programming. You will spend a minimum of 3 days learning and writing that shit. You know - you are in a room, now the lights are off, you have this in your hands... what are your actions.... etc.

      Now you can go into OO. OO is not a natural way of writing code or even thinking about software. You will make common mistakes, like using OO as a procedural language. But if you are still interested at that point, you will continue learning and you will understand the difference between OO and procedural or imperative. Don't use OO for everything, please, network is not object oriented. Neither is HTML. Whatever.

      But start with a 386, on that platform you will really have an opportunity to learn and control the hardware. If you will like that you will know that programming is for you.

    2. Re:Hint for programming. by fucksl4shd0t · · Score: 1

      If you start designing on paper the functions/object/interfaces/etc for your program, then start coding.

      I don't know how to break this to you, but if you write good logical constructs in english, then start reading.

      --
      Like what I said? You might like my music
    3. Re:Hint for programming. by beelsebob · · Score: 2, Insightful

      You seem to be implying that we're all going to go out there and use OOP? This in it's self is one of the many bigoted views that makes most code today bloated slow and buggy. What happened to chose the best tool for the job? What happened to looking at all the possibilities? There are certain tasks that OOP works really well for, and others that, quite frankly, it sucks for. Try to write a compiler in an OOP language, you're gonna go down in flames - you need a procedural language, or a functional language. Try writing a human speech parser in an OOP language, again, not going to happen - you need a logic language. I really don't get why people think that OOP is panacea, it's just another tool in the toolbox. Bob

    4. Re:Hint for programming. by Nurgled · · Score: 1

      I've seen several compilers using object-oriented design. The most famous example is the Mono C# compiler. Most of them aren't entirely object-oriented, but there's not really any reason why you can't just make a small chunk of your program procedural if that design makes more sense.

      Having said all that, I'm thinking of object-oriented in the more "static" sense that people are used to from Java, C++ and C#. Writing a compiler in a prototype-based OO language like JavaScript or Lua would perhaps be more "interesting"... there are some things which would get easier, and others which would get harder. That's true when you switch between procedural and OO as well, though.

      I'm not disagreeing with you that OO isn't the answer to everything, though. Clearly there are problems where the "object" paradigm isn't the best approach.

    5. Re:Hint for programming. by javaxman · · Score: 1
      all of which are good points of advice, and completely at odds with the article linked in the story.

      Which helps point out that the article linked in the story ( at least the first two sections ) are some of the WORST bits of advice I've ever read on programming. Just sitting down and writing code without thinking about the problem first is a good way to waste lots of valuable time.

    6. Re:Hint for programming. by javaxman · · Score: 1
      you don't always have to write in OOP, but you *think* in OOP much more clearly, and it generally helps to uh, structure groups of functional calls... which, well, what exactly do you think OOP is, really ?

      Yea, it's another tool. A useful one for design, even if your code is going to end up being functional in implementation.

    7. Re:Hint for programming. by roman_mir · · Score: 1

      What do you think OOP is? It is definitely not about grouping functional calls. For that there exist libraries of functional calls that are grouped in a sensible way. OOP is a fad obviously, since most people that I have seen doing it don't realize that what they do is not it. When you start discussing it with them you make them realize that what they are doing is just what you have described - grouping functional calls. That's the answer to the question that the parent asked - What happened to chose the best tool for the job? - nothing good happened. All the businesses now are using the same hammer on their problems that they are trying to convince themselves are nails.

      OOP is about polymorphism, encapsulation, class views, self sufficient self describing objects that are supposed to maintain their own state etc.

      But what happens in reality? Stateless EJBs, static fields, collections of methods all called 'execute()' etc.

      But this doesn't matter since the work is somehow getting done obviously, it's just that it is not done in the best possible way. Well, who the hell said that humans can do things in the best possible way? Things happen mostly for political reasons and marketting games, not logic, reasonning or being efficient and using the best tool for the job.

    8. Re:Hint for programming. by javaxman · · Score: 1
      OOP is a fad obviously

      See, I want to engage in an insightful, useful intellectual discussion with you, but clearly I shouldn't even be replying, since you're making lame-ass comments like "OOP is a fad". Yea. A fad that's lasted since 1990. Get a grip.

      Of course, OOP is much, much more than encapsulation ( what I was describing very, very generally as "grouping functions" ), but conceptually, it's actually not really _that_ much more, and that's part of the _good_ stuff about OO. In concept, it is somewhat ( deceptively, some would say ) simple.

      Back to what I was actually talking about, namely thinking and designing in an object-oriented manner helps you to encapsulate the _design_ of the system in such a way that, even if you're not using actual OOP languages, your library and code design at least makes some logical, modular sense, limiting the number of repeated lines of code, and thus, possible locations for bugs.

      My point was that designing in an OO manner is useful, regardless if you're eventually designing systems to be implemented in straight C, C++, assembly, or whatever.

      Sometimes, of course, you're dealing with stuff ( usually at the very basic, low-level data end, or at the equally basic, super-high-level invocation end ) where a single, non-OOP structure or set of calls is what you want. That's where "pure" OOP languages like SmallTalk piss people like you off, and annoy most of the rest of us.

      For implying that stateless EJBs are somehow non-OO because they lack, well, state, uh... I'll try to avoid insulting you and just say there's a place for static objects which encapsulate commonly used functionality. There's no problem with that in a conceptual OO sense, unless you just have a weird bias about OO in general and/or don't understand it.

    9. Re:Hint for programming. by roman_mir · · Score: 1

      Ok, lets go back for a second:
      you don't always have to write in OOP, but you *think* in OOP much more clearly - this is only true for a small subset of programming problems. In all cases of large projects I have witnessed general misuse and lack of understanding of OO design. OO does not make project clearer than other forms of design paradigms.

      Yea, it's another tool. A useful one for design, even if your code is going to end up being functional in implementation. - and again, this absolutely depends on the problem at hand. OO paradigm cannot help to design list based problems. Component or collaboration diagrams were adapted by OO design but were used much earlier. Sequence diagrams are flowcharts.

      See, I want to engage in an insightful, useful intellectual discussion with you, but clearly I shouldn't even be replying, since you're making lame-ass comments like "OOP is a fad". - First of all what is so insightful about your earlier comments? The first OO language I used was Pascal 8 in 92, the same year I learned C++. I also thought OO cocnept was the best thing since sliced bread. In 96 I already used Java for AT&T projects. Over time it became apparent to me that OO is in fact a fad. I am not saying that the whole concept does not have value, I am saying it is more about buz-words and marketting than it is about actually solving the problems at hand.

      Of course, OOP is much, much more than encapsulation - the reality is that OO is just an idea that you buy into, nothing more. Lisp was a great concept and a bunch of people bought into that too, so what? What about COBOL, where is that today? Today Java is COBOL. Smalltalk I used at school long time ago, my girlfriend used Eifel. Where are these languages? Not widely used anyway.

      Back to what I was actually talking about, namely thinking and designing in an object-oriented manner help - and again to repeat myself, OO was not the first to introduce the way of designing libraries well, because in reality that is what you are talking about. Who cares about polymorphism in a business language? Today polymorphism is a fad. So called architects on large projects will waste time to simply include the idea of polymorphism into their design just for the sake of doing that. I have seen it much too often to realize that with all the design the 'architect' will still not be able to predict what sort of problems will actually arize during project construction and deployment and will not factor such things into design. It does not matter that they are using OO, it is not the method it is the person using the whatever method that makes the difference. (About this point I am no longer willing to speak, too many bad memories.) Encapsulation is important but the idea is not from OO design. Modularity concept preceeds OO design by decades.

      My point was that designing in an OO manner is useful, regardless if you're eventually designing systems to be implemented in straight C, C++, assembly, or whatever. - Yeah, as I said, I've gone through that period in my life when I thought that too. Then I discovered functional programming. And you know what, if you are going to apply OO design to assembler you will get nowhere. I use assembler on Atmel chips even today, there is nothing there that you want to apply OO for. When you use Assembler you go for the speed and memory manipulations. Sure sure, you think about grouping functionality and reusing functions but this has nothing to do with OO.

      Sometimes, of course, you're dealing with stuff ( usually at the very basic, low-level data end, or at the equally basic, super-high-level invocation end ) where a single, non-OOP structure or set of calls is what you want. That's where "pure" OOP languages like SmallTalk piss people like you off, and annoy most of the rest of us. - what are you even saying, I would not use Smalltalk for programming my Atmel microprocessor, why woudl Smalltalk piss me off? You are m

    10. Re:Hint for programming. by Anonymous Coward · · Score: 0

      I think this suggestion is better for experienced programmers.

      Beginners often don't understand the basic mechanics (I know, I teach programming)... so starting with small experiments and leading up to the final code is better.

      UML and other big picture techniques work well when the programmer can easily translate the abstract into a concrete implementation. This is not a trivial thing to acquire.. and CS1 and CS2 students most probably DO NOT have this ability.

    11. Re:Hint for programming. by javaxman · · Score: 1
      I think I get it. We're basically saying the same things two slightly different ways, and somehow as a result ending with opposite-sounding conclusions.

      Who cares about polymorphism in a business language? Today polymorphism is a fad. So called architects on large projects will waste time to simply include the idea of polymorphism into their design just for the sake of doing that.

      And you've clearly seen some real screw-ups pretend they know what's up and convince others they do by throwing around OO concepts where they don't belong... but it's caused you to have perhaps an overly negative outlook on OO? I actually have seen at least one business application design where polymophism was useful- there were several types of data objects, but the container objects didn't care what they held so much. Polymorphism just meant that all the data objects could have one standard set of API, plus others if it needed. It was a business application, and the concept was useful. It's not always so. But there are cases.

      Over time it became apparent to me that OO is in fact a fad. I am not saying that the whole concept does not have value, I am saying it is more about buz-words and marketting than it is about actually solving the problems at hand.

      Perhaps you really mean that OO is overhyped and poorly understood, rather than "a fad", which implies a trend of limited lifespan? Saying something is a fad is to imply it has no lasting value or usefulness.

      See, I completely agree that not all problems require OO design. Class diagrams of some systems end up being so simple that they don't help much. Time is often wasted thinking about them that way.

      Here is some Java. I see this: Math.abs() - as abomination.

      However, Math.abs() and static class methods in general are not so much an abomination as an indication that part of your argument is absolutely correct- not all problems require OO treatment. I mean, where else would you put an "abs" function besides in a static "Math" class ? You'd rather just say abs() ? Then don't pick Java, pick something that's a superset of C, like C++ or Objective-C... but really, it boils down to the same thing ( you have to import math.h and can't reuse the symbol ), so where's the abomination ? I don't see the problem. Except maybe having to type 5 characters more than you might like in the case of Math.*, but hey, I type way faster than I think again, no problem.

      I coded in Java for too long now and I don't see it as an OO language any more. No, scratch that, I don't see that people use it that way.

      Yea, many people don't use Java as an OO language, that's often because they're crap coders who, as you say, can't design a system. Or, it's because they learned Pascal and Basic and maybe C and never wrapped their heads around what objects are really about. And, sometimes, it's simply because the solution to the problem at hand doesn't involve much by the way of OO design.

      So many projects that I worked on and that I see going on around are simply this: take input, transform, validate, store, produce output. Sure in all those projects the requirement is OO design. Does this mean that OO design is actually happening? Partially. Does this mean that it is good to follow some design principles? Absolutely. Does OO really matter? Absolutely not.

      So you can say, at the end of the day, OO does not matter. Good design and ( where reasonable ) code resuse are what matter. I'll agree that if you can get good design and code resuse without OO design or tools, then in that case, sure, OO didn't matter.

      Considering OO when designing does, however, in the long run, in many cases, promote better designs, IMHO, which is the one conclusion from all of this that I believe you and I differ on... sure *you* can design a good system without looking at it from an OO point of view, but that's just because you've been at it for a while, it's likely you've implemented *something* like the current problem in the past, and

  50. your code should read like a novel by Simonetta · · Score: 5, Funny

    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.

    1. Re:your code should read like a novel by Zen+Punk · · Score: 1

      Oh, had I mod points, this would be an instant +5. Okay, maybe +4...Lindsey Lohan? Why, man, why?

      --
      Sleep is futile.
    2. Re:your code should read like a novel by lemonylimey · · Score: 2, Insightful

      Lindsey Lohan? Why, man, why?

      Baps.

    3. Re:your code should read like a novel by Anonymous Coward · · Score: 1, Funny

      Just use COBOL and this will happen automatically.

    4. Re:your code should read like a novel by Anonymous Coward · · Score: 0

      Why not write intelligent structured sentences describing what each line does? It'll be a lot easier to follow than rambling dictation, and won't take you much (if any)longer to produce.

    5. Re:your code should read like a novel by Simonetta · · Score: 1

      Why not write intelligent structured sentences describing what each line does?

      Of course, I would recommend structured sentences over rambling discourse. But that's an optimal condition; an 'in a perfect universe' condition. And it takes lots of discipline. Under time and management pressures, extended documentation of the source is the usually the first area to be expended on a death-march coding project.

      The time used to make a sloppy speech-to-text code documentation piece that would be actually part of the code would be far less than the time spent tring to re-learn how a poorly-documented code works, especially a year after it is written.

      The speech-to-text approach is an intermediate step to adequate documentation that seemed like an experiment in using new advanced technology in a new application.

    6. Re:your code should read like a novel by ComaVN · · Score: 2, Insightful

      "Oh, and here we take a local variable, which for brevity we called 'i', and let it iterate over a range from zero to the length of the array minus one (note that array indexes are zero-based here, so the last valid index is length minus one"

      Yeah, I can see how that would help. :(

      Don't comment lines that don't need explaining. Comment the functions they are in, what it does, under what circumstances, and why.

      --
      Be wary of any facts that confirm your opinion.
    7. Re:your code should read like a novel by Cederic · · Score: 1, Troll


      Or just write simple code that doesn't need a novel to explain it.

      Money balance = startBalance + salary - mortgage;

      Tell me precisely wtf I need to comment on that line of code?

      ~Cederic

    8. Re:your code should read like a novel by Simonetta · · Score: 0

      Your example refers to a description of how a particular programming language works.

      My allegorical example would be if one engineer received a 20 page block of code from another engineer who wrote it and asked for a brief description of what it did and how it worked.

      Having this description actually included in the at the expense of the time taken to merely speak it would significantly improve the ability of someone else to quickly understand the code in the future.

      Talk is cheap. Having a powerful tool that can take talk and turn it into written text gives an incredible advantage to the people who are willing to explore the potential and opportunities opened up by this new tool.

      The comments would of course be in a different color text from the code. Which is finally beginning to happen with code editors.

      If diagrams and spoken explanations are so important to code documentation, then how come we don't have compiliers that can handle diagrams and MP3 clips as part of the source code file?
      Programmers have to get away 1950s frame-of-references in their tool sets. It's a new century.

      Imagine a parallel programming cluster of 10000 microprocessors with each processor having its own memory and gigabit ethernet connection. Imagine each of these processors running a complex but fixed routine very quickly.
      Imagine each of these 10000 processors was represented by Chinese character. The programmer would organize the parallel activity of this supercluster by arranging and writing Chinese characters on a monitor.
      Could you get a job programming in this kind of environment? Tens of thousands of people in China could. Chinese programmers are routinely expected to master 10000 characters (and combinations) to be literate, then they're expected to master 10000 english words and grammar constuctions, and master complex programming languages.
      Americans complain about having to master dribble like C++.

    9. Re:your code should read like a novel by HotshotXV · · Score: 1

      What fun would that be?

    10. Re:your code should read like a novel by Anonymous Coward · · Score: 2, Interesting

      How about why you're doing it? Are you calculating a temporary balance, a projected balance, the latest balance? Admittedly, I haven't got the rest of the code for context but, clear as your example is, it doesn't tell me anything about whether I should or shouldn't think about refactoring it.

      The main point to remember is that comments are not there to describe what code does for non-coders. It's there to describe why you did it (to aid maintenance) and to reduce the brain lag of trying to follow what amounts to a foreign language (code). Admittedly, in your example it's likely that the comment might be limited to //Calculate balance, but even that can cut maintenance time dramatically if I'm trying to scan a 10000 line file to work out where the balance is calculated.

      (That said, if I wanted a novel, I'd read Stevenson. Keep it simple)

    11. Re:your code should read like a novel by Ed+Avis · · Score: 3, Insightful

      Yes, your code should read like a novel or at least like a well-written newspaper article or technical paper.

      However, it should read like that _without_ comments! If you need to add long comments to make the code clear then fix the code first. In general, it is better to say something in code than in comments, for example 'const int x' is better than 'int x' plus a comment saying 'x will not be changed'. Well-chosen variable and subroutine names are also important. Finally arrange things in a sensible order: when writing you can either lay out the simple concepts first and use them to build up more complex things (like writing a mathematical proof) or you can start with a broad overview and then fill in the details. Either of these two styles may be appropriate depending on what your program does.

      Remember: comment _how_ and _why_, not _what_.

      --
      -- Ed Avis ed@membled.com
    12. Re:your code should read like a novel by Subjective · · Score: 1

      Seriously?

      If I write code like that, which will probably have lots of redundant comments (things most programmers will pick up without having to read them), will other programmers bother to read the drivel? I'm talkin about the Open Source model here.

      In some way this sounds like a great idea, but I'm kind of worried contributors would shy away from code like that. My regular english narrative is quite boring...

      (BTW, I accidentaly sent a message saying only 'Seriously...'. Double-enter posts the message, I guess. using FireFox)

      --
      My other .sig is also this bad
    13. Re:your code should read like a novel by Anonymous Coward · · Score: 0

      Lindsey Lohan? Why, man, why?

      Is this the answer you're looking for?

    14. Re:your code should read like a novel by Anonymous Coward · · Score: 0

      Wow ... just how much dope did you consume in the 70's?

    15. Re:your code should read like a novel by jallen02 · · Score: 1

      There is no need to comment each and every line of code. I believe in commenting that gives a "big picture" overview of blocks of code. Commenting every line is redundant if you know whats happening in a 20 line block. So, you may not need to comment THAT line. But you should at least comment somewhere above that block describing what is going to happen. And in using concise and easy to understand variable naming the block should be quite easy to understand given the context provided by the big picture comment.

      Jeremy

    16. Re:your code should read like a novel by Erik+Hollensbe · · Score: 4, Insightful

      Your assertion is too absolute.

      Sometimes, especially in the real world, commenting what is just as important.

      In the real world, a comment like this: // writing pseudo-pascal sucks

      Is common - in class, it got me a D when the rest of the code was well commented and the code well-formed. It was in direct protest to the assignment I was given. In reality, my fellow coders would probably agree with me.

      However, that's not my point. I've written blocks of code that were hard for me to understand after I put them away for a month, not because of poorly named variables or functions, but because they made use of side-effects. A great example of this is optimization. Optimization in many cases has the deliberate effect of making your code harder to read for a number of reasons.

      Duff's device is a great example of an optimization that, without explanation of what, you certainly won't get how or why.

      Well chosen names only go so far. I've worked on code that used sentences for the names of some of it's DB calls. And one could say that OCI has well-chosen names, but only the bravest database programmers tackle that mess.

    17. Re:your code should read like a novel by Anonymous Coward · · Score: 0

      This is a joke. Why was this modded up as insightful instead of funny?

      All we need is people who take every single line and write a fucking paragraph of comments each time... great.

      Over-commenting is just as bad as not commenting. Summarize your code. If your code is written properly, it should also be able to explain itself.

    18. Re:your code should read like a novel by Cederic · · Score: 1

      ...
      Money tax = calculateSalesTax(order); ...

      The sales tax calculation may be a 20 line block of code. I don't need a novel describing it to me - the method name is pretty comprehensive all by itself.

      I agree it may be useful to have some method documentation though - what is the parameter, what will be returned, are there any error conditions (in which case when will they occur and how will they be reported), etc.

      What I don't want is all that documentation preventing readability of the code. The line of code above is simple, concise and can be interpreted by a non-programmer. If all code is written in such a manner then it makes grokking an entire system far simpler, and thus reduces the need for extensive documentation.

      I'd far rather have easy to read code than excessive reams of developer ramblings describing it.

      ~Cederic

    19. Re:your code should read like a novel by pdbogen · · Score: 1

      So, wait... Did you overload the '+' operator here to do something else? For I know, without my mortgage, I always end up with less money.. And I'm pretty sure my pay is positive.

    20. Re:your code should read like a novel by Cederic · · Score: 1


      I kinda skipped a couple of lines of code

      balance -= getNewComputer().getCost();
      balance -= girlfriend.expenses();
      balance -= carLoan;
      balance -= etc;

    21. Re:your code should read like a novel by jrod2027 · · Score: 1

      I obfuscate my code you insensitive clod!

    22. Re:your code should read like a novel by Anonymous Coward · · Score: 0

      Comment out the second line. You shouldn't need it.

    23. Re:your code should read like a novel by cdrudge · · Score: 1

      You apparently never had any any of my profs in college. It wasn't unusual for my simple programs to triple in length after all the "necessary required documentation" was added.

      "Oh, you never wrote a paragraph to described why you chose i to be a variable to increment in this loop. -1 point."

    24. Re:your code should read like a novel by |<amikaze · · Score: 1

      Americans complain about having to master dribble like C++.

      Do you mean drivel?

    25. Re:your code should read like a novel by jallen02 · · Score: 1

      Doh ;-\

      I try and create practical rules that my development team will actually follow. Asking for thought in variable names with a few lines of comments every "block" of code gets followed well. Combined with JavaDocs it creates a damn near self documenting system.

      If you asked for more than that A.) The comments are more likely to be misleading (which is worse than no comment). and B.) Won't get done anyway.

      Note: I define a "block" of code as anything you could basically describe in 4-6 english language sentences. Any line of code that does something hack-ish or does something with non obvious effects also gets a comment, that is about it. It works well. No one I have seen has to much trouble following code commented in this manner :)

      Jeremy

    26. Re:your code should read like a novel by Overt+Coward · · Score: 1
      As a development manager, I genrally only require detailed comments for the entire function, unless there is a particular block that is tricky or non-intuitive. Using good (i.e., self-documenting) variable and function names also helps.

      If your functions are too large to be properly documented as a whole, then you most likely need to break them up into smaller functions.

    27. Re:your code should read like a novel by Anonymous Coward · · Score: 0

      Actually I've thought for a long time that it should be possible to embed voice into source files. Imagine a little icon in the code that you could click and just hear the author say "okay here I'm doing this and this". No reason to limit it to voice for that matter. I should be able to embed diagrams and any other multimedia right into the source file a la OLE.

      Personally I tend to write big block comments describing the "big picture" and for anything tricky as in "This next bit of code bamboozles the thingamabob, but be very careful about the order in which x and y happen because of a possible race condition with another thread blah blah".

    28. Re:your code should read like a novel by Anonymous Coward · · Score: 0
      Tens of thousands of people in China could. Chinese programmers are routinely expected to master 10000 characters (and combinations) to be literate


      This is false. 1800 characters is the standard for literacy in China. How do I know? I studied Mandarin in college. I knew 1800 characters and was able to translate a Chinese newspaper.

      Reference for you doubters out there:

      1800 characters is about 96% of all written chinese.
    29. Re:your code should read like a novel by Fulcrum+of+Evil · · Score: 1

      Could you get a job programming in this kind of environment? Tens of thousands of people in China could. Chinese programmers are routinely expected to master 10000 characters (and combinations) to be literate, then they're expected to master 10000 english words and grammar constuctions, and master complex programming languages.

      Judging from the code I've had to maintain that was originally written by a chinese guy, there aren't that many people who could do what you say. Who would want to anyway? It's not like anybody could handle a program composed of 10,000 independent pieces.

      Americans complain about having to master dribble like C++.

      Well, yeah. C++ is a lot harder to master than something simple like Chinese (simple grammar, lots of characters). After all, if you screw up a sentence in Chinese, the other guy giggles and life goes on. Good luck getting something like that past a compiler.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    30. Re:your code should read like a novel by charleste · · Score: 1

      Having taught programming to dotcom boom-i wanna highpaying job-history majors-now i wanna MSCS people with no math beyond Math 0100, I *wish* they would have stuck to your straightforward commenting methodology. At least. Actually, SOME commenting would be better than none. I often had to not only threaten, but actually fail programs because they did not comment at all. Just trying to get them in the practice.

    31. Re:your code should read like a novel by trg83 · · Score: 1

      You wrote: If diagrams and spoken explanations are so important to code documentation, then how come we don't have compiliers that can handle diagrams and MP3 clips as part of the source code file? I observed: I haven't thought too hard about this issue, but I can't see why you couldn't just embed encoded binary data between /* and */ or similar comment symbols and write a programming editor to display them. Compilers just ignore comments anyway, so I would expect it to handle this data in the same way.

    32. Re:your code should read like a novel by DrEasy · · Score: 1
      I can't see why you couldn't just embed encoded binary data between /* and */
      ...or links! I really like the grandparent's idea, but you should go even further: why turn the recording into text? Just cut it into small MP3, and make links to them within your comments. The code editor would just need to handle links properly - for example it would play back the MP3 when you hover your mouse on it.
      --
      "In our tactical decisions, we are operating contrary to our strategic interest."
    33. Re:your code should read like a novel by Mr+Z · · Score: 1

      There are precisely two places I'll comment every line, and it's for the same reason: Assembly code, and tricky high-level language code. Otherwise, I stick to the occasional one-liner if something's non-obvious, or blocks of "big picture" / "middle picture" comments.

      Here's an example of how I code. It's not the most refined example, but it illustrates a range of tricky and non-tricky code. (This file actually could use some more per-line comments in the blitter.)

      Here's an example of how I assembly code. I use a combination of block comments to say what the next block does, and line-by-line comments to give the blow-by-blow.

    34. Re:your code should read like a novel by Wybaar · · Score: 1

      Yes, there are some lines that may not need comments. However, if your comments are simply the code described in English, they don't necessarily add value. Rather than adding a comment like the one you described, I think a comment like "Loop over the elements of the array and ..." would be more appropriate. Now for some blocks of code, identifying exactly why you chose to implement it the way you did has value, especially when it's not obvious or when it may not be obvious when you go back to your code 6 months from now.

      I've seen some pieces of well-commented code in programming languages I can't write or can't write well that I was able to understand and troubleshoot just from what the comments were describing about what the algorithm was doing.

      It's a lot easier to remove a redundant comment a few months down the line than to go back and add a comment at that time, when you may scratch your head and say "Now why did I do that?"

      --
      Y|
    35. Re:your code should read like a novel by Anonymous Coward · · Score: 1, Funny

      You need to comment on how the heck you have two variables on the left side of the =.

      most likely you're using a custom language, which will be unfamiliar to the reader, and therefore will require a novel to explain it!

    36. Re:your code should read like a novel by agent · · Score: 1

      Micro$oft = "Cheat with your assignment"

      "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."

      Wrong!
      http://linuxdevices.com/

      Know your roots.
      http://www.gnu.org/
      http://www.linode.com/products/

      Please support the FreeNet Project, and this is why your should!
      http://news.com.com/Digital+Agenda+Homeland+securi ty--A+global+assault+on+anonymity/2009-1009-540594 7.html

      http://news.netcraft.com/

      I am doing so well, because I am standing on the shoulders of great women and men.
      Work smart, and have fun,
      -Steve

    37. Re:your code should read like a novel by CmdrGravy · · Score: 1

      Even comments like "Loop over the elements of the array" are pointless. If whoever is reading it can't see that immediately then pretty much any explanation isn't going to help them.

      What is important is to say why you are looping over the elements of the array, how does that fit into the bigger picture, which I think is what you are saying at the end of your comment as well.

    38. Re:your code should read like a novel by Floody · · Score: 1

      Why do you need to even state "loop over the elements of the array"? If I can read the language, details like iteration and looping are quite obvious.

      To me, there's nothing more annoying than code filled with obvious comments. Don't tell me what the code is doing, the code does that by itself. Instead, the art of commenting should be about why the code is doing what it does and how it does it.

    39. Re:your code should read like a novel by aminorex · · Score: 1

      Depends on how much you like C++.

      --
      -I like my women like I like my tea: green-
    40. Re:your code should read like a novel by Floody · · Score: 1

      You're talking about deviations from the norm. An assertion regarding general principles of code commenting is just that .. a generality.

      There are always exceptions, and I agree with you, they should be documented appropriately.

    41. Re:your code should read like a novel by cosmo7 · · Score: 1

      Asking for thought in variable names...

      SPIRO_MEGAMAX_3000!

    42. Re:your code should read like a novel by johnnyb · · Score: 1

      The problem is that real code gets messy. Especially if you have to code a bizzare state machine for handling data from a separate program. Some edge cases may be way too subtle to notice from the code.

      There's been many cases where I've needed to document simple code with long explanations, simply because there are so many ways that seem right which are really wrong. Especially when you do something that doesn't seem optimal, because the optimal solution has subtle problems that aren't obvious.

      Often times, without enough documentation, future programmers will try to "fix" what appear to be errors or suboptimal designs in your code, which are really there to take care of unusual code-paths.

    43. Re:your code should read like a novel by Frizzle+Fry · · Score: 1

      This is a joke. Why was this modded up as insightful instead of funny?

      Humor can be used to provide insight. It doesn't have to be mindless wordplay and the like. The fact that people don't understand this is rather sad.
      --
      I'd rather be lucky than good.
    44. Re:your code should read like a novel by Anonymous Coward · · Score: 0

      BS.. the more comments the better. If the comments bug you, you can always change your font color for comments to something invisible or use a tool to hide them. But I've recently spent some time trying to decipher a 600 000 line program ...and I sure wish for comments.

      I understand code as good as the next guy.. but rather than wasting my time tring to glean the general architecture, comments would save me time.
      Time is money.. comments help you read code.

      Be professional.. use comments.. lots of them.

    45. Re:your code should read like a novel by Ed+Avis · · Score: 1

      Agreed, when you need to optimize code and it becomes less obvious, comments are necessary. Maybe the rule is 'keep it simple, but if you can't keep it simple at least comment it'.

      --
      -- Ed Avis ed@membled.com
  51. Re:i thought it was going to be something serious. by Anonymous Coward · · Score: 0

    WOW U R SMART MISTER MAN

  52. Some F/OSS develpers need to read this. by Yaztromo · · Score: 3, Interesting

    Or, perhaps not read this...

    Okay, I know that there are a lot of professional developers out there who follow some of the "rules" in the article, especially those involving ignoring warnings. I've been in professional programming environments, and I've seen this sort of thing excused all too often (personally, my code isn't done until it compiles 100% cleanly). However, for good or bad, this is typically hidden in closed-source projects -- how many compilation warnings does Microsoft get in its nightly Windows builds? I have no idea.

    Unfortunately, in Open Source Software everyone gets to see where the developers ignore warnings, and IMO there isn't much excuse for it. Honestly, there are far too many Open Source projects which seem to do the things this article "advocates". And everyone gets to see it.

    I remember all of the warning messages I get when building the Linux 2.4 series kernels. And I recently looked into forking the recently cancelled JPluck, but its near complete lack of code commenting makes the effort exceedingly difficult.

    This has long bothered me. If you're going to release your code as Open Source so others can work with it, it should at least have some comments in it (even just simple things like the expected input.output values for procedures, functions, or methods, expected use for variables/fields, etc.), and it should generally build without a single warning [1], in order to make it easier for others to work with the code, and to ensure them that there aren't going to be any unexpected results due to ignored warnings.

    Yaz.

    ------------

    [1] Okay, I know someone is going to call me a hipocrite when they go and grab the sources for the Open Source project I administer (the jSyncManager), build it, and find well over 100 warnings. I just want to preempt this by stating that these deprecation warnings occur because I've specified parts of the jSyncManager API to be deprecated to ensure developers currently using these deprecated classes move their code over to their replacements.

    1. Re:Some F/OSS develpers need to read this. by Anonymous Coward · · Score: 1

      There are quite a few warnings that are completely ignorable. Frequently getting rid of them requires disabling the warning entirely, as opposed to changing the code. Sorry, but I'd rather have the warning show up for the 1 time it is important.

    2. Re:Some F/OSS develpers need to read this. by Anonymous Coward · · Score: 0

      >> (personally, my code isn't done until it compiles 100% cleanly)

      Personally my code isn't done until it compiles cleanly and passes all it's tests. Until then it's just a step towards the solution.

    3. Re:Some F/OSS develpers need to read this. by BillyBlaze · · Score: 1

      I'd genuinely like to see an example of this.

  53. google cache... by Anonymous Coward · · Score: 0

    here Still takes forever to load though.

  54. While we are on the subject by nwbvt · · Score: 4, Funny
    This has probably been posted on /. before (in fact I probably origionally found it here), but I can't resist posting this site:

    http://mindprod.com/unmain.html/

    My favorite:

    (On naming) # Bedazzling Names : Choose variable names with irrelevant emotional connotation. e.g.:
    marypoppins = ( superman + starship ) / god;

    This confuses the reader because they have difficulty disassociating the emotional connotations of the words from the logic they're trying to think about.
    --
    Mathematics is made of 50 percent formulas, 50 percent proofs, and 50 percent imagination.
    1. Re:While we are on the subject by Anonymous Coward · · Score: 1, Funny

      I love that essay. Unfortunately almost all of the habbits described apply to the program I was hired to maintain...

    2. Re:While we are on the subject by Anonymous Coward · · Score: 0

      Heh. An atheist would take one look at that and warn you you were dividing by zero ;-).

  55. Re:Compiler Warnings by Anonymous Coward · · Score: 0

    LINT, on the other hand, needs to die.

  56. this is you by 888+Geek+Help · · Score: 1

    meet yourself
    1. Estados Unidos 3542 74.2 %
    2. Canadá 344 7.2 %
    3. Australia 334 7.0 %
    4. Reino Unido 82 1.7 %
    5. Nueva Zelanda 67 1.4 %
    6. Japón 37 0.8 %
    7. India 37 0.8 %
    8. Alemania 34 0.7 %
    9. Finlandia 33 0.7 %
    10. Suecia 18 0.4 %
    Desconocido 52 1.1 %
    El resto 191 4.0 %

    I can't seem to figure out what "El resto" means

    --
    -888 Geek Help (888-433-5435)
    1. Re:this is you by Ryan+Huddleston · · Score: 1

      Spanish 100:

      El/La means "the".

      When converting to English, chop off the trailing vowel for a word, and, if necessary, interperet it loosely.

      Using these two steps, we get:
      "the rest"

    2. Re:This is you by sik0fewl · · Score: 1

      I can't seem to figure out what "El resto" means though

      Not sure if you were joking but I would guess it means "the rest"/other

      --
      I remember when legal used to mean lawful, now it means some kind of loophole. - Leo Kessler
    3. Re:this is you by Anonymous Coward · · Score: 0

      You have a lot of luck if can understand spanish that way, this only works on a few cases, for example:

      - El perro > the perr > the dog
      - El tenedor > the tenedor or the tened > the fork
      - El coche > the coch > the car
      - La casa > the cas > the house
      - El pan > the pan > the bread
      - La red > the red > the web

      In the next course we will introduce how to get understand in other languages only talking louder and slower.

    4. Re:This is you by 888+Geek+Help · · Score: 1

      "el resto" means "the rest" holy god...That's incredible. Hey, if you speak Spanish, I've always wondered what "taco" means...

      http://www.lyricsfreak.com/r/randy-travis/114204.h tml

      --
      -888 Geek Help (888-433-5435)
    5. Re:This is you by 888+Geek+Help · · Score: 1

      i lack enought "?" and "!" in that last post so here they are
      "el resto" means "the rest" ???!!?? holy god...That's incredible

      --
      -888 Geek Help (888-433-5435)
    6. Re:This is you by sik0fewl · · Score: 1

      Well, according to babelfish, it means "I mark"

      --
      I remember when legal used to mean lawful, now it means some kind of loophole. - Leo Kessler
    7. Re:This is you by 888+Geek+Help · · Score: 1


      ok, this isn't funny anymore. I speak Spanish. I have spent years and years in Spanish speaking countries.

      taco means taco like pizza means pizza
      http://www.spanishdict.com/AS.cfm?e=pizza

      I'm sorry to have wasted your time but, really, don't you think it's *funny* that you had some compelling need to inform someone what "el resto" means??
      what the hell else would it mean..?

      --
      -888 Geek Help (888-433-5435)
  57. Browsers and OSes by boomgopher · · Score: 1

    More interesting still are the Browsers used and OSes by the Slashdot crowd.
    Hey, Firefox is doing pretty well around here. Still surprised at all the IE6s though.

    --
    Your hybrid is not saving the environment. Its purpose is to make you feel good about buying something.
    1. Re:Browsers and OSes by lpangelrob2 · · Score: 1
      I find this information interesting, so I'll post my to-date stats... no %'s automatically generated though

      homepage:
      IE to Mozilla ratio 18 to 10
      Windows to Macs 4 to 1

      wedding website:
      IE to Mozilla to Safari 38 to 10 to 1 (x1000)
      Windows to Macs to Linux 9 to 1 to .8

      youth group:
      IE to Mozilla to Safari 17 to 9.5 to .025
      Windows to Macs to Linux 10 to 1 to .005

      Conclusion? Mozilla has come a long way (even if the stats are skewed -- Mozilla was leading when I was the only one that knew about the sites :))

  58. Re:Advice from a fellow student by b17bmbr · · Score: 1

    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.

    No, they'll just call it WindowsXP Serice Pack 2

    --
    My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
  59. Another Tip by suwain_2 · · Score: 4, Funny

    Use clear, meaningful, variable names.

    I was playing with obfuscated Perl code, and got about 300 lines out. It was a script to go through my gaim 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.

    --
    ________________________________________________
    suwain_2 :: quality slashdot p
    1. Re:Another Tip by RaguMS · · Score: 1

      Also be careful using $foghat as it could really ruin your day.

    2. Re:Another Tip by Anonymous Coward · · Score: 0

      Use meaningful file names too. If you have a couple of dozen Perl scripts for analyzing stuff don't name them anal1.pl, anal2.pl, etc.

      It can be embarassing when the boss asks.

    3. Re:Another Tip by gomel · · Score: 1

      I don't want to be a smartass, but using read/write flags would have prevented trouble.

      use Fcntl;
      sysopen(SOURCE, $path, O_RDONLY)
      or die "Couldn't open $path for reading: $!\n";
      sysopen(SINK, $path2, O_WRONLY)
      or die "Couldn't open $path2 for writing: $!\n";

      --
      Fight Frist Psoting!
      Browse Slashdot with 'Newest First'!
  60. What to do an not to do in CS by nate+nice · · Score: 5, Insightful

    Do not slack at your math. You will repeat it. It often takes time. It is very important. Learn to utilize math and make it one of your more powerful tools.

    Do not cheat on code assignments. Once again, it may take time but you need it. Messing up and looking through code more than writing it is what really makes you good.

    Take hard CS classes. Take advantage of rare courses your school may offer in CS. Take tough classes like compilers or computational geometry. Make sure you take some diverse classes but also try and focus on something a bit that you enjoy.

    Take more math. This is a skill that can really differentiate you from other programmers in the industry, If you have good math skills, you can get good paying, secure jobs in fields like computer graphics, physics, medical and other science fields that demand proficient math skills. It will also change the way you think if you really take it seriously and understand that much of the early math is indeed lame, but necessary to understand useful math that you will eventually learn.

    Take other classes, like art. You can learn a lot from these things and apply them to what you are doing. Knowing about various things will come in handy at some point.

    Learn more than what your school will teach you. It is up to you to read about things in the field, both theory and practical. Learn languages not needed in your school. Play around with things. Put together a cheap Linux computer at home and play around in it if you haven't already. You are interested in this anyways, so this shouldn't be something you have to do.

    Maybe CS is not for you. The future is not guaranteed in this field as far as job security is concerned. You may spend a lot of time taking hard classes only to have to end up doing something else. You may not even make it through the program. Personally, I think there will always be a need for well educated, creative, smart people. The analytic skills you can learn will do more for you than anything else. Pay attention.

    If you love it and are good at it and really spend the time in school to really learn this art, you could enjoy a career working in an industry you love. If you are ambitious, there will be many trails to be blazed in the future in this young, ever changing field. It's not about "computers". It's about computation, a modern subset of math that we can abstract in electronics. The possibilities are endless and you may invent the next big thing.

    --
    "If you are a dreamer, a wisher, a liar, A hope-er, a pray-er, a magic bean buyer ..."
    1. Re:What to do an not to do in CS by Anonymous Coward · · Score: 0

      This comment is inspiring.

    2. Re:What to do an not to do in CS by tootlemonde · · Score: 2, Insightful

      Do not cheat on code assignments.

      In the working world, it's ok to cheat, even desireable. You use existing libraries and modules and avoid re-inventing the wheel even when you think you can invent a better wheel. You can usually learn more from reading the code of a master than you can from figuring it out yourself. Time is money and scalping code saves time.

      Cheating in the sense of using someone else's code without understanding it is the basis of higher-level languages. Most people use the print statement without knowing how it works and don't feel guilty. In professional programming, one of the hardest things to decide is when to cheat and when not to.

      Knowing about various things will come in handy at some point.

      They probably won't but as you get older you find that you derive the most enjoyment from the useless information you have. The pleasures of useless information are so great that you constantly have to make a difficult choice between learning things that are useful and learning things that aren't.

      The possibilities are endless and you may invent the next big thing.

      More realistically, you'll be lucky if you even get hired to work on the next big thing. The trick is to take every project and make it into a Big Thing. After you retire, your colleagues should say, "The guy that used to sit over there, he was one hell of a programmer."

    3. Re:What to do an not to do in CS by darkstar949 · · Score: 1

      Do not slack at your math. You will repeat it. It often takes time. It is very important. Learn to utilize math and make it one of your more powerful tools.

      Very true indeed, but likely to be one that you don't notice right away; but when you do you will hunting for your old calculus text book. So I would like to take something onto that: If you ever want to write any sort of graphics engines take more math then your school requires for your degree.

  61. Re:OMG- for once, don't RTFA! by xtermin8 · · Score: 1

    For once I think someone shouldn't have read the article! You should have just read the post. Perhaps your point is that ignoring messages is a mistake made all too often in the real world, and not just a common CS student blunder. They way this post was phrased though, it sounds like you just didn't get the humor.

  62. Re:Advice from a fellow student by f00zy · · Score: 1

    I disagree. Coding under the influence will NOT get you arrested and sometimes the results are pretty funny.

  63. Real programmers don't comment... by LoadWB · · Score: 1

    if it was difficult to write, it should be difficult to undestand.

    (I wish I could remember where I read that!)

    Oh, and write lots of swear words in your closed source. That way if it's ever leaked people can say how unprofessional you are.

    1. Re:Real programmers don't comment... by endx7 · · Score: 1

      if it was difficult to write, it should be difficult to undestand.

      (I wish I could remember where I read that!)


      fortune?

      as in...fortune the program that spits out silly quotes. :P

    2. Re:Real programmers don't comment... by johannesg · · Score: 1

      That would be here.

  64. Re:Advice from a fellow student by Mmmrky · · Score: 4, Funny

    I don't know, I've had some lengthy coding sessions inspired by alcohol. Usually wake up in the morning, stare at the code, realize it works, wonder how that is even possible, rename some stuff for clarity and redo the comments (drunk comments can be amusing, but not the kind of stuff you want to turn in).

  65. Re:Advice from a fellow student by DLR · · Score: 1
    So you didn't generously insert comments into your code while "under the influence"? Hmmmm....

    In Soviet Russia comments insert you into the code.

    --
    "Like fire and fusion, government is a dangerous servant and a terrible master."~RAH
  66. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    I agree with this. Trust me, I managed to code for about 6-8hrs straight after a bottle of Shiner....course this wasn't school assigned work, it was a project I was working on. Curious? Visit http://motd.4d2.org/TJ/ I was the "supporting programmer". :P

  67. some hitwomen would try to distrUct them by Anonymous Coward · · Score: 0

    afterwards, the hitwomen declare, "All your base belong to us!"

    1. Re:some hitwomen would try to distrUct them by Anonymous Coward · · Score: 0

      If I remember correctly what Halle Berry was doing, the correct phrase would be "All your base pairs belong to us".

  68. Re:OMG- for once, don't RTFA! by Compholio · · Score: 1

    Sorry, I can't seem to find my funny bone. Yes, the point is that the mistake is a common real world blunder that causes serious problems and it's not confined to those learning the trade.

  69. This is you by 888+Geek+Help · · Score: 1

    meet yourself
    1. Estados Unidos 4828 72.3 %
    2. Australia 503 7.5 %
    3. Canadá 490 7.3 %
    4. Nueva Zelanda 98 1.5 %
    5. Reino Unido 92 1.4 %
    6. Finlandia 64 1.0 %
    7. India 62 0.9 %
    8. Alemania 54 0.8 %
    9. Japón 54 0.8 %
    10. Suecia 43 0.6 %
    Desconocido 65 1.0 %
    El resto 325 4.9 %

    I can't seem to figure out what "El resto" means though

    --
    -888 Geek Help (888-433-5435)
  70. Re-use is ok after you graduate ... by AHumbleOpinion · · Score: 2, Insightful

    Re-use is ok after you graduate so the professors are OK, copyright assumed not to be an issue. While you are learning you need to do things yourself.

  71. y'all talk big by 888+Geek+Help · · Score: 1

    but 50% of /.ers use window$

    --
    -888 Geek Help (888-433-5435)
  72. My favourite by smallpaul · · Score: 3, Insightful

    When I was in university I would spend 90% of the time putting together a "framework" to solve the actual problem (much more general and thus useful for future classe). Then I would spend 7% of the time debugging it. Then I would spend the remaining 3% desperately trying to figure out how to use the framework to solve the assigned problem.

  73. Funny incident by Anonymous Coward · · Score: 1, Funny

    There was one very funny incident in my school, a long time ago. This student copied the code from this other geek. Unfortunately the original writer put his name all over the place, like (c) Bill Gates, etc. So, the student had to do a manual find and replace (because he didn't know how to work vi either).

    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.

    1. Re:Funny incident by Andrewkov · · Score: 1

      Did the program crash and have security wholes?

  74. Not good advise by ValiantSoul · · Score: 0, Offtopic

    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?

    Was this written by someone at Microsoft? What a waste of time

  75. Re:i thought it was going to be something serious. by Christopher+Thomas · · Score: 2, Insightful

    I was hoping for something educational and instead I found a collection of jokes that I don't find very amusing.

    This is intended to be educational. Rather, it is intended (at least in part) to be yet another thing to point first-year (and later!) students to, in the hopes that they decide to absorb it for a change. Give the advice in enough forms, and maybe one of them will take.

    That, and it reads a bit like it was written to vent frustration. I know I can sympathize with a lot of what was expressed there (I've had to TA programming courses many times).

  76. Useless and not very entertaining by gavanw · · Score: 0, Troll

    This article is a load of bullshit. If it is trying to be serious (which i'm almost certain it is not) then it could not be farther from the truth. If it is trying to be comedic, it isn't really very funny...How does this crap make the front page of Slash Dot?

    1. Re:Useless and not very entertaining by Anonymous Coward · · Score: 0

      -1, "Whoosh"

  77. MOD PARENT UP EVEN MORE! Re:Bad Joke by Anonymous Coward · · Score: 0

    Bad Joke (Score:3, Insightful)

    I kneel before your trolling abilities!

  78. Re:Compiler Warnings by Wocko · · Score: 2, Informative
    #pragma warning (disable : 4503 4786)

  79. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    Tell that to the programmers at microsoft

  80. Re:Advice from a fellow student by complete+loony · · Score: 1

    But then I'd never get any coding done....

    --
    09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
  81. Pseudoephedrine by Anonymous Coward · · Score: 1, Interesting

    The primary component of daytime sinus/cold medicine can create a mental state that is medically indistinguishable from mania. Any diagnosis of mania is automatically shelved for the time being if cold medicine might have been involved.

    That is to say, Sudafed makes you insane in the same way Lord Byron and Van Gogh were. Good for poetry and painting. Bad for coding.

  82. Re:Advice from a fellow student by Pseudonym · · Score: 1


    /* drunk.. fix later */

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  83. What would've been more helpful by xRelisH · · Score: 5, Interesting
    might be a list of common typoes and also weird compile errors that often scare newer programmers. Here's are a couple that I know of

    if( blah = true ){ // common single equal sign mistake
    }

    if( someclass->someMethod ){//I know of some compilers that do NOT give you a warning when you forget to put brackets in a function call.
    }

    As for compile errors, one that ususally scares newer programmers is making a mistake in a header file that in return causes a whole lot of other errors. This happens when you forget to put a ";" in a class definition in a header file, then in the source file, you include "someheader.h" and then include "" below it, I've noticed a lot of compilers spew out odd errors that can very confusing.
    Another common compile error deals with mismatched curly brackets, editors like vim will point this out, but I know some 2nd year students here in Computer Engineering that still want to use Notepad and refuse to try anything else.
    Anyone know of any others?
    1. Re:What would've been more helpful by Coneasfast · · Score: 1

      if( blah = true ){ // common single equal sign mistake

      i've ran into this many times, luckily, gcc puts out a warning suggesting to put parentheses around this.

      this way, you know that either you need 'if (blah == true)' or 'if ( (blah = true) )'

      --
      Marge, get me your address book, 4 beers, and my conversation hat.
    2. Re:What would've been more helpful by colinleroy · · Score: 2, Informative
      if( blah = true ){ // common single equal sign mistake Not so common in these days of modern compilers:
      $ javac test.java
      test.java:7: incompatible types
      found : int
      required: boolean
      if (i = 1)
      ^

      $ gcc -Wall test.c
      test.c: In function `main':
      test.c:6: warning: suggest parentheses around assignment used as truth value
      --
      blah
    3. Re:What would've been more helpful by Anonymous Coward · · Score: 2, Informative

      As for compile errors, one that ususally scares newer programmers is making a mistake in a header file that in return causes a whole lot of other errors. This happens when you forget to put a ";" in a class definition in a header file, then in the source file, you include "someheader.h" and then include "" below it, I've noticed a lot of compilers spew out odd errors that can very confusing.

      Here's something I've learned over the years:

      - Start compilation. Get a gigantic mass of wierd compiler errors.
      - Fix the first one and the first one only .
      - Restart compilation. Goto top of this list unless there are no more errors.

      Seriously, most errors are caused by the parser being off track after the first error. Don't sift through your entire error list trying to find the cause for each one. In most cases, it will be the first error.

      And for those who say "compilation takes far too long!": that's what make is for. And distcc.

    4. Re:What would've been more helpful by nmnilsson · · Score: 3, Informative
      ... and suggestions how to avoid those errors in the first place.

      E.g.
      if( blah = true ){ // common single equal sign mistake
      }
      could be rewritten
      if( true = blah ){ // the compiler won't let you do this
      }
      or simply
      if( blah ){ // if blah is used as a boolean flag
      }
      (I just finished reading "C Traps and Pitfalls". It contained many amusing errors, but it was very sparse on defensive coding advice.
      I wouldn't recommend the book. Read "Code Complete" instead, that's a gem!)
      --
      No sig to see here. Move along.
    5. Re:What would've been more helpful by ElDuderino44137 · · Score: 1

      Use a real language,

      Like .Net ...
      It doesn't let you have these errors ...
      Because it really is type safe.

      Note:
      New people should learn and understand what type safty is.

      At an interview:
      Don't claim that's some term you heard of in school and don't need anymore.

      Cheers,
      -- The Dude

    6. Re:What would've been more helpful by Cederic · · Score: 1


      In java,

      boolean gotcha = false;
      if (gotcha = true)
      { ...
      }

      This compiles fine; the assignation returns the type of the assignee, which as it's a boolean is acceptable for use in an if statement.

      ~Cederic

    7. Re:What would've been more helpful by kleinux · · Score: 1
      Even better in the origional would have been to use:
      if (blah) {
      // stuff
      }
      rather than put the == true part. It serves no purpose and clutteres up the code a bit. Assuming good naming convention on the variables then this will read nicely as well.
    8. Re:What would've been more helpful by RoloDMonkey · · Score: 1

      I remember this from helping my fellow students in my CS classes. 80 errors is a good thing. Just fix the first one, and the rest usually go away. Invariably it is a missing semicolon.

      One error is a problem, especially when it happens late in development, and it pops up in code you thought you had already vetted. That one is going to take much longer to fix than those 80 others.

      --
      Long live the Speaker Bracelet
      Rolo D. Monkey
    9. Re:What would've been more helpful by dsplat · · Score: 2, Insightful

      - Fix the first one and the first one only .

      Actually, I fix the first one and any similar errors that I know I committed elsewhere.

      A corollary to this is:

      "When your code compiles cleanly, it is ready for testing and debugging."

      --
      The net will not be what we demand, but what we make it. Build it well.
    10. Re:What would've been more helpful by Anonymous Coward · · Score: 0

      Yes, that would have been a much better example of the assignment versus comparison mistake.

  84. Re:Compiler Warnings by plover · · Score: 1
    Everyone who uses STL in Visual Studio 6.0 suffers from those long messages that you can't disable. (It's a compiler bug.) Anyway, we found a way around it. Create a file called "pragmaDisableInvalidWarnings.h" and stick this line in it:

    #pragma warning(disable:4786)

    rather than include the #pragma in-line in your .CPP. Then,

    #include "pragmaDisableInvalidWarnings.h"

    in your .CPP above any STL includes, and the magic should take over from there. (I think -- my code that does this is at work and I don't have access to it at this time.)

    --
    John
  85. not stopping to think by pres · · Score: 5, Insightful

    While some thought is, of course, necessary I have definitely seen the problem with new programming students of thinking too much.
    Basically, they try to understand the whole problem fully before writing the first line of java or C. My feeling is that this is not possible for a new student. There is just too much. Rather you just have to write code at some point. Forcing yourself to try things in code is often the only way to really get started in your first programming language. (After the first one, you should be able to think as much as you want because you should have enough background not to get lost).
    I have actually noticed this problem more in girl then guys. Guys tend to rush right in and try to hack it while girls try to understand it fully first. Sometimes the hacking approach is just the necessary one. (Of course this then flips in the second or third CS course where NOT fully thinking through the problem hurts more).

  86. Re:Compiler Warnings by plover · · Score: 1
    Sure, I click submit and THEN I find the answer from Google.

    Check this link for a workaround that I know we use. For whatever reason, declaring a static with an exceedingly long name made it happy.

    --
    John
  87. C+- by beware+of+the+robot · · Score: 0, Offtopic

    There was one language missing on the list: C+-. This is /. curriculum, so go get some some info about it. A slightly different explanation of it also exists.

  88. The choice of FONTS by Taco+Cowboy · · Score: 3, Insightful



    Many a programmer will give you tons of insights on what not to do, but everyone and their great-granduncle seem to forget that the use of FONTS is of great important on eye-balling bugs.

    Your example of the ";" could have easily caught if you use a font that makes stuffs like ";" "." "," "`" and so on FAT and OBVIOUS.

    And on more thing - ENLARGE the size of the font to a comfortable degree, instead of squiming your eyes to look for ridiculously faint dot.

    For programmers, although our brains are important, it's our eyes that have often been over-strained.

    --
    Muchas Gracias, Señor Edward Snowden !
    1. Re:The choice of FONTS by Surt · · Score: 1

      And as another useful hint, enable the warning on your compiler for empty expression. All modern compilers have this warning, and will prevent you from ever making this mistake again.

      --
      "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
    2. Re:The choice of FONTS by Master+Ben · · Score: 1

      Good information here. Something else you might want to try is changing the background and text color. A slightly gray back ground with a blue text is my fav.

  89. not funny by mgbaron · · Score: 1, Flamebait

    this article was pretty f-ing stupid

    1. Re:not funny by Anonymous Coward · · Score: 0

      Actually, it was funny. You just didn't get the joke, probably because you're part of it.

      I used to be a TA for Into to CS courses at a major university (2 years), and also used to teach computer programming at the junior college level (3 years). The number of times I saw people make the same sort of mistakes outlined here still depresses me, and I haven't been in education for 6 years.

    2. Re:not funny by Quill_28 · · Score: 1

      > Now here's a question: Could Jesus microwave a burrito so hot that he himself could not eat it?

      Yes.

  90. Suggestions for instructors.... by Chanc_Gorkon · · Score: 2, Insightful

    If the class is not a early class in the CS flow, don't place the focus of the course on simple documentation. Also, on a scripting class like Javascript, enforce what would be asked for on your job. Inline comments. Block diagrams or system flows are more used in industry then nitty gritty flowcharts and pseudo code. As most CS projects are too small to go beyond building just a flow, I can see why they don't use block diagrams.

    Classes should try to focus on teaching as much of the subject as possible in the time alotted especially if it's further down the prereq list. The subject should not be if you got your flowchart right! it should be if you got the program right AND knowing how you did it. Require the documentation, but don't let it weigh in heavy on the grade.

    In my current class, there are also group projects (in a web class no less). While a little hard to deal with, it's not too bad as that is the way alot of developers are meeting.....just in e-mail or IRC or what have you.

    In any case, as far as supporting others work, comments in the code and decent end user documents is all I ask.

    Also, alot of languages don't lend themselves to flowcharting...so why require it?

    Sorry, just venting on how far back in the times some instructors are! I spent the first 3 weeks of class learning basics....basics I learned 15 years ago.

    --

    Gorkman

  91. Re:Compiler Warnings by fireboy1919 · · Score: 4, Funny

    As a TA, I've often felt that students who ignore errors should should get points marked off for reasons they can't understand. After all, if they're going to make me do more work because they can't be bothered with simple comprehension, shouldn't I give them the same?

    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.

    --
    Mod me down and I will become more powerful than you can possibly imagine!
  92. Re:Advice from a fellow student by plover · · Score: 1
    Like this classic?

    /* Drunk, fix later */

    --
    John
  93. Advice from a student by miyako · · Score: 4, Insightful

    I'm a CIS student, about ready to graduate. I'd already been programming for several years before I started school (and never allowed my school to interfere with my education), and I've spent a lot of time helping my fellow students, and here is some advice based on what i've seen.
    Learn to love whitespaces. I don't know how many times i've seen people try to cram their code down as small as possible by removing every possible whitespace. A few extra spaces can really help you catch mistakes when your using a lot of nested parenthesies. ( ( (th) ( (i)(s) ) ) is much easier to read than (((th)(i)(s))) if your trying to make sure you don't screw up your parenthesies.
    DO NOT comment every line. Seriously. Comments are a good thing, but when you comment every single cin and cout, every single bracee and function call, then it can make it a lot harder to find what you are looking for. A good rule of thumb I tell people is to comment every line you have to think about for more than 30 seconds, comment every function and class, and comment every block of code that you have to spend more than 2 minutes pondering over.
    Learn to use your editor. Whatever IDE or editor you decide to use, learn to use it well. Learn to use the debugger specifically, but also get used to the environment. I don't know how many people I've helped who's problem was not with their code, but with an improperly configured IDE.
    READ Error messages. This sounds obvious, but I swear people don't read them, or don't think about what they could mean. I think a lot of this comes from programmign classes that teach people to memorize syntax, without giving them an understanding of what's going on at the machine level, or what the compiler is actually doing.
    If you miracously fix something, understand why. Students seem like they can not resist randomly moving code around, and sometimes this does fix things. If this happens, take some time to understand what you moved and why it might have fixed the problem
    Take Breaks. This one applies to everyone. I've seen a lot of good programmers go crazy over simple problems simply because they are too stressed out to think clearly. If you start to feel stressed, tired, or your mind starts to wander, then step away from the computer, have a cigarette or a cup of coffee, take a walk, and get your mind away from the problem for a bit. Even if you have a deadline, a 15 minute break can often save an hour of frustration at the computer.

    --
    Famous Last Words: "hmm...wikipedia says it's edible"
    1. Re:Advice from a student by stewby18 · · Score: 4, Interesting

      A few extra spaces can really help you catch mistakes when your using a lot of nested parenthesies. ( ( (th) ( (i)(s) ) ) is much easier to read than (((th)(i)(s))) if your trying to make sure you don't screw up your parenthesies.

      Personal preference, I guess. I was able to almost immediately tell that the tighter set was correctly balanced, but I had to spend a lot more effort to determine that the first set is missing a closing parenthesis.

      I can't help but wonder if your mistake was intentional humor, or unintentional irony.

    2. Re:Advice from a student by Anonymous Coward · · Score: 0

      I had a similar reaction, the second was very easy to read for me, although I could tell immediately that they were mismatched. since there was an ( before the (i) in the first example.

      I think it was unintentional though, people tend to signal their irony a lot clearer than that.

    3. Re:Advice from a student by fozzmeister · · Score: 1

      i like
      if ( (this) ||
      (1=1) ||
      (9=0) {
      do this
      }

    4. Re:Advice from a student by Cederic · · Score: 1


      Although ironically you also left in a compile error.

      I do prefer to avoid checking multiple constructs in a single statement, but the important thing is, use brackets to start with!

      if (this||a==b||c==d)

      works fine, but isn't as easy to mentally parse as it would be with brackets - however many spaces are involved.

      ~cederic

    5. Re:Advice from a student by peterpi · · Score: 1
      "I've spent a lot of time helping my fellow students"

      There was a previous discussion on this a long time ago on slashdot. One side of the argument was:

      Never help fellow students

      ... the reasoning being that they need to figure out things work, and that you're not always going to be around to help them out, etc etc etc.

      I do agree with these points, but I'm also glad I took the time to help other people, as explaining a programming concept to a non-techie is a skill you will need in the real world.

    6. Re:Advice from a student by Anonymous Coward · · Score: 0

      >READ Error messages. This sounds obvious, but I swear people don't read them

      Might not be applicable to students, but when I get two screenfulls of errors because I sent the wrong type into a template, I tend not to read it in full either.

    7. Re:Advice from a student by NonAnonymousCoward78 · · Score: 1
      If you miracously fix something, understand why. Students seem like they can not resist randomly moving code around, and sometimes this does fix things. If this happens, take some time to understand what you moved and why it might have fixed the problem

      I've had c++ problems in the past where I have miraculously fixed errors by moving a brace up to the previous line. Or, also literally moving one var declaration before another. To this day I still have no idea why declaring one int before another made the program work. This is why I hate c++. Oh yeah, I was using gcc too.

      --
      --- My dog ate my sig.
    8. Re:Advice from a student by ysachlandil · · Score: 1

      First rule of commenting code:

      Comment why not what.

      HTH
      --Blerik

    9. Re:Advice from a student by Anonymous Coward · · Score: 0

      (.)(.) ;)

    10. Re:Advice from a student by Anonymous Coward · · Score: 0

      You were probably reusing a variable name without realising it. Then you scoped the duped var name down to the point that it was used locally in an if or for and didn't overwrite your previous use of it which may have been needed later in the code.

      Or worse you were overwriting the memory space of one var into the next one declared. This is a common C error as well. Rearranging var declarations can indeed hide this bug under the rug, till it makes a rocket misfire or something else dreadful.

      In either case (or any other) the syntax of C or C++ is not random. If moving a brace "fixed" a problem it's because you had a problem with your code, not understanding the problem is not the fault of the language (maybe the compiler could have had better error detection) but of your ability to code. Please stop now before you code the next big mozilla bug!

    11. Re:Advice from a student by makisupa · · Score: 1

      My preference:

      if ( this
      || (this)
      || (this) ) {
      // stuff
      }

      Further, you might see something like this:

      if (this
      || ( this
      && this
      && this )
      && this
      || this ) {
      // blah
      }

      My reasoning?
      - I like to see the logical operators grouped in a way that's quick and easy to read
      - Why stagger them on the ends of lines when you can group them on the beginnings of lines?

      --
      "A matter of internal security, the age old cry of the oppressor" - Jean Luc Picard
    12. Re:Advice from a student by cpghost · · Score: 1

      Learn to love whitespaces

      That's one of the main reasons why instructors should use Python in introductory programming assignements. Once students get into the habit of properly indenting code (because, with Python, they must), they'll stick to it later in their professional life too.

      --
      cpghost at Cordula's Web.
    13. Re:Advice from a student by Geoffreyerffoeg · · Score: 1

      IMO, it's not missing a clothing parenthesis. It has an extra opening parenthesis, and that adds a fourth level of nesting that messes up your brain.

      The tight one is (( (th) (i) (s) )). The loose one is (( (th) ((i)(s)) ): (i)(s) has an extra set of parentheses surrounding it.

    14. Re:Advice from a student by fozzmeister · · Score: 1

      and a lot of compilers balk at stuff like that

  94. rad by b100dian · · Score: 1

    I don't think the article applies to drag-and-drop-right-click-properties-check-smart-o ption programming style. First, it's like using a pencil to draw the idea to someone, then, it performs, as a program, in the same manner (as the pencil?).

    OTOH, "Lecturers will probably have to mark dozens of them, making it difficult to spot similarities between them": you'd be suprised the science lecturers develop to measure the software quality and compare the algorithm's implementations. I think it's like researching on teaching techniques & prevetion of student's cheating, but it's reasearch, dammit, it's payed, so:
    Rule #FFFFF: do not write code, give it to your students and then ask smart questions about it

    --
    gtkaml.org
  95. How about... by Bullseye_blam · · Score: 3, Funny

    When borrowing someone else's code to finish an assignment that totally stumps you... don't forget to change the variable names.

    -Bullseye

  96. Don't compile now, diagram instead by Simonetta · · Score: 2, Interesting

    My profs insisted that we should diagram the process algorythym before coding.

    They recommended strict diagramming techniques like Warnier-Orr. They said use a white board with big erasures and little markers because large sections are going to be junk.

    Strict and systematic Warnier-Orr diagramming can be a real discipline.

    I've gone back to it in order to code very tight , time-dependent 50 nanosecond mulitple interrupt routines in assembler for microcontrollers and embedded systems. I've even placed the white board on the flatbed scanner to copy it when I've gotten that finally works in a walk-through (take the hinged cover off- it goes much easier.)

    Even after doing this..and then assembling and burning the code into the chip..and having the device actually function correctly..I still get the feeling that there is something stange and magical happening that I'm not aware of.
    One just sits down and tells oneself that, no, there's no magic here. You designed a complicated machine, you throughly tested a precise simulation, you built it, and it worked exactly like it supposed to because there wasn't any possiblity that it could not work like it was supposed to. It's just going through hundreds of precisely defined steps many millions of times a second...and gives the illusion of magic and sentinite intelligence. ..ramble on...

    1. Re:Don't compile now, diagram instead by Mac+Degger · · Score: 1

      Dude...invest in a digital camera and take a high-rez pic of your whiteboard...much easier and faster.

      --
      -- Waht? Tehr's a preveiw buottn?
  97. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    I find that with a little alcohol in my system, I drive better, I am more assertive, and perform better. Not to mention that the other cars on the road seem less important.

  98. Good advices but... by Anonymous Coward · · Score: 0

    The article was well written but based on my own experiencies the reason exercises are sometimes terribly badly written is because a lack of time, not because you didn't know what that there were better ways to do things.

    Exercises are usually done as quickly as possible and code readability and maintanability is thrown out of window because only thing that matters is to make it pass the minimum requirements.

  99. Zero tolerance for errors by mcrbids · · Score: 3, Interesting

    I've been coding for some time very extensively using PHP. It, along with GTK is a good, high-level language that lets me get lots done, very quickly.

    In many cases, it will accomodate common errors, such as strings not being quoted, etc seemingly without complaint.

    However, I recently changed my strategy to one of "zero tolerance", which entailed me reducing the error reporting threshold to 0 (all errors) as well as defining a standardized error handler callback function. I spent about a month just going thru the existing codebase to quote all the strings, etc.

    However, now having done paid that price, I'm quite surprised at how often bugs that would have previously gone un-noticed pop out in clear view.

    Undefined variables previously translated to equal false now stand out as a mis-spelling. Database errors previously un-noticed suddenly highlighted and shown to me. Hiccups in the code previously shown to users now archived and hidden away so that I see them instead.

    It's made a HUGE difference - I'm more productive despite the appearance of having more to look out for!

    I also have a generic error() function defined that's really a wrapper for the error handler - so the error logging system now in place works for language errors and logic errors alike.

    It's awesome!

    --
    I have no problem with your religion until you decide it's reason to deprive others of the truth.
    1. Re:Zero tolerance for errors by Tom · · Score: 1

      I also have a generic error() function defined that's really a wrapper for the error handler - so the error logging system now in place works for language errors and logic errors alike.

      Well, care to share that function and explain how to add it in?

      --
      Assorted stuff I do sometimes: Lemuria.org
    2. Re:Zero tolerance for errors by mcrbids · · Score: 1
      It's really rather easy... I have a function called Error() for logic errors that I call in code, eg:
      if (!file_exists($get_file))
      error("File $get_file does not exist");
      Then, I have a default handler, EG:
      Function ErrorHandler($errno, $errstr, $file, $line)
      {
      $write=date('Y-m-d H:i', mktime()).$errstr.' :: '.$file.':'.$line.' :: '.$errno;
      $fp=fopen(LOGFILE, 'a');
      fwrite($fp, $write);
      fclose($fp);
      }

      Function Error($str='')
      {
      static $error;
      if (stlren($str))
      {
      $error=$str;
      ErrorHandler(0, $str, '', 0);
      }
      else
      return $error;
      }

      Set_Error_Hander('errorHandler');
      It's stupid simple. Do a tail -f of LOGFILE to see what's happening while you develop. Language errors will show the file/line number, and you'll know exactly when the error occurred, as well.

      I don't want to think about how much time this has saved!
      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
  100. Re:Advice from a fellow student by Ann+Elk · · Score: 1

    Years ago, a server product I worked on had a nasty race condition in an error path that was only hit under heavy stress. Another engineer and I spent hours staring at the source, spelunking through the debugger, and creating dead-end theories. The next day, after getting sloshed at a Friday afternoon beer and wine party at work, we decided to attack the problem again. 15 minutes later, the bug was obvious, and easily corrected.

    DUI (Debugging Under the Influence) can be highly productive.

  101. Re:Advice from a fellow student by ZorbaTHut · · Score: 4, Interesting

    A friend of mine once had a large windowing class he needed to write. He was late on a project and basically needed it done Now. Or sooner. So he resigned himself to an all-nighter and got crunching.

    Round about 8pm, he realized he was getting overly stressed, and he still had about half the code left to write. So he decided to take an hour break, smoke some pot, and come back to the project after he was a little unwound.

    The next thing he remembers is waking up the next day. He had that dawning moment of realization that I'm sure all of us have experienced at one point in our lives - "Oh CRAP I screwed up" - and ran to his computer to finish the code as fast as he could.

    The code was finished.

    Several thousand lines, all commented, all readable even without comments. The interface was clean. The implementation was clean. It was finished.

    To this day, he has never remembered writing even a single line post-toke. He has also never found a single bug, and he's used that code quite often. Now, I don't recommend relying on this technique - but once in a while, it seems to work.

    --
    Breaking Into the Industry - A development log about starting a game studio.
  102. In the future successful people will do both by tallbill · · Score: 0

    so youngster studying this stuff will be half way there. . .

  103. Arrogance.. by Anonymous Coward · · Score: 0
    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.

    I think both exercise makers AND course staff should have less arrogance. It is also really annoying when a older student who have only passed the course with no real C++ experience starts claim that he is right and therefore you must be wrong without even reading your arguments. By that time I had 10+ years experience in C++ coding (and software development and basic algorithms of course) and had written my own (primitive, not-full) C++ compiler.

  104. Don't bother testing. by Anonymous Coward · · Score: 0

    It'll work.

    I actually submitted an assignment without testing it AT ALL once, and it worked without a hitch. Scary thing is: it was a cyclic-executive real-time scheduler in 68hc11 assembler.

    Of course, I'd very very thoroughly stepped through every code path by hand.

    1. Re:Don't bother testing. by AVee · · Score: 3, Insightful

      Of course, I'd very very thoroughly stepped through every code path by hand.

      So where is the, not testing, part? Dry testing is testing as well. And not the worst way of testing, imho.

  105. I prefer relying on my tools. by tshak · · Score: 1

    Since modern code editors force tabs or spacing in these scenarios, I find comments like "// end if" to create more noise overall. The other problem that "// end if" is trying to fix is when the original statement is off the screen, in which case your code desperately needs to be refactored. Finally, I believe that the next version of VS.NET tells you the expression and line number when you hover over a closed brace. The bottom line is, I'd rather rely on tools to force style such as indenting, as well as clean code to avoid the need for comments that can add noise as well as become outdated and accidentally express the wrong meaning.

    --

    There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
  106. Develop a programming conscience by Viv · · Score: 5, Interesting

    I've gone back to school, and have noticed that I have something that makes me a much better programmer than my peers.

    Over the years, I've developed a little voice at the back of my head that speaks up every time I am having problems with code I've written.

    It asks me, "Is the problem you're having a result of a broken implementation, or is it the result of a design that lends itself to a broken implementation?"

    With a good design, the code is not only easy to bang out, but the good design will tend to prevent you from making errors in the implementation. With a poor design, the code is hard to bang out, and it actually tends to cause you to make errors.

    Develop this programming conscience. Constantly ask yourself, "Is my bone-headedness in the code itself, or the design?".

    This will make your life easier.

    1. Re:Develop a programming conscience by OldCrasher · · Score: 1

      Ahh, voices in your head...

      Does the voice sound like your mother or your father?

    2. Re:Develop a programming conscience by Viv · · Score: 1

      It doesn't actually sound like anything, in this case, it's more like getting messaged by write or talk.

      How odd is that?

    3. Re:Develop a programming conscience by tobe · · Score: 1

      That's actually one of the most pertinent points regarding the process I've heard for a long time. Seen the situation so many times where companies spend huge amounts of time debugging, special casing and just generally mangling a bad design when they really should have stopped, took on board the lessons learnt and re designed with those in mind rather that attempting to jerry rig the existing code.

    4. Re:Develop a programming conscience by $javamaniac · · Score: 0

      It'll never happen. I'm looking for a new job. I haven't lost the old one yet but I know it will happen because the codebase is an unmaintainable pile of crap due in large part to the principle under discussion.

      More than a year ago I warned the (then) new head of development that the product was wonderful as a prototype and garbage as a retail product. I told him that if we didn't treat it as a specification from which to build a real product it would grow exponentially in size and messiness, something like the plant in Little Shop of Horrors.

      It has, and only a growing customer base (he's an astoundingly good salesman) has masked the fact that I was right about the cost of customer support becoming unsupportable. Not to mention codebase maintenance taking longer and longer...

      Part of the reason that they (PHBs) never learn about this sort of thing is that programmers always say we should start over, and very often attempts at rework fail dismally. Possibly this is due to poor design as described earlier in this thread, but it's nonetheless damaging to the credibility of the idea.

    5. Re:Develop a programming conscience by fireboy1919 · · Score: 1

      I just started programming with other people for the first time in a while. It was strange.

      We're allowed to use whatever we want to program in, so I use C++ and he uses C.

      Guess whose pointer errors we spend the most time debugging? (Hint: while I have variables that come from the heap, I don't use any pointers).

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    6. Re:Develop a programming conscience by OldCrasher · · Score: 1

      It could be that you need some serious analysis time in the future if the voices sound like "write or talk"!

      Being older, my voices come as if from a telex, as a sort of clacking sound. Or is that my bones?

  107. Re:i thought it was going to be something serious. by hfx_ben · · Score: 1

    I think you got it: I found it painfully un-funny ... likely it'd key right in with first year students' sense of humour.

    --
    If you look to see how the system works
    likely you'll find that it doesn't.

    --
    -- When you look to see how the system works, you usually find that it doesn't.
  108. heh by McBeer · · Score: 1

    The best part is I read that while putting off a programming assignment.

    --
    Hikery.net - The best hiking site ever. Made by yours truly.
  109. Re:Advice from a fellow student by zarkzervo · · Score: 1
    One of my best programming sessions was after a vorspiel. 2 beers and 2 vodka-redbull. Then I coded the most beautiful recursion you can imagine.

    I checked it the day after. It was still beautiful.

    --
    Insert `fortune -o` here
  110. Re:The best advice[sic]-off topic but by panurge · · Score: 4, Insightful
    Yes, take up a skilled trade, or preferably two, one of which is IT related. Most plumbers, electricians and carpenters are not capable of running a business because they lack the organisational and IT skills that are needed nowadays. If you are capable of doing comp sci and becoming a plumber, you could end up running Kohler...well, I exaggerate a bit but I think the point is valid.

    Rudolf Diesel, the inventor of the engine, graduated from University and then went and trained as a skilled mechanic. Isaac Newton could use a lathe by the time he got to Cambridge. And Alan Turing could machine his own relays. Apart from the career options, acquiring both academic and practical skills makes you a more rounded person, and thus more employable generally.

    --
    Panurge has posted for the last time. Thanks for the positive moderations.
  111. Elements Of Style by Anonymous Coward · · Score: 0
    ...Strunk & White

    "Asserting that one must first know the rules to break them, this classic reference book is a must-have for any student and conscientious writer. Intended for use in which the practice of composition is combined with the study of literature, it gives in brief space the principal requirements of plain English style and concentrates attention on the rules of usage and principles of composition most commonly violated." This book has never been out of print since 1918, and Lo! W. Strunk and E. B. White (you may recall a fiction of his) still hit the nails on their heads! I highly recommend every person have this thin volume on their desk for casual perusal, but failing the hard copy, here's a link to the online version http://www.bartleby.com/141/

  112. Way too advanced. by kahei · · Score: 4, Insightful


    As far as I can tell, especially with people from an academic background (PhDs! argh!), this guide is way too advanced -- something like this might be more useful to start with:

    -- Do not keep the entire project in /tmp
    -- Use source control
    -- Run the code before delivering it
    -- NOT JUST ON YOUR OWN WORKSTATION, BUDDY!

    Then, from that one could work up to 'try and ensure it is possible to install the software by some deterministic process', and only then would it be worth actually starting with actual code...

    Well, they learn eventually I guess, in most cases.

    --
    Whence? Hence. Whither? Thither.
    1. Re:Way too advanced. by Anonymous Coward · · Score: 0

      An excellent point that no one else made:
      -- Use source control

      To all CS students: use CVS. It doesn't matter how small your project is. Install CVS with a local repository (no need for a network-accessible repository). Check-in your code every 15 minutes. If it compiled before, and doesn't compile now, you can do:

      cvs diff -D "20 minutes ago"

      and see exactly what you changed. It should be easy to spot your mistakes this way. And if you struggle for 30 minutes and still can't get a compile, roll-back your most recent commit (or 2) and re-add the desired functionality from scratch (and hope that you don't re-introduce the same boneheaded mistakes the second time).

      You also get an excellent backup system so that if you accidentally erase a file (or more), you aren't totally screwed. Some people make entire directory backups (e.g. proj_20041020), but then you have a lot of these things to manage, and none of the tracking advantages of version control.

    2. Re:Way too advanced. by turgid · · Score: 1
      Many years ago when I was at university studying physics, many of us chose computing projects in the final year. For various reasons, some of us were instructed to write in pure FORTRAN-77 despite our protestations.

      I ended up having to implement various data structures within statically-allocated 128MB arrays (our biggest machine had 256MB RAM). Copious comments were required to make the code even semi-understandable.

      There was one particularly clever chap on the course, a mature student. He did one such project. One day he looked at my program, which was over 2000 lines, including comments (actually, it was 50% comments). "I see you've used subroutines," he noted. "I didn't bother with those," he continued. I looked at his program. It was 600 lines of FORTRAN-77, no comments, no subroutines, just GOTOs.

      My program worked and his didn't.

    3. Re:Way too advanced. by Quill_28 · · Score: 1

      I have to agree. I am surprised more courses don't require it or at least have cvs in 10-minutes.

      I used CVS in the one computer class I took which helped me greatly. The thing was I already knew cvs pretty well.

      So maybe it is not people don't want to use it they just don't know how?

    4. Re:Way too advanced. by BenjyD · · Score: 1

      I'm doing a PhD in a Computing-and-Engineering department and I have to say I agree with your pessimism.

      In a department where many projects require writing 10,000+ line C++ programs involving CORBA calls and all sorts of other complex issues:

      • The introductory C++ course doesn't mention classes once. Not a single mention. No STL, either. Half the examples don't even compile on GCC, instead relying on some Sun compiler that no one uses anymore. And that's all the teaching most people get.
      • Nobody knows about basic C++ constructs, either. I suggested a do while loop recently, only to get the reply "What's that?"
      • The department has some standard libraries for interfacing with solver packages etc. These have classes (who knows how they found out about those) for n-dimensional array slices but they only go up to 6-dimensional. The reason:
        class Array
        {
        public:
        Array(int m);
        Array(int m,int n);
        Array(int m,int n,int o);
        ....
    5. Re:Way too advanced. by pclminion · · Score: 1
      I disagree, sort of. You shouldn't commit when code is in a state of flux. For tweak-type changes involving a single file, it makes sense, but for more complicated changes that involve multiple files, headers, makefiles, etc., the code really should be in a consistent state. Not necessarily bug-free, which is probably impossible anyway, but at least consistent.

      Many times, changes to one part of the code don't make sense outside the context of changes to some other part of the code. These things shouldn't be halfway committed. Every tagged revision that can be rolled back to should be self-consistent. You risk hours or even days of headaches if you break this rule.

      If you insist on committing while developing a large scale change, at the very least fork a branch off and do your commits there, so that when the changes stabilize you can merge them back into the real tree and delete the development branch and its confusing, inconsistent states.

    6. Re:Way too advanced. by Anonymous Coward · · Score: 0

      When there is only one developer, a student working on a school project, there is no need for branching and the software is always in a 'consistent' state (even if it doesn't compile!) It might be a good idea to use a tag on good 'checkpoint' commits.

      As a professional developer, my commit-rate is usually between 4/day and 3/month, depending on the maturity of my code and the kind of changes that I am making. When developing on a team, the most basic rule is usually: no compile, no commit. There may be more stringent requirements (like everything has to pass regression tests), but those are often tied to a branch or tag.

  113. Worst programming bug ever by Anonymous Coward · · Score: 1, Informative

    In debugging an NES emulator, I once spent at least 13 work hours going through M6502 emulation code, and all the other byte and bit-level logic that goes into an NES, only to find I'd used two == instead of one somewhere.

    Another time (5 hours of work buried in run-time assembly debug output) I found out a bug was placed because I had the two controllers set to the same input. (I.e. they'd both hit select at the same time. Couldn't start mario, etc.)

    Some mistakes are just unavoidable.

  114. Re:Compiler Warnings by dcam · · Score: 2, Interesting

    There is actually a better way of getting rid of these rather than contaminating your code with unecessary #includes. Check this out. Basically add the same pragma command to YVALS.H which is in the include dir for the Visual studio installation.

    In case you are wondering whether you are really going to break something, the error message relates to the debugger not being able to handle >255 chars.

    The problem with this warning message is that it can obscure real error & warning messages.

    --
    meh
  115. Re:Compiler Warnings by georgewilliamherbert · · Score: 1
    I never got up the nere to actually do it.

    Shoulda' just done what I did, and replaced the compiler with a spurious error message generating wrapper...

    Compiler says 'Ack' from rec.humor.funny

  116. When I read the article subject... by Smoje · · Score: 0

    I thought: "I don't think the Counter Strike addicted students will be interested in this!" ;-)

  117. People never coded properly by Cid+Highwind · · Score: 3, Insightful

    Every /. story about programming seems to bring this tired meme out of the woodwork yet again. There never was a time when people wrote apps that do almost as much as current software in a tiny fraction of the disk and memory space.

    What people forget is that old games and GUIs only had 1/50th of the pixels (and 2 of the 16 million colors) a modern display has to contend with, that their old 100KB "word processor" was really a stripped-down text editor with 3 fonts and no spelling check, DOS could fit on one floppy because it was really just a program loader and a half-hearted attempt at a shell, and "searching your filesystem" meant rummaging through desk drawers for a floppy disk! Programmers could fit apps of the time into tiny memory spaces because their programs didn't *do* much of anything, not because they had some magic ability to "code properly" that's lost on programmers of today.

    --
    0 1 - just my two bits
    1. Re:People never coded properly by Indy+Media+Watch · · Score: 1

      Excuse me, but when smart-alec Redmond programmers think it's 'cute' to include a multi-megabyte Easter Egg in their code I believe people are being a bit generous with their use of my storage and processing.

      Moreover, many of today's security flaws should never have happened in the first place (cough...Buffer overflows...cough...Race condition) and would have seen you fail a CompSci subject if submitted as such.

      --

      Indy Media Watch-Proctologist of the Internet

    2. Re:People never coded properly by Mac+Degger · · Score: 1

      Come on...screen pixel density shouldn't mean jack! The only reason it does is because people are too lazy and use huge frickin' bmp's when they could get teh exact same effect, replicable in a thousand different situations, by programming a colour gradient function (look at the classic start menu in windows; you know, when you click on the start button and the menu pops up, on the right of this menu is a coloured bar with your windows version displayed in it...and it's a fucking bitmap!).
      Now explain to me the diffence in functionality between office 97, 2000 and xp. I'll tell you; there is very little real difference, except for graphics.

      --
      -- Waht? Tehr's a preveiw buottn?
    3. Re:People never coded properly by Cid+Highwind · · Score: 1

      Now explain to me the diffence in functionality between office 97, 2000 and xp. I'll tell you; there is very little real difference, except for graphics.

      That's true, there isn't much difference. Now explain to me how Office XP is unbearably bloated when 97 isn't. In 1997 you got the core MS office apps (Word, Excel, and Powerpoint) on one CD. With office 2000, you got them on one CD. With office XP, you still get Word, Excel and Powerpoint on (you guessed it!) one CD. Getting 7 CDs of useless clipart and add-on apps instead of 1 is a bit annoying, but you don't *have* to install any of it.

      --
      0 1 - just my two bits
  118. What not to do... by matdodgson · · Score: 1

    Don't start computer programming - it is a dying industry. Unless you want to work in India or China.

  119. Suggestion for Instructors by hussar · · Score: 3, Funny

    Don't provide solution sheets that contain code that will actually compile. After the frustration of working unsuccessfully for days (nights) to get her assigned programming project to compile and run correctly, what the student really wants is the character building exercise of debugging the instructor's solution to the exercise. When the students see that their instructor also has problems writing bug-free code, it will help to buttress their self-confidence.

    --

    Bureaucracy loves company.
    1. Re:Suggestion for Instructors by Hakubi_Washu · · Score: 1

      This is especially true if you're having multiple assignments dependant on each other. Student at the RWTH Aachen (Germany) CS-Courses can tell you about this...
      We had a 6 assignments (one each week) block to do, implementing a simple accounting system, learning lists, classes, etc. Each week it would state we could start off of the previous weeks instructor's solution, so we wouldn't be stuck if our own solution didn't work (failing too many assignments would of course cost you...). We all had the same Java versions, IDE, etc. installed (came on a CD, from the University). Well, my solutions always worked, so I could build upon them. The instructor's ones never even compiled...

    2. Re:Suggestion for Instructors by hussar · · Score: 1

      Yes, I could see how that would be a problem, although in general, I preferred having multiple assignments dependant on each other. The alternative was to get multiple (weekly) assignments that each demanded their own cycle of concept, design, execution and debugging. Granted, one objective of the courses I took was to teach us to conceive and design, so having to do that weekly may have reinforced that aspect of the courses. It was done, however, at the cost of not teaching us how to optimize and re-use code.

      --

      Bureaucracy loves company.
    3. Re:Suggestion for Instructors by Hakubi_Washu · · Score: 1

      I agree, it was a good idea to have this dependant assignments (we had to do some unrelated ones beforehand, so there was a good amount of balance involved IMHO), but the problem of non-compiling code was way more severe with the dependant stuff, naturally. The independent assignments didn't compile too often, as well, but most of the time they didn't solve the assignment anyway (Usually simple mistakes, like "Print a x-wide, y-high square of *'s on screen", wich outputted a x-high, y-wide square, or missing ;'s, faulty neverending loops, and the like. Clearly the instructor didn't even test his solution, but was confident of his skills... We complained, but nothing changed. Has been like this for years, I'm told.)

  120. MAVADDAT SPEECHLESS!!! by Trepidity · · Score: 5, Funny

    mavaddat prefer people not post on slashdot using mavaddat name

    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!!!!!

    1. Re:MAVADDAT SPEECHLESS!!! by Anonymous Coward · · Score: 0

      And you don't recognize good OOG humor when you see it! That was funny, but will be lost on /. n00bs.

    2. Re:MAVADDAT SPEECHLESS!!! by Fnkmaster · · Score: 1
      I was beginning to think that nobody remembers OOG, Signal 11, Jon Katz or the rest of the early generation of characters we used to have around here (okay, just kidding about Katz, I hated him too).


      Is it just me, or does Slashdot feel like it's lost some of its character as it's grown?

  121. oh this is rich by 888+Geek+Help · · Score: 1

    you must have a 3 digit IQ
    LMAO

    --
    -888 Geek Help (888-433-5435)
  122. FOR and WHILE loops are for babies by nmb3000 · · Score: 3, Funny

    Why use boring old For and While loops when recursion is so much more fun? Next time you start typing 'for (i=0;'... ^H^H^H^H a few times and do it with a recursive function call instead. It's a lot more exciting, and just think of the fun somebody else is going to have in a few years when they try to update your code!

    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."

    --
    "What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
    /)
    1. Re:FOR and WHILE loops are for babies by Temporal · · Score: 1

      Actually, recursion can be pretty cool when used correctly, in a language designed for it (i.e. functional languages). But, yeah, in C it's a bad idea.

  123. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    In my company, coding under the influence of alcohol is standard operational procedure. We do all the hacking late at night with some beers. Errorhandling and refactoring is done the next day when sober.

  124. Re:ExtremeGoatse Story Time! by Anonymous Coward · · Score: 0

    Catfish lover wrote:

    I jacked off so hard to this the skin on my dick came off.

    [slurping up cum as I type this]

  125. Absolutely true. by raehl · · Score: 1

    Apparently there are oodles of televisions available at Best Buy that can be purchased for mere hundreds of dollars, but after thousands of man hours and hundreds of thousands of dollars invested into equipment and experimentation, I have learned a lot more by building my own television than I ever would have by buying one.

    I think I'll even build a color television within the next three years!

    Seriously, advancement of society DEPENDS on NOT repeating the mistakes already made by others. You'll have plenty of chances to make mistakes no one has made before after you've brushed up on mistakes you shouldn't repeat.

  126. Re:I prefer relying on my tools (part 1). by Yaztromo · · Score: 2, Insightful

    (Posted in "Code" so as to get the formatting right).

    "Since modern code editors force tabs or spacing in these scenarios, I find comments like "// end if" to create more noise overall."

    It's additional meta-information. And if you're working in a group where each developer gets to choose their own editor (such as in virtually any Open Source project on the web), if one user sets their tabstops to something different from the rest of the group, and/or someone starts using spaces instead of tabs (or vice-versa), you wind up with indentation problems.

    For example, you're using tabstops every 3 characters, insterted as tab characters. Some guy working with your file is using 4-space tabs, inserted as spaces. They need to add a line of code below an existing line starting at column 12 on their display (ie: three tab stops in your editor). So they hit tab three times. Looks correct to them, and the editor permits it, so they save the file and fire it back to you.

    /You/ look at the newly added line, and see that where the previous line starts at column 9 on your display, their newly added line starts at column 12, one whole tab-stop extra.

    Or how about if you're always working with only spaces (ie: tab is set to insert three spaces, and not a tab character). /All/ of your sources are using this. Someone comes along and uses an editor which inserts a tab character instead of spaces, with a 3-character tab stop. They work on a file, and check it back in.

    Developer number 3 checks out the file, and for whatever reason always uses the space bar instead of the tab button for indentation. Because of this, they never bothered to change their editors default tab stop of 8. They load up the file, and suddenly it's a mess: the space-stopped lines are still indented in multiples of threes, but the lines containing tab characters as inserted by developer number 2 are now indented in /multiples of eights/! If developer number 2 didn't just add new functions/methods/etc. to the end of the file, and they added lines inside existing blocks, the code readability is now totally fubar.

    And yes, I see this happen all the time, both inside and outside commercial development. You can mitigate this through education and enforcement, but anyone who does any real development work has seen this happen.

    Adding what you call /noise/ provides structure, and allows you to determine which close braces go with what statements. It is due to this sort of potential confusion that many non-C derived languages actually use specific close statements for each different type of open statement (ie: Pascal, Modula-2/3, Ada83/95, shell script (although for a somewhat different reason).

    And in some environment, it can be exceedingly important if you're nesting a large number of blocks. Take this simple Java example, for example:

    // A fragment of Java
    class MyClass {
    method someMethod() {
    for(int i=0;i<100;i++) {
    if(i<50) {
    synchronized(this) {
    try {
    ...
    } catch (Exception e) {
    ...
    }
    }
    }
    }
    }
    }

    Here there are six closing tags in sequence, in short, concise, and valid code. It doesn't take much to scroll the top few lines off the top of the screen (I'll get to why your refactoring comment is invalid in a second). It is exceedingly easy to introduce errors here, such as inserting code in the wrong place, such as:

    class MyClass {
    method someMethod() {
    for(int i=0;i<100;i++) {
    if(i<50) {
    synchronized(this) {
    try {
    ...
    } catch (Exception e) {
    ...
    }
    }
    }
    doSomethingElse(); // Oops -- not supposed to be inside the for statement
    }
    }
    }

    This is very easily mitigated through the mechanism I've already demonstrated:

    class MyC

  127. Heh, I think this may be wishful thinking... by raehl · · Score: 2, Insightful

    You only catch bad cheaters, by definition.

    1. Re:Heh, I think this may be wishful thinking... by Christopher+Thomas · · Score: 1

      You only catch bad cheaters, by definition.

      The fact that I've seen so many bad cheaters, and that most of these assignments are easy enough that anyone with two brain cells to scrape together wouldn't need to cheat, leads me to suspect that the correct assignments are mostly legitimate.

      I'm sure there are people who have cheated with a correct assignment that I haven't caught, but think - if you have a correct assignment, and will get full marks, why would you risk your own mark sharing it with some loser who can't do the assignment? And why _would_ you, as another poster pointed out, spend twice as much time reshuffling your assignment to look original as you could just doing the thing following the steps in the book?

      I know that cheaters aren't rational (otherwise they wouldn't be wasting a course's mark cheating on an assignment they could outright blow off without substantial impact on their grade). However, the source of a correct assignment would be someone who can think, one hopes.

      The surrogate I see among people who do hand in correct assignments is in-lab collaboration. They ask each other how to do X or Y thing that's troubling them (or they ask me, but I'm only there a couple hours a week). This results in assignments that are stylistically similar, but not close enough to be outright plagarism. I've watched people do this, so I'm reasonably sure that most of the "stylistically similar" reports are the result of conversation and not modification of "borrowed" assignments.

      I'm told that cheating is endemic at some places. Thankfully, this doesn't seem to be one, yet.

    2. Re:Heh, I think this may be wishful thinking... by Durandal64 · · Score: 1
      I'm sure there are people who have cheated with a correct assignment that I haven't caught, but think - if you have a correct assignment, and will get full marks, why would you risk your own mark sharing it with some loser who can't do the assignment?
      There are a few motivations. The guy could be your friend and might've just not found the time to finish the assignment. So you help him out in a crunch, and he owes you a favor. Or he could just be some random idiot who offers you $50 for a look at your code. That's 10 days' worth of lunch.
      And why _would_ you, as another poster pointed out, spend twice as much time reshuffling your assignment to look original as you could just doing the thing following the steps in the book?
      Reshuffling code is a brain-dead job. I remember back in one of my CS labs, I found that some previous student of the class had saved all the lab assignments to the local drive in some temp folder buried where no one would ever think to look. I went "Sweet!" There was a catch. The guy's coding style was the absolute most unreadable garbage I've ever seen. Whoever it was apparently didn't believe in putting spaces between variables and operators. So I spent as much time modifying the code I saw to fit my coding style as I would've actually coding the assignment from scratch.

      But it was also a god damn 7:00pm lab, and I just didn't feel like thinking. So copying someone else's code and modifying it was a much better proposition than actually exerting thought. Copying code is an art that only anal retentive people like me can master. I don't copy code except in rare circumstances like that, mostly because I'm arrogant and think I'm a better coder than everyone in my class. That's an attitude that's gotten me into trouble. :)
    3. Re:Heh, I think this may be wishful thinking... by raehl · · Score: 1

      if you have a correct assignment, and will get full marks, why would you risk your own mark sharing it with some loser who can't do the assignment?

      Because you are the best coder in the class, and she is the hottest/only girl in the class?

      Have to get women to talk to you somehow.

  128. this copy thing seems... by jlemmerer · · Score: 2, Funny

    ... to be the microsoft way. did you copy it from them?

    --
    ".Sig Stealer" was here
    1. Re:this copy thing seems... by Gopal.V · · Score: 1

      No. Xerox started it - with Apple following (with a mouse) , Microsoft just followed Apple (windows !) , and the rest of world (VB !!) with them ...

  129. They forgot by coolgeek · · Score: 2, Funny

    Don't waste valuable coding time checking for various error conditions and handling them. Most of the time the return code from various functions is just fine. If it isn't, then there is something really wrong with the system, or the user is a complete jackass who deserves to spend hours scratching their head trying to figure out why your program doesn't work.

    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.

    --

    cat /dev/null >sig
  130. Funny you should bring this up.... by raehl · · Score: 1

    I own a program that myself and one other person do the development of.

    His If syntax is always

    if ()
    {
    }
    else
    {
    }

    And mine is always
    if () {
    } else {
    }

    Which always frustrates me due to vertical space wastage, but it makes it easy to determine who to blame when a bug is found.

    1. Re:Funny you should bring this up.... by beelsebob · · Score: 1

      Vertical space wastage? Really that's the most idiotic reasoning I've ever heard of - your monitor is, what? 1024, 1200, 1440 pixels high even? You are not pushed for vertical space. Or maybe you're concerned about the extra space it uses in the file? Oh wait, no, a \n takes up the same space as a ' '. On the other hand, with his code layout, it's clearer where the if starts and ends, and it's clearer to what the else is associated. Bob

    2. Re:Funny you should bring this up.... by KontinMonet · · Score: 1

      Agreed. I found with multiple if..else that vertical formatting is always easier to read, otherwise I find myself drawing diagonal lines to see where the enclosing blocks might reside.

      --
      Did he inhale?
    3. Re:Funny you should bring this up.... by jsebrech · · Score: 2, Insightful

      On the other hand, with his code layout, it's clearer where the if starts and ends, and it's clearer to what the else is associated.

      It's clearer for you, because that's how you got used to coding. The other way is clearer to me, because that's how I got used to it.

      With regards to the vertical space wastage, this is just my personal opinion, but there is always code that is self-contained but doesn't fit on the screen in one go, and the more of it you can fit, the easier debugging becomes. There's a reason we don't use line-by-line editors anymore, it's because seeing more of your code at once actually helps you code.

      Regardless though, this is a matter of personal preference. It's my personal opinion that those using the newline before brace style are making life harder on themselves, but I'll respect them if they respectfully disagree with me, and let them be.

      Meanwhile, let me state that any project where more than one person is working on the code needs a coding style guide, including how to name things. I'd code the other way if the style guide told me to, because it's better to have code all in the same style than to protect your own personal opinion fiefdom.

    4. Re:Funny you should bring this up.... by Anonymous Coward · · Score: 0

      "Space wastage" is a valid concern. Hell, I use a 21 inch monitor, but I keep the res purposely low, just to keep things easier on the eyes. However, I used to be in your school of thought, until I was forced to switch over to the compact form due to coding standards. Once you get used to it:

      if ()
      {
      }

      is really no easier than

      if () {
      }

      As a nice bonus, the % command in vim will hop between matching parens and braces, making hunting down a misplaced brace much easier.

      The great-grand-parent's suggestion of closing if blocks with: // end-if

      just seems like pointless clutter to me. It should be obvious from just glancing at the indentation what goes with what.

      Finally, just to throw another wrench in things, I also avoid braces entirely when there is only a single execution statement and a very simple predicate:

      if ( fooFlag )
      incrementBarCount();

      This helps reduce clutter in looping structures as well, making it easier to see all that's happening in the same time, without syntacic masturbation-noise getting in the way.

    5. Re:Funny you should bring this up.... by Bake · · Score: 1

      Some IDE's also easily identify blocks for you.

      In Eclipse, if you doubleclick on a line that's opening or closing a block, it automatically highlights the block in question.

    6. Re:Funny you should bring this up.... by raehl · · Score: 1

      Except it's not more clear. You're matching closing braces to opening braces, and then looking at what started the opening brace. Needless extra step.

      It's better to just match the closing brace to the matching if/for/while, which is easy, as it's the first thing you see if you go straight up from the closing brace. This is better because while { is relatively meaningless punctuation ("matching } ends a block"), if/for/while is a meaningful verb ("Matching } ends a branch/iterative loop/conditional loop")

      Anyway, the if starts at the *IF*, so why match to the { instead of the if?

      Stop trying to match braces and start trying to enclose control structures and you'll have a much easier time doing it the right way, and a much easier time understanding what you're doing.

    7. Re:Funny you should bring this up.... by Anonymous Coward · · Score: 0

      Or maybe you're concerned about the extra space it uses in the file? Oh wait, no, a \n takes up the same space as a ' '

      Um, okay, but ' {' takes up far less space than '\n\t(\t...){\n'

      Anyway, I'm not really going to quibble about a few whitespace characters taking up space, even if they are multiplied across many lines in the file. The vertical space issue IS an issue unless you only work on simplistic code. My resolution at home is 1600x1200, and even with 9pt ProFont I find myself wishing I could fit more lines on the screen.

  131. plagarize code from Many.... integrate and deliver by Gopal.V · · Score: 3, Interesting
    Like we used to do in college :)

    Take a program done by 3-4 people , pick the best parts, integrate

    Macros from one, sortings from another, recursion from yet-another...

    It's a lot less hard than writing it yourself and the result is often better than the originals .. Most of all, you actually learn from other people's mistakes .

    Even after getting a job, I find that this is a much more stable way of programming newish things -
    "find a lot of similar things, pick the best strategies & adapt".

    Btw, these days - that's called "Research" :)

  132. Always blame the compiler or even the computer by ArcticCelt · · Score: 3, Informative
    He forgot to mention that you should always blame the compiler or even the computer for any bug.

    Say things like: Ho! That computer in the computer lab is so crippled, I am sure that my code would run fine on a fresh Windows install.

    --

    Yahh, hiii haaaaa! -Major Kong, from Dr. Strangelove
    1. Re:Always blame the compiler or even the computer by Anonymous Coward · · Score: 0

      It will never run without errors on a windows install...

    2. Re:Always blame the compiler or even the computer by Anonymous+Brave+Guy · · Score: 4, Insightful

      The great irony, of course, is that at some time in your programming career you probably will come across a genuine compiler bug, and no-one will believe you...

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    3. Re:Always blame the compiler or even the computer by Phisbut · · Score: 3, Interesting
      at some time in your programming career you probably will come across a genuine compiler bug, and no-one will believe you

      Oh so true... I once hit such a bug (be it compiler, OS or whatever, I didn't investigate that deeply), I was compiling an OpenGL/Qt application with g++ on an IRIX platform, and something just wasn't right... One of the most basic ways of debugging being sending output at just about every line of code, here's what I saw on the console :

      SomeClass::SomeClass() // default constructor
      {
      cerr << "Beginning constructor\n" ;\
      myAttribute = 5 ; // myAttribute is an int
      cerr << "myAttribute = " << myAttribute << endl ;
      // [...] rest of the constructor
      }

      ... and then, I got an output of "myAttribute = 0"...

      I lost about 2 days just trying to find that stupid "bug", but damn did it feel good that I could actually prove I was not wrong on that one.

      I never knew exactly what caused it, but fixing it required to scrap 2 files (declaration and implementation of the class) and write it again.

      Compiler bugs *do* exist, you just need to find a way to prove it to your boss.

      --
      After 3 days without programming, life becomes meaningless
      - The Tao of Programming
    4. Re:Always blame the compiler or even the computer by Anonymous Coward · · Score: 0

      It's also possible that you may corrupted the stack, thus causing your error. So it might not have been the compiler's fault totally.

    5. Re:Always blame the compiler or even the computer by TheRaven64 · · Score: 1
      In my first year as an undergraduate, we were required to use Delphi (*shudder*), and I spent two days trying to track down a problem in my code. Technically it was not a compiler bug, it was either a standard library bug or a documentation bug depending on your perspective. One of the string handling functions provided by Borland took a Pascal string according to the documentation and a C string according to the implementation. The compiler gave no warnings when I passed it a Pascal string (which is probably a compiler bug, since the compiler is supposed to do that kind of type checking), and the code would crash. To make matters worse, the debugger claimed that the crash had occurred at the end of the function that called the function that called standard library function (so, probably a debugger bug to add to the list). Eventually I was reduced to putting in debugging lines after every single line of code to track down the problem.

      Oh, and before anyone complains that it was probably a result of a side effect some memory management error somewhere else in my code, I created a three line program that crashed as a result of this bug. And no, I don't still have a copy of it - it's been a year since I last used Windows, and three years since I last touched Delphi.

      --
      I am TheRaven on Soylent News
    6. Re:Always blame the compiler or even the computer by Mr+Z · · Score: 2, Informative

      Did it ever occur to you, at this point, to:

      • File a bug report with the vendor of the compiler?
      • Examine the assembly output of the compiler and verify that the compiler output bogus code?

      I find that the believability of compiler bug reports goes way up if you actually look at the compiler's output and can say "See! There it is! It's wrong!" And once you do that, you should point it out to the vendor so they fix it. (I say all this as someone who actually has spent signficant time filing compiler bug reports of my own.)

      Finding a bug and just kluging around it might be a nice short term expedient, but it doesn't increase the long-term quality of the tools.

      --Joe
    7. Re:Always blame the compiler or even the computer by Anonymous Coward · · Score: 0

      Are you sure it wasn't the extra \ in line 3 that did it?

    8. Re:Always blame the compiler or even the computer by Anonymous Coward · · Score: 0

      Check this one out. This one is NOT a compiler bug, but it sure looks like one...

      enum COLOR { white = 0, black = 1 };

      struct FOO { COLOR c : 1; };

      FOO bar;

      main()
      {
      bar.c = black;
      if (bar.c == black) printf ("yes"); else printf ("no");
      }

      This program will print 'no' on some compilers (like microsoft's) and 'yes' on others.

      it took me a few minutes to figure out why.

    9. Re:Always blame the compiler or even the computer by Anonymous Coward · · Score: 0

      That is a compiler bug if the ouput is "no".
      I assume the reason that the test failed is because the MS compiler used a signed int to represent the bitfield (and, thus, (int)bar.c == -1).
      However, since the type of the bitfield is COLOR (an enum with no negative values), it should be internally represented as an unsigned int.
      <msbash>This is just one more example of how the MS compiler blows.</msbash>

    10. Re:Always blame the compiler or even the computer by Mr+Z · · Score: 1

      The real bug, as best as I can see, would be compilers which print "no" but don't issue a warning about numeric overflow on the line "bar.c = black".

      --Joe
  133. Let me guess by melted · · Score: 1

    You're a Java or C# "developer", right? There's no way in heck you can program all day in C++ and get everything to compile without at least warnings.

  134. El resto? by raehl · · Score: 1

    That's a real word?

  135. Don't panic on large lists of errrors by farnz · · Score: 1
    If you're going to compile infrequently, and do find yourself ending up with hundreds of errors: DON'T PANIC.

    The errors and warnings are almost always printed out in the order the compiler found them; fix the first one. Once you've fixed the very first error or warning, you may have completely solved the problem; continue to go down the list of errors in order until you find one that might not be an error or warning. Then recompile, and restart.

    I've written C that when fed to a compiler generates a few thousand errors; once I'd fixed the first error ("Cannot find ; skipping"), they all disappeared.

  136. Christ, people.... by billybob · · Score: 2, Interesting

    Every response to the parent has been negative.... "That's horrible advice" etc etc. However, I find myself agreeing with the parent, as long as you have atleast one year experience programming.

    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.

    How could you disagree with this statement? This is basically writing pseudo code, which is how most things should be done. It's just an OO approach. Write code that utilizes functions / class methods that dont yet exist, this lets you create your logic. Then go in and write the actual methods, which eventually will make your logic work. OO approach lets you focus on logic and fiddle with technicalities later. This is how it should be done. :P

    --
    Joseph?
    1. Re:Christ, people.... by The+Cydonian · · Score: 1
      Every response to the parent has been negative....
      It's called "Slashdot Groupthink" and it surfaces particularly when someone voices an opinion that's contrary to the Slashdot Worldview.

      Not that attacking minority views isn't something unique to /. of course. For instance, out here in Singapore, you definitely don't want to shout out "Faye Wong sucks balls" in a random hawker centre, if you hold your teh tarik and chicken rice dear. The key difference though, is in terms of acerbity and misplaced intensity; notice how sarcastic most of the replies were to what is essentially one poster's opinion.

      I'll say this about Slashdot Groupthink though; in all cases I can think of, I've found the exact opposite to be true. The junta thinks iPod Minis are lame? Well, they out-sell other mp3 players by a wide margin. Groupthink says RIAA/MPAA crackdowns have no effect? Most of my old FTP/IRC warez servers no longer exist. Groupthink demands that I call M$ an evil empire and focus on OSS instead? I got my current job because of my .net skills. Therefore, by principle of induction, you know where I stand on this compile-once-versus-compile-many issue:- OF COURSE you want to code everything down and then worry about the details.

      Now watch this post get modded to hell. Not that I care of course.

    2. Re:Christ, people.... by SilverLuz · · Score: 1

      So you recommend doing pseudo-code to functions that don't exist... How hard would it be to write the basic stubs for those functions: definition, a comment describing what the function will do when you write it, and a return statement so the thing compiles? That's all it takes. Forces you to actually think about what you want the function to do, what values it might need, and what it will return rather than just making it up as you go - IMO a Good Thing.

    3. Re:Christ, people.... by jjohnson · · Score: 1

      How come some people have so much trouble believing that a widespread consensus might actually be right? Why is the popularity of a particular belief necessarily a mark against it? By your own inductive argument, the ./ hive mind thinks that slavery is wrong, so you're for it?

      --
      Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
  137. Re:Advice from a fellow student by cheekyboy · · Score: 1

    Actually, if CANNOT code while totally drunk, then your brain is probably too fragile to handle crunch deadlines of 19hrs/day coding before release.

    But I guess that situation is caused by under resources because of management.

    Now try coding in assembly while on LSD, if you cannot do that, then your not mentally strong enough :)

    Think of it as a Metnal Gym, you're putting extra weights/obstacles to make things more difficult, if you can handle that, then your even better when normal just like running training.

    --
    Liberty freedom are no1, not dicks in suits.
  138. Re:BUSH SUCKS by blanster · · Score: 1

    I cann't read clearly,who can aid me and be my firend,gangshuo@126.com,

  139. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    I'm glad the BSD guys followed that rule.

  140. foot shooting by rastos1 · · Score: 1

    I think I have some more

  141. _We_ know that by dos_dude · · Score: 0

    The sad thing is that the kids won't read this. After all, they don't like to read.

    The really sad thing is that if you are after some Slashdot fame, you shouldn't be reading igt either. The point is writing those comments, not reading those stories. You might end up on page 2 if you read the story first.

  142. Re:Compiler Warnings by KontinMonet · · Score: 2, Interesting

    TFA may be ironic but it might help more if it was sarcastic. The number of sites at which I've worked where Warning messages are set to Ignore is ridiculous.

    At one place, so many warning messages were being generated that when I eventually got a decent developer on board, after writing some scripts and working hard to reduce the number of messages, he got the overall compile time to go down significantly. Of course, despite my 'petty Hitler' rantings, most of the team decided not to fix the cause of these errors and the compile time started creeping up again. The arrogance of these guys was palpable, they had no intention of improving, they were, after all, the A-team (or so they said). I eventually moved on to running another team in another part of the company - who were prepared to listen (or were more afraid of me maybe) and, with other processes, productivity shot up over the course of a few months.

    --
    Did he inhale?
  143. A picture is worth a thousand words... by Anonymous Coward · · Score: 0

    I was marking some assignments, which included screenshots of graphs with black backgrounds, well...

    One student copied and pasted someone's graph into his report, but to stop them being similar he decided to blank out a box of numbers in a paint program...

    Somehow he used a dark grey instead of sampling the true background color :)

    I really wanted to write... "If you are going to cheat, at least cheat properly, retard!", but I was afraid of retributiuon.

  144. Re:Compiler Warnings by HawkingMattress · · Score: 1

    The worst part is that it was modded +5 insightful, huh !

  145. Re:Advice from a fellow student by drsmithy · · Score: 1

    Yes, but how about when you sober up ?

  146. PDF broken (140) by Anonymous Coward · · Score: 0

    Acrobat Reader 6.0.2 on WinXP SP1 reports an error #140... :-(
    You might want to check that...

    1. Re:PDF broken (140) by Yaztromo · · Score: 1
      Acrobat Reader 6.0.2 on WinXP SP1 reports an error #140... :-(
      You might want to check that...

      Thanks. Acrobat Reader 6 on Mac OS X reports the same error, but the file opens and views without error on Acrobat Reader 5 on OS X, Preview on OS X, and Adobe Acrobat Reader 3 on OS/2.

      When I get a chance, I'll regenerate it and will see if the fault goes away.

      Yaz.

  147. indeed, bull by Anonymous Coward · · Score: 0

    Totally agreed. The "witty saying" is bullshit. Think about it like math: if you read about the mistakes someone made when solving an equation, and not make them yourself, you will never know how the mistake was made and will ony be able to solve the equation routely, not be able to consider how to solve the equation and do it properly. Reading other peoples mistakes is worthless unless you are making that mistake and are reading how others solved it.

  148. You can't prove that!!! by Anonymous Coward · · Score: 0

    ...it's probably just coincidental, because all the schools have been mandated to teach the same contents!

    Whatever. All learning is copying anyway. And the idea that we "shouldn't" is just another primitive manifestation of that deranged IP regime. I'm just glad I don't get charged for every word I use that Shakespeare used before me...

    1. Re:You can't prove that!!! by Oligonicella · · Score: 1

      Puh-lease. All learning is not copying. The idea that we "should" copy is just a primitive manifestation of the deranged idea that stealing other's ideas and presenting them as one's own is success.

      I note that not a single phrase of Shakespeare's occurred in your post.

      Perhaps this lack of understanding is the crux of your outlook.

  149. But if you're going to do it wrong... by m00s3m4n · · Score: 1

    Might as well have a guide to it: http://mindprod.com/unmain.html

    1. Re:But if you're going to do it wrong... by Zarf · · Score: 1

      Personal favorite pet peeve:
      http://mindprod.com/unmainnaming.html

      28. o_apple obj_apple
      : Use an "o" or "obj" prefix for each instance of the class to show that you're thinking of the big, polymorphic picture.


      Love that one. I see it all damn day.

      --
      [signature]
  150. Re:Advice from a fellow student by FlopEJoe · · Score: 1
    Maybe a a little old school for y'all but, ala Heavy Metal:

    Zeks: Look, man, if there's one thing I know, it's how to drive while I'm stoned. You know your perception is completely fucked so you just let your hands work the controls as if you were straight.

  151. DO plagiarise code by joelethan · · Score: 1
    While it may not be good practice at programming, it is good programming practice.

    It's the most agile form of code re-use.

    You'll get marked down in Programming class but you should get EXTRA marks in Software Engineering. You could get a job at Micro$oft; on the downside you will get an 'F' in Software Patents.

    /joelethan

    Nothing to C here, move on.

  152. Re:Compiler Warnings by Rich0 · · Score: 1

    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.

    Nothing annoys me more than compiling an open-source app and seeing 100,000 warnings scrolling up the screen. Many huge projects have this tendency.

    I rum on the x86_64 platform, and sometimes I wonder if I wouldn't have nearly as many porting-related bugs if more people paid attention to complier warnings. (That and data type sizes...) Sure, the program might work without correcting whatever caused the warning, but just wait until you migrate to gcc 3.whatever...

  153. Re:Compiler Warnings by Anonymous Coward · · Score: 0

    Hey, as one of the (many? :-)) dinosaurs on slashdot, I take personal offense: I acutually DID learn to program in FORTRAN in high school in 1972...ah, those were the days...and IBM360 assembler...on punch cards...without monitors...:-) Ah, these young whipper snappers with their LCD monitors and Visual Basic...what do you expect when they are confronted with a REAL compiler like gcc? The nonsense I get from students who have been trained on VB, (and of course, even worse, using windoze) in high schools...sigh...our education system is doomed! ;-)

  154. Main things not to do by Anonymous Coward · · Score: 0

    - Don't use Microsoft products
    - Don't use C++
    - Don't use XML

  155. Hehe.. by Anonymous Coward · · Score: 1, Insightful

    Tripping on dextromethorphan and boosted by ephedrine.. that's Dayquil for you.

    It's not exactly LSD, but there's no wonder your logic was bizarre :)

  156. Re:Advice from a fellow student by kleinux · · Score: 1

    Since drinking alcohol would be frowned upon here I take the drink-crap-loads-of-coffee approach to feeling buzzed at work! Most days it does the trick. When it doesn't at least I can take lots and lots of trips to the bathroom.

  157. Re:Advice from a fellow student by Anonymous Coward · · Score: 2, Funny

    Yeah, because, as we all know, weed causes you to totally blackout for HOURS on end with no recollection of the evening *rolls eyes*

    BS.

  158. How To Measure Temperature by Anonymous Coward · · Score: 0

    Please, you bloody septics, learn to measure temperature properly. Like the rest of the world. Like this.

    -273.16 degrees = as cold as it gets ;-)
    0 degrees = water freezes
    4 degrees = water expands whether you heat it or cool it
    5 degrees = warm enough to wear short sleeves
    15 degrees = warm enough to wear short sleeves, even for nesh southerners
    20 degrees = verge of breaking into a sweat
    37 degrees = human body temperature
    60 degrees = a good washing temperature for cotton
    64.5 degrees = boiling point of methanol {wood alcohol}
    70 degrees = too hot for most living things
    78.5 degrees = boiling point of ethanol {grain alcohol}
    100 degrees = water boils


    Note, boiling points are quoted at sea level. In the mountains the atmospheric pressure will be less, so the molecules will have less opposition to escape, i.e. the boiling point will be lower.

    1. Re:How To Measure Temperature by Anonymous Coward · · Score: 0

      Please, you bloody septics,

      yeah, well at least we don't have blood in our septics often enough to swear with it. yuck!

    2. Re:How To Measure Temperature by Anonymous Coward · · Score: 0

      Why don't YOU learn to measure temperature properly? I don't care how the rest of the world measures temperature. This is correct:

      0 degrees = as cold as it gets
      273.16 degrees = water freezes
      310.16 degrees = human body temperature
      373.16 degrees = water boils

      If you're going to use Celcius, go ahead and use Kelvin instead, retard. At least with Kelvins, you don't have to deal with idiocies such as negative temperatures. The average kinetic energy of a substance can't be negative, so a negative temperature makes no sense. Zero temperature = zero movement = Absolute Zero. Any valid temperature scale should follow this principle. Failing that, there is no practical difference between Fahrenheit and Celcius other than popularity, which is not a valid reason to care.

    3. Re:How To Measure Temperature by I+confirm+I'm+not+a · · Score: 1

      Pedant: 0 degrees is either Celcius or Fahrenheit, or some other system. You meant 0 Kelvin. Kelvin's the unit, it doesn't need degrees.

      --
      This is where the serious fun begins.
  159. Before PC's by Anonymous Coward · · Score: 0
    that was the way all programs were written. And that worked pretty well when the programming languages and api's were simpler and well defined.

    Now, you absoutely have to have access to an IDE to look up api definitions and to write a bunch of testcases to figure out what the function really does, since the documentation is usually gibberish. Oh, and googling for examples of workarounds when you figure out how screwed up the function really is.

  160. Re:Advice from a fellow student by Jeremy+Singer · · Score: 1

    Never operate any machinery under the influence of alchohol or drugs. Even computing machinery. And certainly not chainsaws.

  161. Scare students into doing right! by relaxrelax · · Score: 1


    And remember, class, that every year I'll take one and only one work, the worse you produced, and sent it to the obfuscated C contest! And now let's review last year's winners of that dubious award:

    http://www0.us.ioccc.org/main.html

    Here teacher pretends that students from last year won IOCCC, and wants student to figure one which IOCCC program fits a class assignment *by looking at the code but not running it*. Or teacher pretents they didn't win, depending on your class... ...this way students remember what's a bad programming a bit faster than with a 'straight' method!!

    --
    Microsoft is pure dog-ma. FreeBSD is pure cat-ma.
    1. Re:Scare students into doing right! by Zen+Punk · · Score: 1

      Did anyone else understand that? Jeebus holy fuck that hurt my brain trying to comprehend the grammar...

      --
      Sleep is futile.
  162. Re:Advice from a fellow student by dfj225 · · Score: 1

    Boss: "Johnson! Why are there crude sketches of naked women and throw-up all over these design specs!"

    Johnson: "Company policy boss."

    --
    SIGFAULT
  163. Re:Advice from a fellow student by dfj225 · · Score: 1

    His name, Bill Gates. His windowing code: Windows 1.0

    --
    SIGFAULT
  164. Re:Advice from a fellow student by wolfgang_spangler · · Score: 1

    I actually disagree here (for school projects anyway). I have some of my best coding when hammered on wine my father made. I simply woke up with the laptop laying next to me and all the homework done, correctly, and COMMENTED.

    His wine tends to sneak up on you.

  165. Drunk Coding?Design Sober, CODE DRUNK by Anonymous Coward · · Score: 0

    Seriously I write my best stuff while drinking, when I was younger I used to do my assignments when drunk. Occasionally after a saturday night of drinking I'd jump into coding. it is great at like 3am on a saturday night you cannot talk but the code is a flowing.

    Not only can you code, but you can code three times as fast. The only issue is it must not be thought intensive algorithms, if you want good design and performance figure that out while sober. If you try to design something while you are drunk things get ugly, i was had a TA tell me that my program worked, there was no reason it should work but it worked. This man was totally dumbfounded by 200 lines of C++. I also find that you can come up with good ideas drunk. I have done some of my best thinking under the influence.

    As for waiting to the last minute, well if you can't code drunk this is a good substitute, nothing like a deadline to get the blood flowing.

  166. slashdot stats by minus_273 · · Score: 1

    look at the sats on the page . Quite interesting. So apparently 46% of slashdot is from the US? or only 46% reads the story? hmm

    --
    The war with islam is a war on the beast
    The war on terror is a war for peace
  167. Well, neither of those is an error (in C/C++). by wiredog · · Score: 1
    While I've never set blah=true in an if, it is legal and commonly done in for loops.

    Not having parenthesis in a pointer to function is fairly normal for functions that take no parameters.

  168. Let me expand on #1... by gosand · · Score: 3, Interesting
    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.

    AMEN BROTHER!!!

    Better yet, take a software engineering course if it is offered. Granted, it was back in the early 90's when I was in college, but my software engineering course was what got me my first job out of college with a big company. I took my senior project with me on my interview and showed it to the first person I talked to - she said "show this to every person that interviews you today". There was ZERO code for this project. What it did have was requirements, design, budget, test plans, mock-ups, documentation outlines, etc. All the stuff that is done outside of actual coding. This is how things work in the real world. It was the most important class that I took in CS. I probably won't be coding in Pascal any time soon, but I still use the principles I learned in that Software Engineering class.

    I will admit that it has been a while since I did any hardcore coding, but if you are doing any kind of project, design it first. Draw pictures. You'd be surprised how much easier it can be. I am still amazed after working in the industry after 10+ years how little software engineering education a lot of coders have. And there is a HUGE difference between a coder and a software engineer. Learn the concepts early and try to use them as much as possible. I couldn't write requirements to save my ass in college, but just the fact that I tried, and knew where they fit in the process made a huge difference. Do you know what a testing organization does and why? Where I work, we just got a set of issues out of a "lessons learned" session for our release that just went out. Many of the questions that came out of our development group were along the lines of "What does our QA group do, and why?" Some of these people have been coding for 10 years or more, and they don't understand why we have a QA group (QA and testing, which aren't the same thing)

    --

    My beliefs do not require that you agree with them.

    1. Re:Let me expand on #1... by jschottm · · Score: 1

      Draw pictures.

      One of the first things I did when I got my most recent job was make sure I had a good set of coloured pencils to draw with. Schemas, interface designs, network layouts...

  169. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    The best for this is absinthe - too bad you can't find it in the US, and only the crappy stuff in Canada. Good (European, or even South African) absinthe "quiets my brain" better than Ritalin, and without any of the annoying side-effects of Ritalin.

    Just remember - moderation is key (and not the Slashdot-type moderation). TA's *hate* to mark assignments covered in human "spewage". (Trust me on this!)

  170. I was a TA by Kombat · · Score: 1

    I was a Teaching Assistant (read: I graded assignments and tutored students) for an introductory computer course at my university. The course was affectionately referred to as "Chips for Dips," since it was intended for non-comp-sci majors (in fact, comp sci majors were ineligible for the credit). It taught things like how to use the Internet, how to use Word, PowerPoint, email, that sort of thing.

    Anyway, amazingly, some people couldn't even be bothered to learn how to "create a Word document describing your major, using 5 different fonts." Spotting copying was generally pretty easy. On more than one occassion, 2 students would pass in identical assignments, with only the name changed. The giveaway was that the copier had forgotten to change the student ID number on the assignment, which was still that of the person he copied from!

    --
    Like woodworking? Build your own picture frames.
  171. IF you want to cheat be smart!!!!!! by Anonymous Coward · · Score: 0

    it is very simple to defeat these systems because they are done by a computer. if you have someone else's source don't submit that rewrite it, use different variable names, different code structures. if it is a single block make yours functions, if it is functions make yours a single block. Change data types and use pointers instead of standard variables, use different data structures, use your own data structures. i have helped friends by rewriting my own code our wiz bang system could not detect the similarities because while the logic was the same, computers do not know logic. they know variable names, function calls, and program size. Clearly two very similar programs will be flagged because it will match the structure of the code or the variable names, function calls or structure of the functions.

    But if you reorder the code, change the functions and structure, that dumb ass autocheck will not discover it nor will a lazy TA or Prof.

    1. Re:IF you want to cheat be smart!!!!!! by Anonymous Coward · · Score: 0

      Yes, but what happens when someone copies your copied work? The original functions became blocks only to be changed back to functions. Variables named foo-bar, became bar-foo, are now foo-bar again.

      And i read it here somewhere, if you are smart enough to re-write it so you cant tell its copied, then you probably could/should have just written the assignment anyway.

  172. You'd like Knuth's "Literate Programming" by hildaur · · Score: 2, Insightful

    If you like this approach, you might want to take a look at Knuth's "Literate Programming." One place to start is http://www.literateprogramming.com/

    In either case, one needs to remember that too much can be as bad (or worse!) than too little. In real life, you may not always be the one to edit the code, and if someone edits the code but doesn't update the commentary, you can get into real trouble.

    -Hil

  173. Annoying bugs by Kombat · · Score: 3, Interesting

    Hahah, I know exactly how you feel. I wasted 2 hours on what should have been an extremely simple C assignment in university one day. Back then, we did our C/C++ assignments on a shared Solaris server, working on dumb terminals in a lab. I was getting some kind of strange exception with my C macros. So, I created a "test" program and copied over the guts of the logic of my app, so I could re-add the functionality piece-by-piece until my test app broke. This would allow me to isolate the code that was causing the problem.

    Only one problem: my "test" app didn't appear to be doing anything. It would run fine, with no error messages, and then exit quietly. In fact, it was producing no output at all. I began removing code, and adding printf()'s, desperately trying to get my app to say something, anything. After a couple of hours, I had stripped my "test" app down to little more than a "Hello, world" app, but it still wasn't producing any output! I would just type


    dragon:/home/kombat/> gcc test.c
    dragon:/home/kombat/> test
    dragon:/home/kombat/>


    Can anyone spot the problem? Anyone?

    It turns out that "test" is actually a built-in system utility for regular expressions, used in scripts. That was the day I learned what my $PATH means, why /usr/bin is at the beginning of the $PATH, and how one can use ./test to make sure that one is actually running the program in the current directory, rather than the system utility with the same name!

    That day ranks as one of my most stressful, and yet most educational, at university.

    --
    Like woodworking? Build your own picture frames.
    1. Re:Annoying bugs by Anonymous Coward · · Score: 0

      I once lost a few hours on a similar problem, also on a UNIX system. Someone had left an a.out in one of our main application directories. I kept recompiling my program to a.out and wondering why it didn't work. Finally I tried the very useful UNIX command (actually a shell built-in) which a.out. After that I was very thankful that the other a.out didn't do anything drastic. In fact, it appeared to do nothing. And I never did find out which slob had left the garbage in a directory on the search path for 20 programmers.

    2. Re:Annoying bugs by Anthony+Liguori · · Score: 1

      Actually, there are a few problems with your code.

      gcc test.c

      Will produce `a.out' not `test'. Now, at University's the network admins tend to be dumb and like to place '.' in the $PATH.

      This is pretty evil. If I'm root and I change into one of your directories, and let's say this directory has a ton of files in it. If I executed a simple command like 'ls' and had '.' in my $PATH, you could have an 'ls' in your directory that would be executed as root.

      This is why we use ./test. It's not so much because of shadowing (you could always stick '.' in the beginning of $PATH if you were worried about that).

    3. Re:Annoying bugs by Anonymous Coward · · Score: 0

      Nothing wrong with having '.' in your $PATH, as long as it's last in your $PATH.

    4. Re:Annoying bugs by Anonymous Coward · · Score: 0

      What if there's a malicious executable 'x' in the directory and you expect 'x' to be installed on the system? The risks with . in the $PATH usually apply to root, but really ./ isn't hard to type OR remember, so there's no really good reason to have it there.

    5. Re:Annoying bugs by Anthony+Liguori · · Score: 1

      I can't tell you how many times I mistype a common command.. like `la' instead of `ls'. Having '.' in your $PATH would allow a malicous user to take advantage of that.

  174. Value of Readability by justanyone · · Score: 2, Insightful


    THE MOST IMPORTANT THING FOR YOUNG PROGRAMMERS TO LEARN IS READABILITY.

    Yes, code must work, it must error check and be stable. Good design is an obvious requirement. But, too many young programmers don't know the true value to business of code readability. I'm a 15-year veteran primarily in C, C++, Perl, Java, and alas, Cobol. I've seen crappy code for years as a contractor, coming in to fix problems or add features.

    The statistics on business costs bear me out. Nearly 50% of the cost of a program is incurred during the long in-use / maintenance phase. There are definite rules for making code readable and they should be taught early.

    Practice during programming classes should include:
    * Code reviews - other people looking at your code;
    * Code reviews - reviewing other people's code and asking lots of questions;
    * Style guides - rules re: what coding style (where to put curly braces, for one) to use on a project are common, be prepared for them;
    * Simplification paradigms - stuff like avoid do_while loops since they're seldom used and often just confuse people;
    * Reliability lessons - lessons like don't use while(1) loops with breaks, rather for(1..n) with an overlarge n and subsequent test if N got big to know if things failed;
    * Max Subroutine sizes - too often violated but a bigger deal than you think;
    * Global variable minimization - sometimes it does make it simpler to use a global variable, just keep it to a minimum;

    Lots of these rules apply. SIMPLIFY! SIMPLIFY!
    It speeds up everyone's life.

    --Kevin

  175. Re:Advice from a fellow student by turgid · · Score: 1
    Do not, under any circumstances, code under the influence of alcohol.

    I find that usually the only way I can slow my brain down enough to write code is to consume alcohol.

    My best code is written under the influence of moderate amounts of red wine (usually Merlot). By moderate I mean between 30-50% of a 0.75 litre bottle, sustained over 2 hours. Any more and I become too tired. Beer is no use. It makes me too lethargic and happy. I listen to heavy metal instead.

  176. True story by markov_chain · · Score: 3, Funny

    In an algorithms class (about 60 students) at my school there was a big challenging programming assignment mid-semester. The prof and the TAs caught a couple of people cheating, like 3 or so. Now this was a cool prof who didn't want to get kids kicked out of school so he decided to give them a second chance. On the final, there was a question worth 1 point stating "We found some cheating last month. If you did it, confess and you only fail the course. If you don't confess, we'll get you kicked out. Did you cheat? (1)"

    Half the class confessed.

    --
    Tsunami -- You can't bring a good wave down!
    1. Re:True story by The+Phantom+Mensch · · Score: 1

      In my freshman year CS 101 class the final exam was to code a simple program in class during the last regularly scheduled lecture and hand a copy over to the professor, then take your own copy of the code home, copy it into a computer, get it to work during finals week, and resubmit it. You would be partially graded on how much change you had to make to get it debugged.

      The only trick was that there were two sessions of this class, at 1:00PM and 2:00PM, and the final exam programs for each were different. Supposedly, half of each class flunked the course because they resubmitted perfectly good, working examples of the other session's programming assignment.

  177. Assignment Copy Detection by SoTuA · · Score: 1
    Back when I was "profesor auxiliar"(*) at the Uni for introductory Algorithms and Data Structures, we had this nifty copy-detector that was very reliable. It counted similarities in keywords, such as how many (if|else|String|char|{|}|++|=|etc) were on each file. An 70% similarity warranted close inspection, by hand. Normal assignments ranged between 10% to 40% similarity. Classic variable-name changers and reindenters pegged 100% :) (and got some righteous wrath from the professor).

    (*) Profesor Auxiliar is a student who already has already passed the class/course, usually with high marks, that does practical classes (as in "problems like the ones you are likely to see in the written tests" or "some tips for this week's assignment") to complement the professor's theoretical classes, and usually runs the "accounting" (grades and all that), takes care of the course website, that thing.

  178. Same thing happened... by SoTuA · · Score: 2, Interesting
    On the #1 assignment, there had been rampant copying, and the professor was mightily pissed off. Usually, when you catch someone cheating on an assignment, they get a 1.0 score (in a scale between 1.0 and 7.0) and a warning to frikking behave, although the rules say that every cheater must be sent to the Rector and get a "sumario" (kind of a "trial", don't know how that translates) whose biggest consequence is get kicked out AND banned from the biggest universities in the country for two years. Since that's really harsh, most teachers don't send people to sumario unless there cheating is way overboard (i.e. sending in someone to do a test for you or the like).

    It happened that this time, the professor had been appointed as "Director de la Escuela", and, as an official of the Uni bureaucracy and not just "a professor", he was bound to apply the rules to the letter. So we had to (I was TA) hand out a sheet of paper during the first test and I told them "people, we're onto you. We have tens of cheaters (from a 100-people class) indentified in assignment #1, and this time, you are S.O.L. because the prof is ALSO the director, so he's bound to send you straight to the rectory, instead of marking you with the customary 1.0. In this paper, you can write your name if you admit to copying the first assignment. You'll get an 1.0 score on that, and at the end of the course you'll have to do a "live assignment" in the computer lab with the prof perched at your shoulder to prove that you learned something in this class.".

    Almost all the identified cheaters turned in, and a hefty quantity of unidentified cheaters turned themselves in, and even some people turned themselves in for the #2 assignment!

    Another funny one, at the final examn of a course, when I (I was TA) said "ID will be requested while the test is in course, please place your University Card in your table next to you". I had just finished saying this when I saw one of the students jump out the window (it was a 2 meter drop to the grass outside). Never figured out who he was subbing for. (Whoever he was, he failed the class, since we customarily let the students who have an average such that an 1.0 in the final will still give them a passing grade keep their average and skip the final)

  179. How to Write Unmaintainable Code by scovetta · · Score: 1

    Isn't this article a bit like the classic, How to Write Unmaintainable Code?

    --
    Wer mit Ungeheuern kämpft, mag zusehn, dass er nicht dabei zum Ungeheuer wird. --Nietzsche
  180. Re:Advice from a fellow student by coyote_oww · · Score: 1
    My motto: code drunk, debug sober

    I'm guessing you do a lot of debugging.

  181. Re:Advice from a fellow student by kin_korn_karn · · Score: 1

    why do that when you can work effectively drunk?
    As long as you have someone to drive you around, of course.

  182. Do they still teach Assembly language? by TheSync · · Score: 1

    Do they still teach assembly language to CS majors?

    I was doing some PIC microcontoller programming recently and was remembering indirect addressing and thinking "jeeze, I haven't thought about that since college, where they were teaching us the assembly language of the PDP/11."

    1. Re:Do they still teach Assembly language? by Anonymous Coward · · Score: 0

      YES :(

    2. Re:Do they still teach Assembly language? by TheRaven64 · · Score: 1

      My undergraduate degree didn't require any real assembly, but we did have to write algorithms for unlimited register machines as an example of a universal model of computation, and write a compiler that outputted assembly for a simple virtual machine.

      --
      I am TheRaven on Soylent News
  183. This wont help anyone by Anonymous Coward · · Score: 0

    It's a funny read for experienced coders, but to the newbies who actually do some of these mistakes, I find that the whole sarcastic angle to the article would just go over a newbie's head without them really understanding what's sarcasm and what is not.

  184. One of My Favorites... by Etherwalk · · Score: 1

    I had a graphics program I had written that inverted color channels every once in a while for no reason I could identify- specifically, red and blue would get swapped, green would stay the same. The problem eventually turned out to be with the following function call: foreach(pixel) { putpixel(x,y,arr[n++],arr[n++],arr[n++]); } arr was an array with r,g,b data for all of the pixels on the screen. As you may have guessed by now, for each iteration through the for statement, because the compiler pushed function parameters onto the stack in reverse order, the final arr[n++] was evaluated before the first one, so r,g,b were pushed on by the caller and r,g,b was popped in the callee, swapping r and b. The bugs I love (and sometimes hate) are the ones that make you think a bit about what's actually happening. The other ones that come to mind are having a C++ function of a non-instantiated class work without complaint (it was a small method that turned out not to rely on any data in the class, so it didn't matter that the this pointer was filled with garbage), and a story I recall about someone having a problem in an old Fortran program where they had set 4 equal to 2 at some point in the program, and every 4 after that was interpreted as a 2...

  185. They Missed One Thing by $criptah · · Score: 3, Insightful

    Computer Science is a good major to be in. It is useful, hard and interesting at the same time. However, given the fact that IT job cuts are on the rise, students should learn more things than just coding.

    I am a recent CS grad. I work in the field and yet I am thinking of getting a second degree that is not related to computer science because I realized that in several years developers who know only one thing -- that is coding -- will become extinct. What you need to teach CS students is how to develop valid and correct solutions that can be used by real people and businesses. These solutions must be well designed first; then developed. If I got a cent for every piss poor designed program that I have seen in my life, I'd be Bill Gates :)

    Developers solve problems with code; however, just because you have an ability to write a program does not make this program a valid solution! I have noticed that there are too many people with excellent software engineering skills that are simply out of touch with reality and its business side. If your "cool" program does not solve a problem it is absolutely useless in the real business world (the world where you get a pay check for what you do).

    Despite being relatively young, I have been employed in the field during all downturns. I managed to survive using only one rule: you must come up with solutions that are valuable for customers who are willing to pay for it. Unfortunately, many of the recent comp. sci. grads do not understand this rule. Instead of focusing on real life and its business needs, they spend their time learning languages without even knowing what these languages are good for. Then they use wrong tools for wrong tasks. My favorite example is my friend who used J2EE to build a site that could have been (and should have been!) done in PHP. He spent half a year on the fucking thing just to realize that a simpler solution could do everything that he wanted!

    Then there are people who run into terrible coding problems because their design is flawed. For some odd fucking reason people never think before they start implementing. I use one great rule: software engineering does not provide efficient solutions for some of the problems. Period. Too many people jump into coding without even thinking about the problem. They waste their time on something that can either be done manually with lower cost OR cannot be done at all. The worst thing is that most of these people are afraid of throwing their initial design away and starting from scratch...

    With this in mind, here is what I think every comp. sci. student should know:

    How to meet business needs with software engineering. How to "read" requirements and come up with solutions that meet them.

    How to realize that your design leads to implementation problems and when to throw such a design away.

    A well-written program is good. A well-written program that meets customers' needs is better.

    How to use a right tool for the right task.

    How to become employed and stay employed.

    How to use computer science in various aspects of real life. When I am talking about real life, I am talking about something useful that can be actually used by people. I found out that this can be achieved by taking a second minor or getting a second major that is not related to technology.

  186. Paper vs Screen by jacoby · · Score: 1

    When I code at the computer, I tend to work in clumps, making this work, then that, then the other, and it works, but it's ugly and I get stuck in the minutia rather than the big picture. When I print out the code and think through it, I tend to work out what I don't even need and what would make it all more elegant.

  187. Re:Advice from a fellow student by codefreez · · Score: 1

    This is good advice. I'll get stressed out during some assignments, mix up a cocktail and continue coding. I make really good progress and then hit some magic point where I just don't care.

  188. Almost got nailed by your checklist by Just+Some+Guy · · Score: 1
    I did a lot of my group assignments with a friend, Aaron, who tended to solve problems in pretty much the same way as I did. We even worked through some of our individual assignments together by using each other as a sounding board (but doing the actual work ourselves).

    On one particular assignment, Aaron and I turned in exactly the same code. I mean, down to the indenting and variable names ("numberOfCallers", "totalWaitTime", things like that). What probably saved us was the fact that we turned in our hardcopy program listings at about the same time, compared homework to see how we'd each approached the problem, and got completely shocked and flustered when we realized that we were probably getting ready to fail the course for plagiarism.

    Fortunately, our teacher knew us well enough to believe our hasty and obviously on-the-spot explanation and let it slide. If we'd been freshmen who didn't know our professors, or if we hadn't caught the problem ourselves before the teacher found it, I'd probably be posting this to Fark from my Assistant Manager's cubicle instead of Slashdot from my Senior Programmer's office.

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:Almost got nailed by your checklist by Surt · · Score: 1

      Failing one course for a false accusation of plagarism or even getting kicked out of college wouldn't stop someone with talent from reading slashdot and becoming a senior programmer with an office.

      --
      "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  189. Re:plagarize code from Many.... integrate and deli by Anonymous Coward · · Score: 0

    "Absorb what is useful, Discard what is not, Add what is uniquely your own" -- Bruce Lee

  190. Re:Advice from a fellow student by XPisthenewNT · · Score: 1

    He probably took five minutes to download the code from the internet, then passed out...

  191. Cheaters Always Prosper by Anonymous Coward · · Score: 2, Insightful

    Yeah, well if the college actually followed through and expelled plagiarists maybe people would think twice before doing it?

    Over half of my networked operating systems class was caught cheating on a machine problem (write a UNIX shell with job control and I/O redirection). The professor announced this during class and said whomever came forward wouldn't face any punishment. The college handbook clearly says that this is an offense that may result in explusion from the University. What happened? Not only did the University not expell any of these students, the professor wouldn't point them out in class so the rest of us knew who they were.

    During an exam for a linear algebra class, I saw students pulling crib sheets out of their backpacks and placing them between their feet during the exam. Surely the proctor saw this (~35 students in the class), but nothing was done.

    If colleges want to cut down on cheating, they need to start enforcing their own policies.

  192. Re:Advice from a fellow student by Anonymous Coward · · Score: 1, Funny

    What about doing a hypercard implementation of Daleks while on LSD? Does that count?

  193. Recycle Variable Names by wayward · · Score: 1

    In the spirit of the original article, recycling isn't just for Mountain Dew cans! Try to reduce consumption by reusing names of variables as often as possible. Sometimes you can even use the same names for global variables, local variables, and parameters! Confusion shouldn't be a problem, since scope is obvious to a good programmer.

  194. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    Actually, really good bud can do that to girls. I've seen a couple get all loopy and not know where they are after smoking a couple of bowls.

  195. Re:Advice from a fellow student by Anonymous Coward · · Score: 1, Funny

    Actually, really good bud can do that to girls. I've seen a couple get all loopy and not know where they are after smoking a couple of bowls.

    Uh dude... they're just pretending. They're acting like that because they want you to fuck them.

  196. Learn what memory is by Jucius+Maximus · · Score: 1
    Honestly I find that the biggest problem in second year CS is that the kids don't know what memory is. If they would just take the time to understand the difference between a variable, an address, an address that is stored in a variable, and the address of a variable, I think 90% of stupidity would be eliminated.

    Lots of us figured out the concept of a pointer about 20 seconds after it was introduced to us, but still I constantly see people struggling with simple things like linked lists, segfaults, null pointers, malloc(), free(), sizeof(), and such thinking that it's a syntax problem. No! Just understand the difference between a variable and the address where that variable is stored, and know where to use each one and then your problems will vanish!

    1. Re:Learn what memory is by MrPink2U · · Score: 0

      Honestly I find that the biggest problem in second year CS is that the kids don't know what memory is.

      Maybe they just forgot. Hehe...

  197. Re:Advice from a fellow student by wuice · · Score: 1

    I used to get stoned every day at work and would code like a madman. Of course, it was just Cold Fusion.

    Some parts of scripting/programming may be exciting, but a lot of it is pretty dull and mind-numbing. That kind of work is always more tolerable high.

  198. Publications by Anonymous Coward · · Score: 0

    I clicked on Mavaddat's "Publications" link. Apparently he doesn't have any...

  199. Re:Advice from a fellow student by Anonymous Coward · · Score: 1, Interesting

    Ah, yes, the war stories...

    I once worked with a guy who spent several days trying to solve a difficult coding problem, and wasn't getting anywhere with it. Then, he injured his back doing yard work and came to work high on painkillers. He coded up a working solution to the problem. Days later, he looked at it again and couldn't figure it out. He ended up putting in a comment, something like "I don't understand this, I was on drugs when I wrote it, but it works: DON'T MESS WITH IT."

  200. What not to do? #1 by Billly+Gates · · Score: 1

    If you are not an Indian in India change your major.

    Otherwise fixing slurpie machines at 7-11 may be your ultimate career goal when your done.

    1. Re:What not to do? #1 by superpulpsicle · · Score: 1

      Definitely DON'T be a CS major in the U.S. Be a MIS major or IT or anything to help you graduate and get that piece of paper.

      The one thing I learn is... most professors have never seen the light of day from the corporate perspective. You can be a master in C++ in your class, and be useless if a company deploys xml and some other language.

      $30,000 tuition is alittle too expensive for learning concepts. You can get that from a $50 C++ book. Be smart, graduate fast. Don't ever look back.

    2. Re:What not to do? #1 by Billly+Gates · · Score: 1

      PS the MIS and MBA majors will go to India next when businesses realize they can cut the lag in communication by having teh whole project oversea's.

      Not real safe either.

  201. Re:Compiler Warnings by introverted · · Score: 1
    Sure, I click submit and THEN I find the answer from Google.

    Well yeah. Of course. That's the nature of the universe. The only sure way to find a piece of information is to give up all hope of ever finding it. :-)

    I've tried using pragma warning(disable:4786) many times with no luck (It has no effect, even as the first line of stdafx.h). I'll try this "long static" approach when I'm back in the office. Thanks!

  202. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    That explains the state of design specs and documentation, now doesn't it?

  203. Re:Advice from a fellow student by Pandion · · Score: 1

    Most of my best comments were written as a result of alcohol... I liked to think seeing: //Drunk. fix later.
    would cheer up those poor TA's miserable lives.

  204. Advice to a student by dsplat · · Score: 1
    You have some good points. As Prof. Tolkien once said, "The tail grew in the telling." Keep track of those ideas and keep expanding on them.

    DO NOT comment every line. Seriously. Comments are a good thing, but when you comment every single cin and cout, every single bracee and function call, then it can make it a lot harder to find what you are looking for. A good rule of thumb I tell people is to comment every line you have to think about for more than 30 seconds, comment every function and class, and comment every block of code that you have to spend more than 2 minutes pondering over.


    Writing good comments is a skill or possibly a set of related skills. One of the things that good comments can do for you is help you find things. They should work with your tools. Putting the right words into your comments so that you can find them when you tell your editor to search for them is invaluable. That's why I correct misspellings in comments. I'm going to search for some of those words some day, and I intend to spell them correctly.

    If you've ever worked with code that has gone through several revisions, you know that what things are called in the docs and the GUI is not always what they were originally called when the code was first written. Either change the names in the code, or at least put in a comment that explains the mapping. It will help to preserve your sanity.

    If you miracously fix something, understand why. Students seem like they can not resist randomly moving code around, and sometimes this does fix things. If this happens, take some time to understand what you moved and why it might have fixed the problem


    Use some kind of version control. If you have nothing else, store old versions somewhere. Better still, install CVS. Figuring out what you changed and why it worked is going to be at least partly a guess if you don't.

    One of the best projects I had as a student was one where the professor required us to subject a prototype after a week. He responded to the prototypes with a few small changes to the requirements. He had warned us that that was the intent of the exercise and that we should make the code maintainable.
    --
    The net will not be what we demand, but what we make it. Build it well.
  205. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    It was the Pot fairy. It does things like this from time to time. Like when it knocked up Mary in the bible.

  206. Variable names aren't magic bullets! by Mr+Z · · Score: 1

    Hear, hear!

    I'm someone who deals with optimized code all the time, and for good reason. When you're programming an embedded system and you're trying to tweak every last penny out of it, you're in a different world than the "throw a faster Pentium at it" crowd.

    Personally, I prefer mnemonic variable names that aren't terribly long, and fairly uniform in length. I find that the physical layout of the code communicates as much or to me than verbose variable names.

    It's much easier to look for i, j and k as loop iterators too, than "arrayIndex." It lets me skip the carrier and get to the signal. IDIOMS ARE YOUR FRIENDS!

    Anyone else find it ironic that mathmeticians make their language as terse as possible, whereas computer science (which is really applied discrete math in most cases) wants us to be as verbose as possible. Maybe more people would find math more approachable if it were a little more verbose.

    --Joe
    1. Re:Variable names aren't magic bullets! by EnderWiggnz · · Score: 1

      actually, i try to never use i,j, or k as they are too common, and screws up searching.

      try ii, jj or kk , and suddenly you can search and find your iterators very quickly.

      --
      ... hi bingo ...
    2. Re:Variable names aren't magic bullets! by Erik+Hollensbe · · Score: 1

      What I've always found funny is that math uses these terse definitions that take up a line of text, and then spends the next 6 chapters defining them.

    3. Re:Variable names aren't magic bullets! by Ed+Avis · · Score: 1

      Yup, picking well-chosen and meaningful variable names does not mean making them as long and clunky as possible. Often 'i' is a good choice for a loop index, and 'msg' is probably better than 'message_string' (or worse, 'myMessageString' etc).

      --
      -- Ed Avis ed@membled.com
    4. Re:Variable names aren't magic bullets! by Erik+Hollensbe · · Score: 1

      I agree, but it's a delicate balance.

      I find a mutated hungarian notation works well because I get the description and the type. A mutated hungarian notation is required by perl, one of my favorite languages.

      However, I've seen code like this,

      Person pJoe = new Person();
      ChildofPerson pBilly = new ChildofPerson();

      and everything's great until...

      pBilly.parents()[0].equals(pJoe);

      if Person doesn't have a parents() method, and you're trying to read this, a comment is required. One could prefix the variable name with cp instead of p, but up until this point it was intended to be abstracted away from you.

      The problem is, otherwise this is pretty descriptive. We have two people named "Joe" and "Billy", and whether or not one is a child is insignificant. However, some other joker came in later and needed to make sure the relation between them was a parental one, but didn't change the name.

      While this is mostly a maintenance issue, it's common, and descriptive names only work in this case with the most diligent of programmers.

      If you want a real world example of how this seriously sucks ass, think about what your database schema looked like when you were hired, and how it looks now, and the changes that have been made to those functional parts. Rarely with the push to launch has the structure changed, but the functionality will change drastically. It also makes working in third normal a nightmare.

    5. Re:Variable names aren't magic bullets! by cloudmaster · · Score: 1

      Some of use use languages that prefix variables with a key, such as $i. :)

      Anyway, if you're looking for iterators, they're probably within a loop, and you can pretty easily find the beginning/end points of a loop through other means. That gives you a point to start and stop searching, which makes things quite a bit easier if you're using a real text editor. I can't think of a time at which I've ever wanted to search a whole program for the names of localized iterator variables...

  207. Diebold by drumsetdrummer · · Score: 1

    It's too bad Diebold didn't read this before launching electronic voting machines in Florida.

  208. How Pertinent by vivin · · Score: 2, Informative

    Coding Style

    One thing I've noticed, well at least the university I went to (Arizona State - ok I've heard all the jibes), is that there is not as much emphasis on coding style as there is in just getting the assignment done. This article is essentially talking about the bad habits that students develop, and mostly this is due to insufficient emphasis on good coding style. I had been writing code for almost five or six years before I started college, so it was second nature to me. However, some of the people I met hadn't written a single line of code in their life. They were genuinely interested in CS (but there were some who were in it just because "CS people make a lot of money"). Most first year programming classes that I know of, just give you to tools to the language without telling you how to use it well. It's like you know English, but does that mean you can write a really good Story, or an Essay that is grammatically correct all the way? No, it takes training - and that is what I think some of these first year classes fail to provide. Sure, later on in your CS/CSE degree you may come across a professor/class that emphasizes good coding style, but by then some of these bad habits may be so ingrained. Like for example, I have seen C programs without ANY indentation. How terrible is that? Whitespace is awesome - use it liberally.

    I was lucky enough to have a good professor my first year in college. I rememember that he eschewed the use of "goto's" (ok I have heard enough debates on this). His reason was that many students simply did not know how to use them right, leading to the inevitable spaghetti code. Also since we were using Java, it wasn't possible anyway.

    Anyway, my point on Coding Style is that first year classes should emphasize that point so that students can learn to write programs that are easy to debug and document.

    Proper Specs, Writing Algorithms, Documentation, and Knowing what your code does

    I can't even begin to say how important this is. The major problems (some) Engineers have is that they write terrible comments, or none at all, or cryptic ones. I have come back to code that I wrote months ago and I have had a hard time deciphering what it is that I wrote. Documentation may seem like a pain, but in reality it makes the maintenance of your code more effective. Also, in an industry setting if someone else has to come along and look at your code, it makes it easier for them. How many times have you had to go over someone else's code and found no comments, or terribly obvious ones like:

    i++; //increment i

    I took an assembly language class in my sophomore year, and another one in my junior year - they were required courses. The prof in the first class was a former student of the prof in the second class, so they had the exact same methods. They had three main emphasis points:

    1) Algorithm
    2) Program Size
    3) Documentation

    Both these professors gave our excellent specs on our assignment (something more professors should do). They were extremely detailed and they exactly told us what was expected. In addition to this, they graded on program size and execution time. This prompted (most of) us to create efficient algorithms. I have to say that usually I'd just jump into the code and start coding, with a hazy algorithm in my mind. This time, I really had to sit down and come up with an algorithm. I discovered that it made my coding process much easier. It's better looking at your algorithm in paper and the comparing it to your code than doing it in your head. Their final emphasis was on documentation. 20% of the points for a lab assignment was for documentation. We had to provide an introduction/user's guide for the program. By reading it, any person should know WHAT the program does. Secondly, we had to provide an internal overview. This is esesentially the description of the algorithm that we use. Any person, by reading the internal overview, should have a good idea o

    --
    Vivin Suresh Paliath
    http://vivin.net

    I like
  209. Advice from an Employer by ewanrg · · Score: 2, Interesting

    OK, this article pushed a couple of my hot buttons since I get to see the results of the "good" schools during interviews almost every week (and if you're willing to live in San Antonio and know Hibernate, go ahead and email me).

    First, because of all the concern about "cheating" I often spend weeks getting recent graduates to work on teams. The idea that sharing and collaborating on code is "OK" is so foreign to them, that I get people who won't show their work to anyone.

    Next, because they have learned that the instructor "has the answer", they will come up to me and ask me how to solve the problem I asked them to work on several days ago. I work at a research institute, and if I knew the answers I wouldn't have bothered asking in the first place. I can help you figure out ways to find the answers, and suggest sites to look for examples of code that might solve similar problems to use as a guide (oh, but there's that cheating problem again), but if I have to figure out the answer for you, then why am I paying you a salary in the first place?

    Finally, and I think I've seen this a few times in this discussion already, there's people skills. No program seems to bother to teach folks how to talk in front of a group, and if they do it's to tell them how to cover their Powerpoint slides. Folks, if I can read (and I wouldn't be where I was otherwise), I don't need you to recite your slides. I need you to tell me what you couldn't put on them, or to expand upon the couple bullets you have on each.

    Sorry, but when I see how what people learn in school makes them start out on the wrong foot in the "real" world, it does get a little upsetting.

  210. Re:Advice from a fellow student by JDonahoe · · Score: 1

    No way. The first time I wrote decent linked list code was the same night I got drunk for the first time.

  211. Re:Compiler Warnings by Anonymous Coward · · Score: 0

    I eventually moved on to running another team in another part of the company - who were prepared to listen ...

    I guess all the companies I've worked for are bad companies. I end up being the only one who complains about people checking in changes that break a compile, or don't run, or generate a crapload of warnings, or don't document... etc. I thought that type of attitude (theirs not mine) was standard at all places.

    Can I get a job in your group?

  212. I want my 2 minuts back by Anonymous Coward · · Score: 0

    That article was a complete waste of my time. It was neither insightful nor humorous. Somebody owes me 2 minutes of life.

  213. Re:The best advice[sic]-off topic but by Politburo · · Score: 2, Interesting

    Most plumbers, electricians and carpenters are not capable of running a business because they lack the organisational and IT skills that are needed nowadays.

    Nice subtle dig at manual laborers. Most carpenters, etc., run their own businesses, and do quite well, so I'm not sure where your observation comes from. You don't need IT to run a carpentry shop or install some pipes.

    If you are capable of doing comp sci and becoming a plumber, you could end up running Kohler...well, I exaggerate a bit

    You exaggerate a lot. Big companies no longer use people familiar with the market for management. They use managers with MBAs. The days of coming up from the mail room to the board room are gone.

  214. Re:Advice from a fellow student by Soul-Burn666 · · Score: 1

    I don't know what it is with everyone and comments!
    If you write code that is well written and structured, the amount of comments needed is very low as the code is self-documenting.
    Ofcourse comments as to how to use a function should always be there, even if the function name gives a clear understanding of what it needs to do.

    In my opinion, comments aren't needed when the code is clear and structured. It's much better than having cryptic logic, and stupid comments since then neither the code is readable nor are the comments really explaining it.
    More likely than not, someone who can't write at least half-decent code, also won't be able to write good comments, as the programmer's logic might be clear to him and so will his comments be in that way of thought, but other programmers won't understand either.

    --
    ^_^
  215. LSD, on the other hand... by Anonymous Coward · · Score: 0
    Do not, under any circumstances, code under the influence of alcohol.

    is the way to go!

    At least in small quantities... it gets a little tricky when your screen is melting...

    This method works even better for humanities papers...

  216. Re:Advice from a fellow student by hobo2k · · Score: 1

    Right, he never found any bugs in the code. Just features.

  217. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    Actually, it happens to some of us. Everytime I tried pot, the following 3-6 hours was a total blank. Friends would tell outrageous stories of the the stupid things I had done and said, but I remembered none of it.

    Naturally, since I couldn't remember having enjoyed myself or not, I gave up on the idea of smoking pot after the three tries.

  218. Re:Advice from a fellow student by Anonymous Coward · · Score: 0

    "A friend of mine" ---> the usual excuse when I need to tell a funny story but I feel too embarrased to accept it :)

  219. I agree by billybob · · Score: 1

    Yah, that's fine, and that's what I do - I didnt go into enough detail. First, I write the code that will utilize methods that dont exist. Then, I write the classes and create dummy methods, that dont do anything yet, but have comments describing their purpose. I usually dont do the return statement though, because there's usually quite a while before. The basic point of my original post was that this apporach is very useful if you know some basics. Adding in return statements is fine and dandy if thats what you want. :)

    --
    Joseph?
  220. Tools, Tools, Tools!!! :D by tshak · · Score: 1

    First off thank you for taking the time to reply to my post. Awesome detail - not something I'm used to on these forums.

    ...if you're working in a group where each developer gets to choose their own editor...

    Every project I work on mandates the use of a consistent toolset with consistent parameters (I've been repremanded for using tabs before). The purpose of this goes way beyond this particular subject. I believe strongly in the enforcement of this as I've seen it work very well. On the other hand, I appreciate that distributed projects without central management (eg. many OSS projects) do not have this luxury. I would maybe reconsider if I was in this position.


    This is very easily mitigated through the mechanism I've already demonstrated:
    if(i<50) {
    synchronized(this) {
    try { ...
    } catch (Exception e) { ...
    } // end-catch
    } // end-synchronized
    } // end-if


    end-if? - Which "if" am I ending? I still need to scroll up to figure out which "if" statement I'm looking at. All this comment tells me is that this close brace _might_ be the close to _some_ if statement. The reason that I say "might" is because that comment can go out-of-date accidentally and confuse me even more (for example, the "if" is changed to a "for" but the ending brace comment is never changed).

    It all comes down to my philosophy that tools should be helping us solve these problems. If the tools that are being used are inadequate (vi, pico, notepad, etc...), that does not mean that we should invent ways to clutter (IMHO) our code, it means that we need better tools. Again, VS.NET takes care of spacing braces properly even accross different tab or no tab settings (it reformats to the local settings). I can't believe that it's the only tool that does this. And even if I'm incorrect about VS.NET's "close brace info" feature, doesn't that sound like a better solution than a vague and potentially inaccurate comment? Maybe the OSS tools that we're using should consider this feature. I'd rather spend my time improving the tools in this regard, and especially with the OSS tools we have the opportunity to directly make these improvements. And again there are many reasons, this issue being one of many, why a consistent toolset for a development team should be required. If a developer on a non-commercial OSS project wants to read the code nicely, they can still choose to use the tools that make it easier.

    Thanks again for conversation. This is a fairly subjective topic but I'm sure you agree that it's important to think about and discuss different opinions as it affects code quality and ease of maintainability.

    --

    There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
  221. Reminds me of MicroSquish by Anonymous Coward · · Score: 0

    This article basically seems to be the motto of most developers at Microsoft. They barely grasp the fundamentals of programming, so why bother with anything else? They just assume more code will solve their problems, or that they will just go away on their own.

  222. Another classic bad habit by Anonymous Coward · · Score: 0

    At the University of Newcastle(in Australia) where I was a tutor for a 2nd year Web Engineering course (using JSP), the students didn't have too much experience with Exceptions (in their Javabeans) and hated the way the exceptions always stopped the execution.

    So my addition to the ironic programming advice would be: Can't get rid of those damn annoying exceptions? Just put "try catch" blocks around ALL your code and either just have a basic console print statement in the catch area such as System.out.println("error"); OR to be even more professional, have NOTHING in the catch area! This way your console wont be filled with unprofessional error messages AND you wont have to deal with those annoying exceptions anymore!

    Then when your program seems to be acting REALLY bizarre, first hack away at it to the point where it will in fact do something that resembles a half working state, then throw it to your tutor and ask him to fix it. Finally sit back and watch as he pulls his hair out discovering the myriad of exceptions being generated and ignored left right and centre...

    Yet to this day, i still work with people who should know better then to put try catches around EVERYTHING and then have absolutely MEANINGLESS catch code that actually gives less information and achieves less then actually just letting the exception go uncaught and bubble up to the screen or console!

    Classic line people tell me when looking at my code: "Why on earth are you purposefully throwing an exception?? What could that possibly achieve??!!" - having no idea that i'm actually catching it in a carefully planned area.

  223. Re:i thought it was going to be something serious. by norkakn · · Score: 1

    Make the f^&$ers take an HDL course and learn verilog

  224. What language were we speaking? by $javamaniac · · Score: 0
    Juan Ramón Jiménez: Spanish poet who won the Nobel Prize for Literature in 1956. He liked to flaunt spelling rules...

    No he didn't. He liked to flout spelling rules. To flaunt spelling rules, he would have to adhere to them meticulously and conspicuously, because flaunt means a gratuitous display of something - for example, driving a fancy car in Harlem is flaunting your wealth, or wearing snug yellow spandex over impressive cleavage flaunts another kind of asset.

  225. a bit presumptuous, aren't you? by bodrell · · Score: 1
    I'm an engineer. When I specify a quantity, I generally specify units. A degree can be an angle measurement, too, if you aren't more specific.

    I live in the US and work in a lab on a daily basis. That means I use both Fahrenheit and Celsius (or Centigrade) on a daily basis. That means if I write a temperature in my lab notebook, I'd damned well better note what units I mean. The fridge is 4 C, but if I left off the "C" then someone looking at my notebook in the future might store a reagent at 4 F, which would be a big problem if the reagent didn't tolerate freeze-thaws. That's not even considering the absolute temperatures (Kelvin and Rankine) which are especially important in chemistry and physics.

    And seeing as how everywhere outside of the US uses Celsius, but a very large percentage of native English speakers use only Fahrenheit, it would indeed make sense for someone translating the article into English to specify what kind of degrees they were talking about. Would you say that someone weighs 15? What would that mean? It's an acceptable weight for an infant, in pounds, but in the UK they still use stone to specify weight (which does mystify me).

    The parent poster obvious was able to infer that the article meant Celsius from the context. Sounds like you're the one who doesn't understand this is a diverse planet.

    --
    Si la vida me da palo, yo la voy a soportar Si la vida me da palo, yo la voy a espabilar
  226. Re:plagarize code from Many.... integrate and deli by Anthony+Liguori · · Score: 1

    Even after getting a job, I find that this is a much more stable way of programming newish things - "find a lot of similar things, pick the best strategies & adapt". Btw, these days - that's called "Research" Thank you. Now I know never to hire you. That's not called "Research" that's called stealing. Taking someone else's copyrighted code and passing it off as your own is stealing. Not only can you lose your job over that, you can get your company sued for millions and millions of dollars. Cheating in college should always result in immediate explusion otherwise you get people in the real world who think this sort of thing is ok.

  227. Re:Compiler Warnings by Teach · · Score: 1

    That is FANTASTIC! Feel free to TA at Leander any time. High school students can't sue for much....

    --
    Graham "Teach" Mitchell, computer science teacher, Leander HS
  228. YHBT. YHL. HAND. by Anonymous Coward · · Score: 0
  229. rentacoder/elance by Anonymous Coward · · Score: 0

    pay someone on rentacoder.com or elance.com to do it.. Like this dude does.

  230. Re:plagarize code from Many.... integrate and deli by Gopal.V · · Score: 1
    > Thank you. Now I know never to hire you. That's not called "Research" that's called stealing. Taking someone else's copyrighted code and passing it off as your own is stealing.

    I guess you invented all your crypto and wrote your own libc ?. Reading a reference implementation is MANDATORY for doing most of the things I do . I've read a lot of os-specific code and often there are no two ways to do it either. (yeah , like reading pySerial and redoing it in C is copyright violation).

    What all this gave me in college is a skill at understanding code I never wrote and debugging it. It turns out that I do the SAME THING AT WORK - DEBUG SOMEONE ELSE's BUGGY CODE !!!

  231. Re:plagarize code from Many.... integrate and deli by Anthony+Liguori · · Score: 1

    I guess you invented all your crypto and wrote your own libc? No, I've used libraries that I have the legal right to use provided I use the publicly documented interfaces and/or abide by the copyright restrictions. Reading a reference implementation is MANDATORY for doing most of the things I do. Reference implementations are often in the public domain. They always are licensed in such a way that you can use the code in your own application. (yeah , like reading pySerial and redoing it in C is copyright violation). Actually, it can be. If you took pySerial and rewrote it in C, then your creation is a derivative work. If it's a derivative work, it's a copyright violation. What all this gave me in college is a skill at understanding code I never wrote and debugging it. No, it simply taught you how to steal. You can learn to understand code by participating in Open Source projects or by working on programming project teams. Pair programming seems to be all the rage these days in Universities so I contend that there are plenty of opportunities to pick up these skills without resorting to stealing.

  232. Re:Advice from a fellow student by Cycloid+Torus · · Score: 0

    The Brownies were at work.. definitely Brownies.

    --
    Lost in space at an early age. Survived the vacuum. Now rebuilding castle in air.
  233. yep by Trepidity · · Score: 1

    And sadly, a proper OOG post is no longer even possible, since the 'lameness filter' doesn't allow all-caps posts.

  234. Negative temperature by FuzzyDaddy · · Score: 1
    Actually, there is a kind of negative temperature, but it only exists in systems with an upper bound on energy.

    Imagine a collection of dipoles in a magnetic field, with two energy levels. The maximum entropy occurs when there is enough energy for half of them to be high. If you manage to get more than half of them high (by suddenly flipping the magnetic field), the temperature is negative, because an increase in the energy leads to a decrease in the entropy (and T = DE/DS).

    Of course I could just be smoking crack. Who knows?

    --
    It's not wasting time, I'm educating myself.
  235. Not a dig by panurge · · Score: 1
    I know someone who runs a small specialist company that outsources financial and IT-related services for small businesses, many of whom are plumbers, electricians and carpenters. Some of these people are brilliant at their jobs - but they don't have the financial mindset. And some of them are now doing _very_ well - because their better financial and credit control gives them an edge over their competitors.

    Also, how many comp sci graduates start in the mailroom? I submit that, other things being equal, a graduate with practical skills in the industry will have the edge over a new graduate joining the same industry but without those skills. At the moment we have a division of labor which means that even management is over specialised. What makes you think that fashion will last through the next ten or twenty years, when today's new graduates will be reaching senior levels?

    Eventually the lessons of Barings and Enron will filter through. As usual, it will be by new companies springing up with diferent business models.

    --
    Panurge has posted for the last time. Thanks for the positive moderations.
  236. A CIS Degree? by Anonymous Coward · · Score: 0

    I'm a CIS student, about ready to graduate. I'd already been programming for several years before I started school

    Can you actually get a job with a CIS degree? I work full time as a programmer and I went back to school to finish my degree, and I'm trying to decide between Computer Science and CIS as my major. Even though CS will take much longer for me, I took that. I'm tempted to switch to CIS since my previous credits would count more twards that degree. Would I actually get a job with a CIS degree though? It seems like every ad I see says "BS Degree in Computer Science required" which scared me away from the BA in CS and CIS degree