← Back to context

Comment by Tehnix

8 years ago

These are all well and good, as long as you remember not to blindly live by them (which you'll often see people do with advice from authority).

> If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.

I'm not sure what the author wants me to take away from this? Data structures and algorithms should very much both be taken into consideration, although I'd agree that "it all starts with the choice data structure".

All too often we focus on performance as the main problem we're trying to solve, when, in reality, our chief problem is managing complexity.

A clever algorithm can often dramatically improve performance, but usually clever algorithms are difficult to understand and their unmaintainability leads them to be abandoned as a project evolves, or, worse, subtly break when assumptions no longer hold. (Its especially hard when working with other developers)

The only example that was coming immediately to mind was a distributed lock. Once you have that primitive available your distributed systems problem can be substantially simpler to implement. Without it writing race-free code is going to be really tricky.