On 2007-12-28 07:33, Brian Hansen wrote:

[snip]

> Is he right?

Yes and no. First of all you should realise that Linus and most other
other kernel hackers are biased. When it comes down to it C++ is not a
better or worse language to write a system in than C, it is just a
question about how you use it.

But as Linus wrote, there are a number of people out there who learned
to program in Java and then learned C++ and now think that they can do
some low-level programming. Truth is they can not since they have
learned to think about programming in a very high-level way. Someone
once said something like "nothing is impossible with enough layers of
indirection", but none ever claimed that many layers of indirection was
efficient. If you are down in the kernel writing code that will be run
while holding a lock every micro-second counts since you are stalling
the progress of other threads/processes, so you want efficiency.

But if you are writing a complicated GUI for an application that will
run on a 3GHz machine with 2GB RAM a few layers of indirection can be
very nice, and none will notice the few milliseconds you lose.

It is about choosing the right tool for the job, but also about choosing
how to use the tool, just because a hammer is the right tool does not
mean that hammering away is the right way to do things.

-- 
Erik WikstrC6m

Reply via email to