4 ms·
That mantra, taken blindly, leads to software that won't scale under realistic circumstances. I once worked on a project that failed because the lead programme
by gwbas1c 8y ago
That mantra, taken blindly, leads to software that won't scale under realistic circumstances.
I once worked on a project that failed because the lead programmers did not want to learn how to use a database. They insisted on using an ORM incorrectly, and almost all of their code needed to be rewritten in order to handle a typical anticipated load.
Granted, the entire codebase was full of "simple" for each loops, but the reality is that if they had started by writing correct database queries, the project would have never failed.
Thus I say, optimize for your budget at the beginning of the project. You should pick design patterns that handle anticipated load. Full optimization can come in later, but if your project can't handle anticipated load at the beginning, then you are misinterpreting what this "simple, correct, fast" mantra really means.
- bennofs 8y agoI would argue that this was not "simple". For me, simple means that it is easy to understand what is going on. If your using an ORM wrong, then you're not understanding what is going on under the hood so it is not simple. If you really write simple code, you should also be aware of the shortcomings of the simple approach.
- ben509 8y agoA DBMS is inherently less simple than for loops, that's entirely true. But that's the class of problem they were trying to solve. And a DBMS represents vast amounts of energy put into trying to solve that class of problem. So, the problem was a complex one, but one that had many aspects of it already solved, and rather than building on a good solution (the DBMS) they chose to try and reinvent queries. > you should also be aware of the shortcomings of the simple approach Yup, you really can't refuse to learn how databases work. Unfortunately, they didn't know what they didn't know.
- kungtotte 8y agoThere's a difference between simple and simplistic, and there's absolutely a value in keeping things simple instead of complex. So much so that I think it's reasonable to state categorically that if there is a simple solution that works it's always better than the complex solution. Not using a database when the solution calls for one clearly violates the "works" principle. And obviously, using a tool incorrectly (the ORM) trumps anything else. That's a tautology.
- gwbas1c 8y agoIt's like some people take "optimize last" to the extreme. A project needs to handle anticipated load at the beginning. For example, if a web application needs to handle 20,000 requests an hour, it's okay if early versions take 10-15 seconds to respond under unusually high load. The optimization phase can bring that down to something more manageable. Some people take the "optimize last" so far that they ignore their basic scalability requirements; or just assume there are no scalability requirements. That's when a more senior dev needs to step in and demand basic scalability in the design.