Software development in todays world

K.I.L.E.R

Retarded moron
Veteran
Is filled with people who have horrible habbits, bad sense of logic and belief that coding smart is coding complex.

While the article I'm going to present you with is about Java. The point of the article shows how people should be applying their designs within the Java language.

http://renaud.waldura.com/doc/java/final-keyword.shtml#many

While I was reading that I found out that I have been using a few of those practices to make my code simpler to understand and very reusable.

I've looked over a lot of professional code and honestly I can say that the majority of code isn't like John Carmack's code.

John Carmack has great coding practices as I've seen with the Doom 3 scripts as well as the SDK.

Why doesn't John Carmack quit his job at ID and teach coders good programming practices?
I believe more people should be like John Carmack, think before they type out the code.

Think in terms of implementation and not syntax.
I don't believe for a second that an experienced coder has problems with syntax and understanding of the language specs they work with.
The problem is that people don't act like John Carmack.
 
To me, the most important thing in coding is comments. I love it when I look at my code from two yrs ago and am able to get into it ASAP thanks to that.

Meaning, you're not likely to develop a sense for that without setting yourself a firm set of rules for commenting, indenting and notation. VERY important. Than, you can start thinking about the implementation.
 
_xxx_ said:
To me, the most important thing in coding is comments. I love it when I look at my code from two yrs ago and am able to get into it ASAP thanks to that.

I respect your view, but I disagree with it. Usually if a block of code needs commenting then it means that block of code is too complex. I am a supporter of self-commenting code. I.e., I try to write my code in such a manner that it will not need comments. This can be easily achieved if, the coder can come up with some intelligent names to call the things (classes, object, variables, fields...) he/she uses. Of course this does not mean I regard comments as useless; when there is no other way (all refactoring is useless) I will put a comment. Or if I'm using some strange algorithm, I will also think about putting a comment. But generally, I prefer not to use comments. It's like: if for a GUI u will need a manual to use it, than it means the GUI is not very user-friendly. (maybe not the best example)

This is one of the habits that XProgramming tries to teach us. Also, I don't agree with all of their philosophies, but I find most of them are a really good thing.
 
K.I.L.E.R said:
Software development in todays world is filled with people who have horrible habbits, bad sense of logic and belief that coding smart is coding complex.

So true. :|
 
cristic said:
_xxx_ said:
To me, the most important thing in coding is comments. I love it when I look at my code from two yrs ago and am able to get into it ASAP thanks to that.

I respect your view, but I disagree with it. Usually if a block of code needs commenting then it means that block of code is too complex. I am a supporter of self-commenting code. I.e., I try to write my code in such a manner that it will not need comments. This can be easily achieved if, the coder can come up with some intelligent names to call the things (classes, object, variables, fields...) he/she uses. Of course this does not mean I regard comments as useless; when there is no other way (all refactoring is useless) I will put a comment. Or if I'm using some strange algorithm, I will also think about putting a comment. But generally, I prefer not to use comments. It's like: if for a GUI u will need a manual to use it, than it means the GUI is not very user-friendly. (maybe not the best example)

This is one of the habits that XProgramming tries to teach us. Also, I don't agree with all of their philosophies, but I find most of them are a really good thing.

You program something with 5000 lines of code, very complex and for the moment one-of-a-kind thing. You finish it and deliver it.

Two years later, you should update it for whatever reason. You won't seriously going to tell me you can remember everything or get it all by just briefly looking at it? With no comments in important places, at least? If that's the case, you've prolly only programmed "Hello World" kinda stuff... ;)

EDIT:
No pun intended, of course...
 
cristic said:
_xxx_ said:
To me, the most important thing in coding is comments. I love it when I look at my code from two yrs ago and am able to get into it ASAP thanks to that.

I respect your view, but I disagree with it. Usually if a block of code needs commenting then it means that block of code is too complex. I am a supporter of self-commenting code. I.e., I try to write my code in such a manner that it will not need comments. This can be easily achieved if, the coder can come up with some intelligent names to call the things (classes, object, variables, fields...) he/she uses. Of course this does not mean I regard comments as useless; when there is no other way (all refactoring is useless) I will put a comment. Or if I'm using some strange algorithm, I will also think about putting a comment. But generally, I prefer not to use comments. It's like: if for a GUI u will need a manual to use it, than it means the GUI is not very user-friendly. (maybe not the best example)

