Live data from Hacker News

Coding Horror: Hardware is Cheap, Programmers are Expensive

codinghorror.com

31–40 of 60 posts

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#31
What 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.

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#32
post #3

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.

If 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.

If 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.

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#33
post #14
post #8

This 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 improvem…

He 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 d…

Yes, I agree, although it might be worth an hour of your time to improve the app's responsiveness if it makes the customers happier.

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#34
post #27

Earlier quoted context omitted.

Not 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.

I 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.

There's a ton of software that needs to scale

Yes, but there's vastly more that doesn't, you need to stop thinking that most software runs on the Internet and has tons of users, it doesn't. The vast majority of software is written for businesses and runs either on an intranet or is available on the internet to the users of that business.

For every public app you know about that needs to scale there are a hundred you don't know about that don't need to scale. Most programmers work on systems that will never need to scale, EVER. It is a tiny tiny minority of programmers that actually work on systems that become publicly popular on the Internet and actually face scaling issues.

Secondly, we're talking about programmers here, not the software, most email systems use existing mail software written by that tiny tiny minority of programmers who write such systems. The vast majority of programmers will NEVER write a mail system, a chat system, or anything that handles large volumes of data or users. Most of them of doing one thing, biz apps for in house projects at big and small companies exposing relational data to in house users.

How many IM networks are there? Now how many programmers are there? I'll say it again, most software does not need to scale. Because a lot of software does need to scale does not make that statement in any way false because a shit load more doesn't need to scale.

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#35

Do 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?

Well, 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.

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#36
It'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.

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#37
post #27

Earlier quoted context omitted.

I 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.

Twitter is not "just a messaging system". See: 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.)

I 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.

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#38

Earlier quoted context omitted.

It's the whole US, it isn't broken down by geographic region or anything.

But even then, 30-40K is weak. 40K should be your starting salary. Anything less, and you're being taken.

He said "30-40K too low", as in "30-40K lower than I would reasonably expect".

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#39
post #9

"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.

I 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 wa…

...and you're not bothering to tell us who it is, so someone from HN might get suckered into working for them next month.

Re: Coding Horror: Hardware is Cheap, Programmers are Expensive

#40
post #37

Earlier quoted context omitted.

Twitter is not "just a messaging system". See: 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.)

I 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.

It 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?

Post reply on HN