4 ms·
> On the rare occasion that I need to use a data structure or an algorithm to optimize for Time Space complexity, I'll either use a community built package or a
by 908B64B197 6y ago
> On the rare occasion that I need to use a data structure or an algorithm to optimize for Time Space complexity, I'll either use a community built package or a language level feature. I'll never invent my own because whatever I come up with will be half baked anyway.
In these cases you recognized you needed to use a specific algorithm or data structure and was aware of it's existence, name and properties. That's most of the work.
Contrast this with code where common data structures are re-implemented (I need a dictionary and all I know is an array, better iterate and compare the keys until I find the right thing). And that's only scratching the surface of bad code, believe me.
- syamilmj 6y agoThose who made “mistakes” like re-implementing basic data structure or algorithm will learn much more than what compsci degree can teach them.
- 908B64B197 6y agoIt's not a mistake to re-implement these. It's a mistake not to recognize that you need them in the first place.
- imtringued 6y agoNobody wants this type of experimentation on a production code base though.