3 ms·
This is a ridiculous myth that I wish we could just put to rest once and for all. If your overpaid programmers are writing O(n^2) algorithms then that cheap har
by gaius 18y ago
This is a ridiculous myth that I wish we could just put to rest once and for all. If your overpaid programmers are writing O(n^2) algorithms then that cheap hardware is going to get expensive real quick. Even if hardware was free you still need to put it somewhere, power it, cool it and so on. There's no excuse for sloppy coding.
- wmorein 18y agoAlso, I'd add that designing an app to scale out effectively is one of the harder challenges that most developers face in the world of web apps. He seems to imply that you just by another few boxes and magic happens, which is not the case from what I've seen. To be fair, the article is a little more balanced than the headline.
- mechanical_fish 18y agoIf your overpaid programmers are writing O(n^2) algorithms then that cheap hardware is going to get expensive real quick. Well, that depends on the value of n, right? Not every piece of software is Google or Twitter: They don't all have a userbase that grows virally to encompass every breathing human in existence, plus animals and robots. Especially if you charge the users money.
- gaius 18y agoIt's not just about users because there are no users; there's just data. Any data, the same thing applies.
- gnaritas 18y agoNot every piece of software is Google or Twitter: Worse, almost all software isn't like a Google or Twitter. In almost all cases hardware is vastly cheaper than programmers. The Googles and Twitters of the world are extreme outliers and are no where near the median.
- axod 18y agoI don't believe that's true. Google sure, but twitter is just another message routing system, like any one of the IM networks. The average irc server probably handles more than twitter - certainly email software does. There's a ton of software that needs to scale, and be able to handle a large volume of data.
- mechanical_fish 18y agoTwitter is not "just a messaging system". See: http://www.hueniverse.com/hueniverse/2008/03/on-scaling-a-mi.html http://www.hueniverse.com/hueniverse/2008/03/on-scaling-a-mi... (Many thanks to Eran Hammer-Lahav for writing this so that I don't have to.)
- axod 18y agoI respectfully disagree. It's a simple message passing system, of which there are a ton of examples. This isn't rocket science. The problem is that where once it would have been written in c as a server, it's now written with big databases and 'popular' languages - so it's harder to scale.
- kragen 18y agoIt would have taken longer to get working in C, which would have dramatically increased the probability that the project would have gotten killed before it saw users (it sounded like a pretty stupid site to me at first!), and it would be harder to rev the UI and features as often as they did before they hit the scaling problems. But a message server in Ruby with Eventmachine wouldn't have been that hard, would it?
- gaius 18y agoTrue. IBM have basically solved messaging with MQseries running on OS/390. All that remains is do that, only cheaper.
- 18y ago
- orib 18y agoIf you can determine an upper bound on n, then your algorithm is technically O(1), and you don't have to worry about scaling. If you want to be able to handle any value of n, and expect it to be large, you should care about O(n^2) algorithms. You don't have to necessarily get rid of them all at once, but you should at least know where they exist and have them listed as possible pain points or places to start optimizing.
- jcromartie 18y agoAlthough, when it comes to custom intranet apps, N is usually tiny.
- gaius 18y agoThe IT world is a lot bigger than websites. Monte Carlo simulations for example are constrained literally by power and cooling and the floor loading of your datacentre. If you aren't squeezing every last drop of compute out, you might as well not bother. Algorithms are everything.
- deleted 18y ago[deleted]
- Retric 18y agoO(N^2) forgets that in most cases it's really more like K * O(N^2) + I and reducing the size of K can have dramatic impact because it tends to be more than 10,000 cycles. For a wide range of inputs a low latency N^2 can be faster than a high latency n * Log n because thrashing you cache is really bad. The basic question you need to ask is how much are you spending on hardware / bandwidth vs coders and which is better to focus on.
- geebee 18y agoThat's really well put. In this case, I'd say you need programmers to reduce the O(N^2), and hardware to reduce the K. If you can reduce K by 50% for $5,000, then it makes almost no sense to use a programmer to reduce K. However, hardware will almost never save you from a programmer who gives you an O(N^2) instead of a log N solution. This happened at my last job (actually, worse). Management decided I would be an "Architect" and train an offshore team to write the code (hmm... seems kind of fishy). We were building a system that would hold an equation with millions of constraints and variables, and we needed to be able to look up a variable value by name. The code from the offshore team, no kidding, stored them in arrays. Unreal. I quit, for all kinds of reasons. (yes, yes, many offshore teams could have written this code very well - the problem was not offshore programmers per se, it was that mgmt wanted top talent for cheap and was outsourcing its core product, and you don't get something for nothing).
- puzzle-out 18y agoYep, good programmers might be expensive, but in the long-term so is the energy needed to power overworked hardware from sloppy coding.
- russell 18y agoIf you are going to pay big bucks to a programmer, you want one that does a little algorithm analysis before s/he puts fingers to keyboard, same with memory usage. I saw a major project go down the tubes because the architect thought that it scaled limitlessly but really it scaled n^2. Ain't good for a transaction protocol. If you need to scale, you need to have a good architectural path from the beginning. I've talked to too many companies whose growth is constrained by the need to re implement from the ground up, right in the middle of the hockey stick growth. What I mean is a little bit of thought at the beginning, not months of agonizing or 9 tons of frameworks. Given that, you can throw hardware at it and let your programmers add value.