Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have seen code reinvention in my career a number of times. In one instance, I was actually asked to code up a method where the code and method had been published in a scientific journal. When I asked why I should implement this on my own, instead of using code developed by the group who published the method, I was told, "Because you can't trust anyone else's code. It's better to write everything from scratch so you know it's right".

I don't personally have the hubris to think I can code up a method better than the people who invented it in the first place. That aside, it's just so wasteful.

So instead of spending time on novel work we were doing, I spent a month implementing a half-baked version of something other people had done.



As silly as the explanation was, there is actually a good reason to re-implement. And that is that if nobody does, then any bug in the original code will survive to cause problems with nobody knows how many results before anyone catches the bug.

Reimplementing from scratch then comparing with the original gives an opportunity to find such bugs.


Yes, but such arguments apply at different levels of abstraction.

I doubt one would rewrite the OS, compiler or runtime libraries because they couldn't be trusted; though all these can also have bugs.


One would probably not rewrite them. However people both can and do take their software and run it on a different operating system, compiled with a different compiler, linked with different run-time libraries, on a different type of hardware. And yes, I've seen bad software assumptions flushed out by doing so. (Don't use floating point for complex financial calculations please. OK??)


Not just bugs, but also ambiguities in specification, which helps us to refine our higher level specifications.


> I was told, "Because you can't trust anyone else's code. It's better to write everything from scratch so you know it's right".

I'm reminded of ESR's paraphrasing of Linus' Law regarding eyeball count and bug depth. Ten haphazard proprietary implementations are not more reliable than one battle-tested open implementation.


Given that this is a discussion about science, I have to point out that this "law" you quote is merely a hypothesis.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: