Beautify code

If you are the only developer, you probably do not care how the code look like, however if you are not the only one and there are other people who will look at the code, than it makes a good idea to write beautiful code that is understandable by many people. Even if you are the only developer, after a few years you probably will not remember what the code does. If the code looks ugly, then it will take some time to research what it does, and what the logic is. However, if the code is written beautifully, then it will be easily to understand.

What makes code beautiful?

1. Easily understandable variable names.

2. Consistent spacing.

3. Consistent opening and closing of if statements and loop blocks.

4. Use of functions to separate code blocks. Even so, it is likely possible to write code without functions, it will make sense to separate this logic into a separate block.



Comments

Popular posts from this blog

Absolute and relative path in HTML pages

Errors

goto PHP operator