Rules for practical programmers |
[eluser]Jonathon Hill[/eluser]
Here's a post from my blog that I thought you guys would find interesting. I had CI in mind for the first rule What do you think? Do you have any observations you'd like to add from your own experience? Quote:1) Don't waste time re-inventing the wheel unless you can make a significantly better one. I plan to expound more on that last one; it's a biggie. I'm thinking about publishing my own PHP style guide that I've developed.
[eluser]drewbee[/eluser]
My big one. Comments/commenting should explain the why. I hate seeing comments that explain how/what a particular method/function/ code block is doing. We can see the how/what in the code!!
[eluser]jdfwarrior[/eluser]
I've gotten to where I do both lately. I used to never comment my code because I was the only one looking at it. But not too long ago I decided to start following good practice and doing it. The only part I hate about commenting is the fact that, it takes up sooo much more time. I know you shouldn't wait until the project is done to comment, you theoretically should do it as you go. This makes it take twice as long to get a system up and going. Lately, I will begin a function or class with a comment, telling its name, its function (what its used for), a list of parameters that are passed to it, and if it returns a value, describe the return (what it returns, and what it returns per situation if there are multiple options such as true or false). Then I follow by giving VERY brief descriptions through out the code (usually just a single line here and there. I do this especially on if statements so I can quickly look through code and know what >THIS< else statement is referring to, or WHY i performed this certain task (if its not something that extremely obvious). [quote author="drewbee" date="1236794973"]My big one. Comments/commenting should explain the why. I hate seeing comments that explain how/what a particular method/function/ code block is doing. We can see the how/what in the code!![/quote] |
Welcome Guest, Not a member yet? Register Sign In |