News for hackers. Stuff that matters.
Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by gaius on Friday December 19, 2008 @08:51AM (#403326)
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.
Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by mechanical_fish on Friday December 19, 2008 @10:28AM (#403398)
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.

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by gnaritas on Friday December 19, 2008 @01:33PM (#403649)
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.

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by axod on Friday December 19, 2008 @02:38PM (#403745)
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.

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by gnaritas on Friday December 19, 2008 @03:53PM (#403830)
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 by gaius on Friday December 19, 2008 @06:08PM (#403976)
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.

That doesn't mean a thing in terms of scalability. One user can max out a fast machine with OLAP cubes or other DSS. Or any sort of simulation or modeling. Think in terms of datasets, not in terms of users (all many users are is a large dataset with a requirement for a quick turnaround of each computation).

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by gnaritas on Friday December 19, 2008 @06:43PM (#404002)
If an app only has one user, it doesn't need to scale, it needs to perform. Scalability is all about users and only loosely related to performance. Datasets are irrelevant.
Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by sadfsa on Saturday December 20, 2008 @03:52AM (#404422)
I don't know what dictionary you're using, but here are a few definitions from mine:

scalable - How well a hardware or software system can adapt to increased demands.

scalable - the ability of a product or network to accommodate growth

The ability to scale hardware and software to support larger or smaller volumes of data and more or less users.

the ability of a computer system to shrink or grow as requirements change

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by gaius on Saturday December 20, 2008 @06:27AM (#404487)
That's not true. It needs to scale from 1M of data to 1G to 1T and beyond. You seem to think that scalability only refers to concurrency. It doesn't. It means that you're as close as possible to O(n) or better yet O(1) as your workload increases, whatever that workload is.
Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by mechanical_fish on Friday December 19, 2008 @03:06PM (#403776)
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.)

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by axod on Friday December 19, 2008 @04:49PM (#403896)
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 by kragen on Friday December 19, 2008 @05:15PM (#403933)
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?

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by gaius on Friday December 19, 2008 @05:25PM (#403948)
True. IBM have basically solved messaging with MQseries running on OS/390. All that remains is do that, only cheaper.
Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by seiji on Saturday December 20, 2008 @12:26AM (#404311)
Proprietary message queues are a huge problem (and a huge business).

There are better ways: http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protoc...

For a good introduction check out http://google-ukdev.blogspot.com/2008/09/rabbitmq-tech-talk-...

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by orib on Friday December 19, 2008 @03:32PM (#403805)
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 by gaius on Friday December 19, 2008 @10:37AM (#403411)
It's not just about users because there are no users; there's just data. Any data, the same thing applies.
Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by wmorein on Friday December 19, 2008 @10:27AM (#403397)
Also, 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.

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by Retric on Friday December 19, 2008 @11:53AM (#403511)
O(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.

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by geebee on Friday December 19, 2008 @01:35PM (#403653)
That'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).

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by russell on Friday December 19, 2008 @02:35PM (#403740)
If 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.

Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by puzzle-out on Friday December 19, 2008 @01:45PM (#403667)
Yep, good programmers might be expensive, but in the long-term so is the energy needed to power overworked hardware from sloppy coding.
Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by jcromartie on Friday December 19, 2008 @10:37AM (#403413)
Although, when it comes to custom intranet apps, N is usually tiny.
Re:Coding Horror: Hardware is Cheap, Programmers are Expensive by gaius on Friday December 19, 2008 @03:25PM (#403791)
The 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.