Aside from language-specific constructs, for someone who is programming in PHP, javascript, java, and python, what are the top 10 clean coding must-do’s? I would like to keep my code as clean as possible and as readable as possible. For example, what’s the take on placing the function body opening bracket on the same line as the function declaration vs a new line? Also, what’s the take on spacing between things for example (x==10) vs ( x == 10 )?
Any helpful hints for clean coding will be appreciated!
Aside from language-specific constructs, for someone who is programming in PHP, javascript, java, and
Share
Here’s a few that may help:
use different style on brackets; choose according to specific
language conventions)
and maintainance
and do it really well (this also makes the method easier to read/understand/test/debug)
code configuration of your code.
people can understand it as well and let the compiler do any
optimizations
in the back of your head that in 7 months you may need to debug it,
or someone else might need to fix/enhance it. It is impossible to
remember why you did something after 7 months (and comments are
good but sometimes not good enough). Let alone the poor guy trying
to fix your code
I am sure there are a lot more but I believe these can be useful in any language