Keeping a code clean and organized is important for future maintenance, specially for companies where programmers cycle (or get fired, hopefully not).
I have been looking around on Google and ive found few things that could help, like: naming the variables and methods properly etc... However, dispite the fact that I try to apply most of these rules properly, I still have troubles organizing my code properly, and I do comment everything so that the maintenance becomes easier.
I get lost in complex code where there are many nested statements like: if
inside if
inside for
, etc...
To solve those problems I could do it with Netbeans, like this:
Netbeans allows compacting the code through an <editor-fold>
tag. It is ok for now but the problem comes where others have to modify this code, because that xml tag is IDE dependant.
The question is: whats the correct way or pattern, to make code easy for understanding and clean at the same time, not IDE dependant.