If a C programmer asks "do you want to see something cool?", run away.
--John Van Enk

Saturday, January 19, 2008

Линус критикует C++

Via aruslan узнал об ответе Линуса на вопрос Dmitry Kakurin почему Git написан на С а не на С++. Больше всего понравились цитаты
Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C.
Что и говорить, тут трудно не согласиться, поскольку многие программеры на С++ считают себя сильно "мегакрутыми" (коими в действительности не являются) для того чтобы снизойти до чистого С. Это действительно хороший способ :-)
C++ leads to really really bad design choices. You invariably start using
the "nice" library features of the language like STL and Boost and other
total and utter crap, that may "help" you program, but causes:

- infinite amounts of pain when they don't work (and anybody who tells me
that STL and especially Boost are stable and portable is just so full
of BS that it's not even funny)

- inefficient abstracted programming models where two years down the road
you notice that some abstraction wasn't very efficient, but now all
your code depends on all the nice object models around it, and you
cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and
portable C++ ends up to limit yourself to all the things that are
basically available in C. And limiting your project to C means that people
don't screw that up, and also means that you get a lot of programmers that
do actually understand low-level issues and don't screw things up with any
idiotic "object model" crap.
Подобные мысли и меня когда-то одолевали. Ну а согласно The Cathedral and the Bazaar успех софтины зависит от других факторов. Ветвь дискуссии по вопросу Дмитрия. Занятное чтиво.