Whilst I agree that sensible and useful naming conventions should always be used, They can't replace good commenting in some situations.

You may have the luxury of problems that only require simple code. But sometimes that simply isn't possible.

Also when working with code from other people, they may not have written clear easy to read code, in which case it is far easier and quicker to attach comments to their code to remind you what they are doing than it is to re-write the code in a better and more useable style.
 
Simon F said:
_xxx_ said:
You program something with 5000 lines of code,
Quite short then?

That's enough for two years later :)

EDIT: I recently had to rewrite a download protocol I programmed some three years ago. It was some 5000 lines, that's why I took that as an example. Without my very good commenting, I would still be working on it probably.
 
Also, what seems understandable to you may look like a product of an alien brain to someone else, which is also of importance since someone will eventually have the pleasure to continue the work you started.
 
_xxx_ said:
cristic said:
_xxx_ said:
To me, the most important thing in coding is comments. I love it when I look at my code from two yrs ago and am able to get into it ASAP thanks to that.

I respect your view, but I disagree with it. Usually if a block of code needs commenting then it means that block of code is too complex. I am a supporter of self-commenting code. I.e., I try to write my code in such a manner that it will not need comments. This can be easily achieved if, the coder can come up with some intelligent names to call the things (classes, object, variables, fields...) he/she uses. Of course this does not mean I regard comments as useless; when there is no other way (all refactoring is useless) I will put a comment. Or if I'm using some strange algorithm, I will also think about putting a comment. But generally, I prefer not to use comments. It's like: if for a GUI u will need a manual to use it, than it means the GUI is not very user-friendly. (maybe not the best example)

This is one of the habits that XProgramming tries to teach us. Also, I don't agree with all of their philosophies, but I find most of them are a really good thing.

You program something with 5000 lines of code, very complex and for the moment one-of-a-kind thing. You finish it and deliver it.

Two years later, you should update it for whatever reason. You won't seriously going to tell me you can remember everything or get it all by just briefly looking at it? With no comments in important places, at least? If that's the case, you've prolly only programmed "Hello World" kinda stuff... ;)

EDIT:
No pun intended, of course...

Yes, I understand your point of view. Though, I think you agree with me that you *have to* also look at the code if you want to change something. Comments are not enough, but for complex blocks of code they can help. And, I also stated that comments are welcome in places where the code is obfuscated and there is no other way around it. At work I don't have the luxury of not commenting my code, it's a must and there's no way out. But for my hobby projects I don't use too, and I usually can grasp the concept behind the code also without comments (maybe thats' because I'm the only one maintaining that code).

But, yes, what code I write might seem non-sense to other people, but so can my comments look like out of place. Actually from my coworkers I never received such complaints about code/comments readability. But we had a guy on the team, he was awful, he did excessive commenting, well I just hate that!.
 
Captain Chickenpants said:
Also when working with code from other people, they may not have written clear easy to read code, in which case it is far easier and quicker to attach comments to their code to remind you what they are doing than it is to re-write the code in a better and more useable style.

True, but for a long term-solution it would be better to refactor their code. Do you agree ?!
 
cristic said:
True, but for a long term-solution it would be better to refactor their code. Do you agree ?!

If you have the time available then yes, but if you haven't then you have to do the best you can, In which case commenting the code makes it easier to rework it when/if you do get the time.

CC
 
John Carmack's code is very good. It's also well commented. I had no problem modifying the interaction fragment program to suit my needs :)

However, I would like it for him to not quit his job to teach programming :)
 
Captain Chickenpants said:
If you have the time available then yes, but if you haven't then you have to do the best you can, In which case commenting the code makes it easier to rework it when/if you do get the time.

CC

also worth adding is that comments arse there to show how you THINK this bit is supposed to work... if you've written a bug , then someone looking at your code might not be able to understand what you were trying to do....

-dave-
 
Overuse of comments and class happy code are my two biggest peeves when trying to understand someone else's code.

Comments should be for things that aren't immediately obvious, you don't need to write sentences to indicate that the line a = 2 + 2; is an addition of the numbers 2 and 2 and will be stored in the variable a, lol.

Every time you create a class, it's a new API to learn for someone else, a class with inheritence over something as simple as limiting the range of values of an integer is retarded.
 
Back
Top