Re:Ask HN: How do I get my team to write better code?
by Thetawaves on Thursday November 06, 2014 @05:46PM
(#8570292)
If your 'coders' are writing functions like findEventsFromLast6Hours, you are not giving them clear requirements.
I assume you gave this engineer the requirement 'find all events from the last 6 hours.'
You should have given them the requirement to find the latest events for a specified interval.
When requirements change, you almost always have to rewrite the code. If you don't have to rewrite the code, you still have to go back and read it to make sure it satisfies the requirements. Less code to deal with will make this process easier. There is no reason to over-engineer today for what might happen tomorrow.
Code for the here and now, and aggressively delete code whenever possible.