C++ sucks???

Все о программировании под *nix
Hermit
Неотъемлемая часть форума
Сообщения: 354
Зарегистрирован: 22 сен 2004, 13:47
Откуда: Minsk
Контактная информация:

C++ sucks???

Сообщение Hermit »

вот, прочитал и задумался...
A recent posting to the lkml requested help in porting the C++ Click Modular Router kernel module from the 2.4 stable kernel to the 2.6 stable kernel. The request was for ideas on fixing C++ related compilation errors, but the thread quickly turned into a lengthy debate on whether or not C++ had a place in the Linux kernel. The issue has been debated many times before, long ago earning its own entry in the lkml FAQ which offers numerous reasons why the kernel is not written in C++.

During the recent discussion, when it was suggested that perhaps the kernel is written in C simply because "we've always done it that way...", Linux creator Linus Torvalds joined in to explain:

"In fact, in Linux we did try C++ once already, back in 1992. It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

"The fact is, C++ compilers are not trustworthy. They were even worse in 1992, but some fundamental facts haven't changed:
1) the whole C++ exception handling thing is fundamentally broken. It's _especially_ broken for kernels.
2) any compiler or language that likes to hide things like memory allocations behind your back just isn't a good choice for a kernel.
3) you can write object-oriented code (useful for filesystems etc) in C, _without_ the crap that is C++."
Оригинал Здесь

Аватара пользователя
Pasha
Неотъемлемая часть форума
Сообщения: 554
Зарегистрирован: 06 окт 2002, 12:39
Откуда: Southampton
Контактная информация:

Сообщение Pasha »

Of course it does. What is the point of using C++ in kernel when the code has been successfully being written in plain C. There will be no less bugs if you use C++.

1. AFAIK, most of Windows applications is written in C++. :)
2. Does anyone actually know what the Windows kernel is written in?

Аватара пользователя
Llama
Неотъемлемая часть форума
Сообщения: 9749
Зарегистрирован: 06 фев 2002, 11:40
Откуда: Менск

Сообщение Llama »

Pasha, на сях в винде ядро, и ассемблере местами наверное. И win32 api не объектный ИМХО. На ++ еще никто рабочего ядра не написал AFAIK, разве что BeOS, и то не уверен.
Опыт растет прямо пропорционально выведенному из строя оборудованию

Аватара пользователя
Pasha
Неотъемлемая часть форума
Сообщения: 554
Зарегистрирован: 06 окт 2002, 12:39
Откуда: Southampton
Контактная информация:

Сообщение Pasha »

Понятно

Ответить