Manu Hermanus
FaDoyToy
|
Posted - 2009.12.03 06:13:00 -
[31]
Originally by: Herzog Wolfhammer
When I was in night school learning C/C++, the professor warned us that writing complicated code will get us shot by our coworkers. If we actually get a jury of our peers, that is, 12 programmers, then they would likely (and justifiably) be not guilty for justifiable homicide.
12 years later, I have seen enough source code that has made me want to put out a contract on those who wrote it.
The worst problem I see in source code these days comes from college students. Code that impresses the professor, who likely never held a real job in software, does not work in the real world. Part of the functionality of a program is in how fast is can be understood and modified to adapt. Snarky, cryptic code that is more geared to making the author feel smarter than he actually is, is more trouble than its worth, and team leads/managers (like myself) seek to get rid of that type of programmer. Usually that type of programmer is also that sort who downloads an indie App on his iPhone and then calls himself a hacker.
Another thing is lack of documentation. Seriously. You are sitting at a desk. Is life a "he who burns the least calories wins" contest? Would it kill your lazy ass to put comments in the source code? I have seen FORTRAN programs thousands of lines long without one damned comment. I had to write programs that went into source code of other programs to modify them so they would not fail when the year 2000 came.
I see a nice discussion about languages here. Look, you will not always have Visual Studio to work with. I use VS2008 Pro, but even that has a command line working in the background and the IDE hardly knows how to fully exploit it. Netbeans is great but you need to know how to handle javac at the prompt because Netbeans will screw up eventually. But if you are tying yourself to one language or IDE, you are screwing yourself big time. You have to be flexible to survive. I create a C++ OpenGL demo and then the boss wants it in C#/XNA. But I gotta stop to write something in FORTRAN(no kidding this happened recently).
You cannot choose something that you "like". I learned programming from having to adapt countermeasures systems in fighter jets and those libraries were all written in hex code. Then I got out and went to work on mainframes and all I had was a measly 2 year degree in electronics but they saw I can "solve problems with computers - any computer, any tools" and that was enough.
It was always enough.
heh one of my professors was saying to make sure your code was understandable because when you, hopefully, get promoted (and not fired) you don't want whoever is taking your job calling you up all the time
I was also lucky enough, in another class, to have someone from industry taking some refresher classes. the professor printed out a copy of a page of her code to show everyone. there was about a paragraph explaining what the function did, and how it did it. also all the lines were nicely indented and lined up. in c++/java my comments aren't the best, but I make to have methods/functions/variables that do/mean exactly what they say. but in my assembly programs almost every line is commented.
then again I have yet to work on a project where I don't have a paragraph on each function handed to me by a professor. I think I had one project where 80%+ of my comments were copy/paste from the project description document.
although I would like to see an example of the "Code that impresses the professor" most of the code I have done has been if it isn't nicely formatted and somewhat decently commented don't bother showing it to them. many headaches from working on eclipse on my laptop, and then trying to put it on a school computer and try to print it out. "your lines wrap here, here, and here, fix it." You're posting again!? Has it really been 5 mins?
|