3 ms·
How are tests supposed to help when someone writes atrocious code that works? The posted pseudocode probably gets the job done.
by mikeash 7y ago
How are tests supposed to help when someone writes atrocious code that works? The posted pseudocode probably gets the job done.
- siscia 7y agoI answer to brother below. Anyhow, if it get the job done, just carry on. The importance of a random snippet of code of a random company is so small that is pointless to discuss about it. Just don't let him do any design work and be quick to throw away bad code and refactor. You got all your tests and procedure in place so it should not be that hard. We are really overestimating the importance and difficulties of our work.
- sethammons 7y agoI don't agree. I think there is no reason to get over pithy about code style. Question one is "does it work," but question two is "can others read and maintain it." By adding in extra logic and lines that do absolutely nothing, the next reader of the code has to slow down and think, "ok, person A did this for a reason, what is their reason..." and disassemble the bad code only to realize that they just waited their time doing so. Readable and maintainable need to be considered for any code that will be maintained or read by others.