6 ms·
Coding Horror: Hardware is Cheap, Programmers are Expensive
- bdfh42 18y agoWhen I started as a programmer in the late 70s the relationship between hardware costs and programmer costs were just about the reverse to those described by Jeff. It was always cheaper to optimise the code than it was to invest in new hardware. I must admit that it is hard to shrug off the frugal approach to the hardware that I adopted at the start of my developer career - I think it still pays off to err on the side of low hardware overhead whenever the option arises.
- davidw 18y agoHrm. I guess the guy cited in my online journal was really thinking ahead: http://journal.dedasys.com/2008/12/04/the-economics-of-programming-languages-in-the-1950s http://journal.dedasys.com/2008/12/04/the-economics-of-progr... It's an extract from a paper from the 1950'ies by Backus (yeah, that Backus) saying pretty much exactly what Atwood says.
- gaius 18y agoThis 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.
- 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.
- swilliams 18y ago"Also, having programmers who believe that their employers actually give a damn about them is probably a good business strategy for companies that actually want to be around five or ten years from now." This is probably the most overlooked reason to get at least semi-good hardware. Part of the reason I quit my last job was because of management's stubborn refusal to get us tools that would make us be more productive.
- bockris 18y agoI applied to a job in the spring of 2006 and when they were showing me around the development area I noticed that everyone had single smallish CRTs and what seemed like older computers. I asked about it and they told me that most people had P3-500's! Unsurprisingly their salary offer was low also and I did not take the job.
- swilliams 18y agoYeah, at that point you can pretty much conclude that the company is doing something incredibly wrong, and it's only a matter of time before it bites them. If you have crappy pay and perks, then you won't attract good talent, and whatever good talent you had will eventually leave. Without good talent, it is highly unlikely you'll have a good app. If your app sucks, you will slowly bleed off customers, and revenue. Of course, that's not a scientific fact. For exceptions start with: Contracts, Government.
- brl 18y agoI took that job and for 5 years each day when I arrived at work I would have to go around looking for somebody that had carelessly wandered off to the bathroom and steal their chair. Eventually I just settled on one that was missing two wheels and an arm rest since it tended to not mysteriously vanish as often while I was at home sleeping or away eating lunch.
- m0nty 18y agoI quit a job a couple of years ago where (I kid you not) I had no desk, no allocated seating, and no PC. I was expected to bring in my own laptop. Whenever there was a director's meeting, we all had to surrender our communal office and hide in the server room. Duration of job: less than six months. It would have been shorter if I'd know what assholes they were (I had some idea they might sort out the problems if I waited a while). Worst. Company. Ever.
- kragen 18y agoThis argument is applicable only to code that runs on only a small number of machines. Using roughly his numbers, you can afford to pay somebody US$100 000 to work for a whole year to make your code 10% faster if that code uses 100% of a million dollars' worth of hardware, which is only 200 high-end US$5000 servers or gaming machines, or 2000 low-end servers. But that's assuming that the benefit of the speed improvement is merely improved throughput resulting in data-center savings. If the issue is that your non-AJAX UI is frustratingly and inconsistently slow and so your ex-customers have switched to your competitors' AJAX app because it has consistent 200ms response times when they click on buttons, it may not matter if their app actually uses more CPU cycles than yours (because half of it is written in JavaScript and your ex-customers aren't running Chrome yet.) If your game gets 20 frames per second and your competitor's game gets 35 frames per second with nicer-looking graphics, you're going to lose sales, even if the customers run the game for only 10 hours each. And that's why gamer games and desktop apps are still written largely in C, C++, or Java with some Lua, and Google's large-scale apps are mostly written in C++ and Java, while small-scale server-based applications and the stuff developed by the in-house IT guys are written in all kinds of higher-productivity, lower-performance languages.
- teej 18y agoHe is really writing this from the perspective of web applications. If you app is humming along nicely on a single EC2 instance, it isn't even worth an HOUR of your time to DOUBLE the capacity of your app. The last big app I was in charge of ran 1M pageviews a day on $500/month. At my standard rate, it isn't even worth a day of my time to double the capacity of my app on the same hardware. He certainly isn't saying don't optimize. He's simply saying that scaling web apps STARTS with throwing hardware at the problem. Where and when you cut over to developer optimization depends on your -actual- costs, size, and growth.
- kragen 18y agoYes, I agree, although it might be worth an hour of your time to improve the app's responsiveness if it makes the customers happier.
- deleted 18y ago[deleted]
- old-gregg 18y agoThis argument works only for enterprise/server development, where hardware is under your control. When developing for the consumer market, hardware is not "expensive", hardware is simply not available: users control their hardware, and even the argument of "ever increasing gigabytes and gigahertz" doesn't work anymore, as more and more prefer to trade speed for increased portability or (surprise!) smaller price.
- natch 18y agoAm I the only one thinking those salary figures are around 30-40K too low?
- ciscoriordan 18y agoIt's the whole US, it isn't broken down by geographic region or anything.
- redrobot5050 18y agoBut even then, 30-40K is weak. 40K should be your starting salary. Anything less, and you're being taken.
- richcollins 18y agoManaging servers can be a real pain in the ass. If you can get everything to work on one server, life is much simpler.
- cia_plant 18y agoDo software programmers really worry too much about optimization? If that's the case, why are so many programs slow as a crippled sloth? Why does it take 10 seconds to open a freaking email client, when 1980s technology can do this in less time than is humanly noticeable?
- gaius 18y agoWell, no, they don't bother, because people keep telling them that hardware is cheap and they're too expensive to work on anything that isn't new features.
- lallysingh 18y agoThat's got more to do with the size of all the frameworks & libraries loaded in, than the actual code of the app. A modern desktop app has a lot more expected of it than one from the 1980s (GUI, copy-paste with styled text & embedded objects, drag & drop, undo, etc), and that code costs time to link in, use, and let run.
- mdasen 18y agoWhat this article lacks is an eye toward things that must be optimized when you get to a certain level. For example, when you replicate databases, the replication overhead grows quadratically (n^2) to the number of servers. So, eventually you can't just throw hardware at it since eventually it's all overhead replicating between the servers and you can do any selects/updates/deletes. Most people will never get to this level and the article is probably written for people that won't have to deal with this. So, at a certain level, you need to optimize your code to shard data, avoid joins, etc. because you simply can't throw hardware at it. Most people will never get to that level so throwing hardware at the problem is often the answer, but if you have a lot of quadratic algorithms in your code, you're going to hit scaling problems that will make throwing money at it expensive to the point where you'll loose money.
- DaniFong 18y agoIt's rare that I come across a problem where resource and speed constraints do not become an issue. Javascript and the DOM and latency has been an issue with client side web-apps. DB bottlenecks have been an issue on the serverside. Numerical performance and AI performance is an issue in CAD/CAM/CAE games and scientific analysis. In every scenario there have been algorithmic and software level improvements that have speed up the system by a factor of ten or more. Certainly it plateaus after a while, but one cannot hope to throw hardware at complicated problems and expect them to be solved without some serious elbow grease on the part of the programmer. Programs become increasingly more ambitious, and expand to fill the resources allocated to them: a kind of Hacker's Parkinson's law.
- zandorg 18y agoI practise the 'path' method of speed optimisation: If you can not execute a piece of heavy code every 10 in 100 runs, you save a lot, just by a simple data/value check before it. As for memory opts, pass by reference instead of value (in C++). I've sped up code by a factor of hundreds by doing some crazy stuff (without going to assembly).
- gaius 18y agoYep, memoization is often a big win, and so easy to do in Python with a decorator.
- hs 18y agoi'd say programming environment (unix/mac, vim/emacs) and skill levels (algo, data structure, etc) matter more than hardware it costs less to hire a skillful (but expensive) developer on ok machine than less skillful one(s) on expensive machine(s) the 10-100x gain myth on skill is pretty much true
- lallysingh 18y agoSimplest method is still the best: Write something that works. Run it at production loads. If it's not good enough, work on it. Don't worry about speed until you hit that. Only exception is if you know N's going to be big enough to be problematic. In that case, do just enough optimization to make it reasonable. Why? Optimization and maintainability* are often at opposing ends. It's best to avoid the costs of it when it's not needed, and the increasing capacities of computers should make you bias towards maintainability. * and ease of debugging, and concerns for low software complexity, and likelihood that it will be well documented, and .....
- 12ren 18y agoThere's an issue of need satiation. Once a need is met, further improvements can't be absorbed. Like water when you aren't thirsty, it doesn't matter. Hardware helps performance - but this only matters when more performance is needed. For example, if features or usability are needed, extra performance doesn't help. This is obvious, but it's surprisingly easy to get caught up in improvements that are better, but that don't matter. For productivity of programmers, faster hardware only helps when performance is a problem. The article says: If [it] makes them merely 5% more productive... - that's an "if". Will a faster PC make you more productive? These days, compilation is too quick for me to squeeze in a swordfight. For other hardware (eg large screens) there is also a limit beyond which extra real estate isn't useful (Joel on Software talked about several of his coders that don't use their second monitor). It depends on the task, of course. Faster is always cool and impressive. But like a 300 miles per hour station wagon, will it help you?
- arjungmenon 18y agoNow on Slashdot: http://developers.slashdot.org/article.pl?sid=08%2F12%2F20%2F1441203 http://developers.slashdot.org/article.pl?sid=08%2F12%2F20%2...