News for hackers. Stuff that matters.
Re:What most young programmers need to learn by jerven on Monday January 05, 2015 @10:58AM (#8839407)
I suggest you move the simple version into a unit test case. Making sure the simple version and the complicated one have the same results.

Plus I like to add some perf test that shows the complicated version is faster than the simple one that I can rerun after major upgrades to the lower level system e.g. when upgrading from java 1.5 to 1.6 I could remove some complicated code because the simple one was then as fast due to an improved JIT.

Re:What most young programmers need to learn by danieltillett on Monday January 05, 2015 @04:55PM (#8841475)
Yes I also think this is what I should do to, unfortunately when I first wrote the code I spend most of my time working on I didn't write unit tests at the function level (all my tests are at the module level). I have been meaning to get around correcting this, but the task is now so huge I fear it would take me more than a year to write all the unit tests :(
Re:What most young programmers need to learn by jerven on Monday January 05, 2015 @06:15PM (#8841899)
IMHO every automated test helps.

Don't aim for 100% test coverage aim at using unit tests to develop faster and more efficiently and the test coverage stats will come automatically.

I personally need to improve my TDD, but I am quite happy with my test driven bug fixing approach. When working on a bug I first turn it into a JUnit or selenium test, and then fix the bug and make the test pass.