DEV Community

Discussion on: 8 habits to become a better software engineer

Collapse
 
hydrogen2oxygen profile image
Peter

Learn JUnit! My very first advice! The best advice!

I have seen developers who start the hard way, by developing classes of 3000 lines and then they compile everything, deploy their stuff in a server and start debugging. Once one of my colleagues said "you should remove the debugger from eclipse in order to make them better developers". And he was right!

Begin always with a JUnit. It is not more work as one would expect, because it helps to break down your code in testable units ... and here is the "divide and conquer" tip applied in the best possible ways. If your code works well in a JUnit (or let's just say Unit Test, because you can do this not only in Java, but also in JavaScript, Python, C++, even Assembler), then it will work on the customer PC as well or on a server.

And if you make little changes, you will not fear that you forgot to test some part manually. The JUnit will tell you if it still works.