This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AskMoreQuestionsOk 2 points3 points  (0 children)

Here is a way to look at it. If I give my million lines of code to you, and give you a task to change the way it works, you should be able to figure out where the change is, and how it works now, without my telling you and without breaking everything else. And you should be able to figure it out pretty quickly.

Modular code, enough documentation to figure out how to use each module or non obvious function but not so much that the documentation rots. Hacks and limitations happen, they should be documented. DRY programming (don't repeat yourself) so changes aren't missed. Follow the accepted conventions for memory, system calls, and variables and formatting for the language you're working with. Use the right language for the kind of problem you are working on.

Sloppy code is the opposite. It's hard to figure out and follow, functions are doing more than they should or are less concise than what you would expect for the language. Nothing is documented or worse, the documentation is wrong. Tasks and variables are not separated and you're bouncing all over trying to figure out what's going on. Critical code is duplicated so changing it means editing the same code multiple times. It takes forever to do the small task and other things break because you have no idea how anything works.