actually i didn't say that just to say it, there are some particularities he doesn't like... at least in C++, he doesn't like its exception handling, stated as broken especially for kernels; finally, he wrote that he thinks every language which hides something like memory allocations behind you isn't good for kernels.
Torvalds is a fucking kernel module developer and hence his opinion about c++ is fucking IRRELEVANT.
Are you about to write an operating system from scratch? No? Then stop giving a fuck about his opinions on programming languages.
- - - Updated - - -
C++ is basically just an 'extension' to C. ASM, C, C++ all of them access the memory & are executed the same way, directly by the CPU.
They all compile to object/machinecode.
Zer0Mem0ry
C/C++ Programmer, Youtuber, software enthusiast & hobbyist.
Donate: (bitcoin): 1JhSKGgRQmir8rRF4Sm5CP4fDDofKFAypd
Youtube: https://www.youtube.com/channel/UCDk...ariJF2Dn2j5WKA
Skype: virtual_coder
Oh yes, he developed a kernel, so he is just a kernel developer. How the fuc.k do you reason? Torvalds is a general software-engineer, easy.
That is: c++ exception handling is bad for kernel. You aren't going to develop a kernel? Then it's good.
Summarizing, this is what you think about.
Cool story, bro. Cy@
Zer0Mem0ry
C/C++ Programmer, Youtuber, software enthusiast & hobbyist.
Donate: (bitcoin): 1JhSKGgRQmir8rRF4Sm5CP4fDDofKFAypd
Youtube: https://www.youtube.com/channel/UCDk...ariJF2Dn2j5WKA
Skype: virtual_coder
No ok, you are continuing to write meaningless things. C++ can access ring0, I've repeated it many times. I don't understand what you do mean for _useful_.
What?
A kernel is the core of an operating system, an interface between software and hardware. Qt isn't needed for developing kernel: its main purpose is to develop softwares with a graphical user interface. Boost works in low-level programming too, but it's not essential. In C there are also modern libraries as alternative (glib/gio), or APR. The only advantages of developing kernel in C++ are the object oriented peculiarities of the language, but it may bring inefficiency.
No, no, no, no. You completely missed my point here. And I know exactly what a kernel is, thank you. I was talking about usermode development, you know, standard Win32 applications, not kernel programs. And I was making a point why C++ is superior to C in usermode32 dev.
Also, I was not saying that kernel development couldn't be done with C++, it's just a bit 'harder' than in C, because of the pitfalls C++ has for that (like constructors, runtime, e.g) Hence linux being written in C, C++ takes more effort to get the job done.
Last edited by nullptr_t; 08-30-2016 at 01:02 AM.
Zer0Mem0ry
C/C++ Programmer, Youtuber, software enthusiast & hobbyist.
Donate: (bitcoin): 1JhSKGgRQmir8rRF4Sm5CP4fDDofKFAypd
Youtube: https://www.youtube.com/channel/UCDk...ariJF2Dn2j5WKA
Skype: virtual_coder
If you had known what a kernel is, you probably didn't suggest using Qt: a kernel is not simply a software.
You were referring just about usermode, but what does it has to do with the discussion?
And no, you can't consider C++ better than C without specifying in which context it is. A C++ programmer is not constrained to use exception handling, especially in kernel code, but why should you use that language which does that extension which you are not going to use? Same thing for the OO paradigm when writing kernel code. I would prefer to make use of simplicity, I don't want to have something more that I won't to use.
Seriously, if you don't understand this I don't want to continue an useless discussion with you.
C++ runtime is largely the C runtime, it hasn't nothing to do with it.
Did blatantly just leave my comments unread but still decided to reply?
Oh my god, I never suggested using Qt on lower rings (you even can't!), I was talking aboutIf you had known what a kernel is, you probably didn't suggest using Qt:
regular program development, UI and so on.
Even though it's the base of the operating system,a kernel is not simply a software.
it's basically just a big collection of binaries executed by the CPU.
Sounds like software to me.
But I did? The context was general software development, for users. Like Utilities, Games, Tools, you name it.And no, you can't consider C++ better than C without specifying in which context it is.
Correct, I would still prefer C over C++ in lower level development, but's that's the only area it beats C++.A C++ programmer is not constrained to use exception handling, especially in kernel code, but why should you use that language which does that extension which you are not going to use? Same thing for the OO paradigm when writing kernel code. I would prefer to make use of simplicity, I don't want to have something more that I won't to use.
I believe I understand kernel level to the same extent as you do, if not even further. You just misinterpret my previousSeriously, if you don't understand this I don't want to continue an useless discussion with you.
comments, which is fine. Maybe I didn't write them clear enough.
That's partially true, yes. C++'s STL inherits and extends the standard C libraries, but it'sC++ runtime is largely the C runtime, it hasn't nothing to do with it.
also vastly different, wider and is structured so differently than the C libraries.
We are talking generally about which language is better C++ or C. When it comes to programming aboutYou were referring just about usermode, but what does it has to do with the discussion?
90% of the devs never, ever even approach kernel/ring0 development, so an argument from A famous guy
who basically only develops kernel modules, is pretty irrelevant for us, normal developers that target the Win32
or other usermode environments.
There are just so much more up-to-date, easy to use, advanced libraries for C++
when comparing what C has to offer. Don't get me wrong, C behind every modern
popular language in way or another, and still, today everything you can achieve in
higher level languages can be achieved in C too, that just means a little more work.
But back to the point, C++ has superseded C thus making it 'bit' obsolete for a
modern time programmer. There are much wider variety of libraries and interfaces
for C++ than there is for C. And you can complete your work with less lines of clean looking code
and have a faster output & better results with C++.
C++'s standard features and libraries are still being updated and maintained while C's latest standard
update took place on 2011 and the previous one 1999.
C++ has much wider userbase and is richer on libraries.
It's 3rd party libraries are updated, new ones created, and old ones maintained more frequently than C's.
Final Blow:
- Templates
- Function overloading
- References
- Namespaces
- You can use structs and enums without writing struct or enum before every declaration or using typedefs.
Even if you don't define your own classes, using C++'s string and container classes is still often more convenient and safe to work with than c-style strings and arrays.
- Type safety (even though some would call it weak)
- Exceptions
- Variable declarations in conditionals, C99 only has it in 'for'
- Object Orientation
(pasted from: https://stackoverflow.com/questions/3...-better-than-c)
Then there is the final factor why C++ is better than C:
You don't miss out on any features of C when writing C++ code, you can write mostly C, but then you can
take advantage of all of the C++'s libraries' features.
- - - Updated - - -
Also, why the fuck is your name javalover? Java is an embodiment of what Linus Torvalds hates the most.![]()
Last edited by nullptr_t; 08-30-2016 at 12:42 PM.
Zer0Mem0ry
C/C++ Programmer, Youtuber, software enthusiast & hobbyist.
Donate: (bitcoin): 1JhSKGgRQmir8rRF4Sm5CP4fDDofKFAypd
Youtube: https://www.youtube.com/channel/UCDk...ariJF2Dn2j5WKA
Skype: virtual_coder
First two rules to discuss with me: using correct english, not doing the blowhard.
I quoted every part of your reply. How did you think I didn't read it?
Yes, you can. Qt includes also low-level application functionalities.
No. The kernel is a mediator (interface) between software and hardware. It's what allows software and hardware to iteract between them. It's not a collection of binaries, and you can't call a kernel a software.
Hey, thank you judge of the correct/incorrect. But, incorrect. Today C doesn't beat C++, but years ago C was better to use because of the compilers. Torvalds wrote Linux in C because there was no great and nonbuggy C++ compiler back in 1990, and because of the philosophy of the simplicity (I've already wrote it about: I don't need that bad C++ exception handling or other OO peculiarities, so I prefer to use something simpler).
I don't even want to reply you here, you are so disquieting that you underestimate people you do not individually know. Maybe you will understand when you'll be matured.
No, we are talking about which language is better to write kernel code: C++ or C. Don't go more OT than we currently are.
However, Torvalds isn't just a kernel developer, it's a general programmer. If I develop a kernel, does this mean I am just a kernel developer?First two rules to discuss with me: using correct english, not doing the blowhard.
Runtime = collections of functions in the standard library. They may be a bit different in their implementations because C doesn't have generics or templates, but as the implementation may change, the concepts are not different. But we are talking about kernel-code, so some of the main concepts we will need to know like thread scheduling, coroutines, optimizing allocation mechanism and others are largely similar, so it's true. For example, coroutines could be used in the kernel as linkage for an event-wait code.
What's your problem of understanding this:
Now you don't get me wrong: you wrote just something totally out of context, not necessarily something wrong.
What the f.uck does it have to do with it? Assuming Torvalds doesn't like Java, does this mean I'm forced to hate it? Seriously, everyone has his preference.
Isn't this topic about polymorphic code?
OfTopic: @javalover is clearly the more advanced guy here, but I don't want to interfere here.
Would be cool to have a topic with your discussion, because it's pretty stirring and interesting.