Page 1 of 1
What is good coding style
8 Replies - 2058 Views - Last Post: 04 May 2008 - 07:34 PM
Posted 01 May 2008 - 10:31 PM
Replies To: "Style"
Posted 01 May 2008 - 10:47 PM
If you have sloppy code, it makes reading your code much much harder.
Posted 01 May 2008 - 11:40 PM
For me, good coding style largely means fitting in with the team. You do things that help the team, you don't assert your way over the team's way, and so on. Sure, there's room to suggest things to help the team out, but by fitting in, you help others help the product.
Posted 02 May 2008 - 04:10 AM
As no2pencil noted, what's fresh and obvious today won't be in the passage of time. If you program so others can at least follow along it will help you greatly when you haven't looked at it for so long that you're the other.
Posted 03 May 2008 - 09:37 AM
Posted 04 May 2008 - 02:23 PM
Second on no2pencil, if i didn't comment and indent, i couldn't understand my code 2 hours from now (no joke).
BTW: My style sucks, kudos for you (not literally)
PS: for those of you who have seen any of my questions, you see my impossible to follow logic (w/o comments, i can't follow my own logic). Man i'm jealous.
This post has been edited by polymath: 04 May 2008 - 02:24 PM
Posted 04 May 2008 - 07:34 PM
Some teams try to enforce implementation requirements; using anonymous global namespaces instead of statics, for instance; or using exceptions or not. these vague admonitions generally have reasons based on some requirements of the architecture. For example, the memory manager can't handle exceptions, or an analysis tool gets sick when there are too many static variables.
Beyond that, I've never worked on a team that did any real enforcement for implementation rationale. It would be an interesting experiment--it would seem like it wouldn't result in any productivity gain, though, does it?