On Dec 28, 2007 7:51 AM, Erik Wikstrvm <[EMAIL PROTECTED]> wrote: > 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.
I think that's one of the main problems with programmers today. All the schools I know that teach programming, start by teaching Java to the students. It's definitely easier to learn Java with little-to-no prior programming experience, than it is to learn C (I struggled for quite some time to fully understand and realize how C uses pointers, in all its various ways). I think the problem comes when these same programmers see that Java and C have a similar style of syntax, and think that simply learning the superficial differences means they now understand the language. Two programming languages can look similar on the surface, but be very different beneath the skin. I'm also not sold on the concept of object oriented programming in general. Along the lines of "nothing is impossible with enough layers of indirection", I think too much abstraction also removes the programmer from what he/she is actually doing. OOP is a nice concept on paper, until you realize that most large programming projects are not written by a single person, and most people will not be coding the entire tree of abstraction they are using. This leads to errors that may be very difficult (if not impossible) to fully track down. > 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. Yes, that's true, but sometimes using that old trusty tool (C) can be just as effective as the shiny new tool (Java, C++, etc).