Hacker News new | past | comments | ask | show | jobs | submit login

Some algorithms and data structures are really easy and intuitive (e.g. binary search, linked lists, etc). Some are quite hard. But, knowing how and when to use them is much more important than knowing how to implement them [†].

Understanding algorithmic complexity is important when venturing beyond the simplest of software. Why? Because an O(n^3) algorithm may appear to work well with simulated data, tests, or light user load. But, it may bring your system to a halt under real-world conditions. And, it is sometimes not trivial to debug, especially when the complexity spans multiple layers. (I cringe when I see new developers nesting loops inside loops, but sometimes it’s ok).

Also, it’s very important to be able to read and understand code. It’s unavoidable that you will someday encounter complex, poorly-documented code. Say you run into some code that implements a graph algorithm. If you don’t recognize what it is, you will incur a lot of risk when maintaining it.

† - However, you really should know how to implement simple data structures and algorithms, at least conceptually.




On the flip side, that's not how perf work is done in the real world. Start with a simple implementation that's easy to maintain and easy to understand. Run profiling, don't guess. Iterate and make it better.

Devs worrying about big-O cause issues, too, no matter how good the intentions. CS itself isn't harmful, just one of many tools in an engineer's toolkit.


How does worrying about big-O cause issues? You should back up such a strong statement with at least anecdote or something.




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

Search: