|
I use C heavily, because it's easier to write cross-platform, cross-compiler code.
In particular, the ABI doesn't change between different (minor!) versions of the compiler.
For performance, C tends to be simpler code for sharp new algorithms.
That's particularly true for data-oriented designs and flow-based programming.
Also for libraries that other (C++) systems depend on.
There are C conventions that make "subclassing" easier. FWIW C99 made that simpler.
Opinion:
I'm tired of C++ trying to fix last version's problems with yet another complicated construct,
(auto_ptr? smart_ptr? unique_ptr? ...) requiring code restructuring in ways that other teams may have problems grokking. C++ seems to prefer hiding things, or at least slapping another coat of paint on them. Like getting from point A to point B via a Hilbert curve.
|
|
|
|
|
I do share your frustration with C++'s very much designed-by-committee** runtimes
** not that other languages aren't driven by standards bodies, but C++ very much "feels" like it is. Plowing through the STL standards is like trying to do pretty much anything at the DMV (at least in the states)
I can't find anything to argue about with your post in fact.
Real programmers use butterflies
|
|
|
|
|
I can't really advise you to use one over the other (as it's your personal preference), but I can tell you that I generally avoid doing C++ code over C for my own stuff.
Why? Perhaps I've been burned/annoyed by C++ too much over the decades (some of which may not be relevant anymore, but still has left a bitter taste)..
[rant-begin]
-- Mangling inconsistencies between compilers.
-- No unified naming conventions. Camel Case vs Pascal Case vs Snake Case.
-- Too much hungarian notation crap seen.
-- Headers with .hpp extension vs just .h (or worse, "standard" headers with no extension, causing pointless dummy files that include the real .h file in some implementations).
-- Overloading abused to non-intuitive things way too often.
-- Bloated / over-complex standard libraries.
-- The "new" C++ really should have been called something other than C++, since it has radically changed from early C++.
-- A bunch of translating back and forth needed when dealing with C APIs (most often C strings), which adds extra overhead.
-- .cpp files extensions. Always makes me think "C Pre-Processor", which predated C++. I mean, what where they thinking?! Though, .hpp files annoy me more. I use .cc when I must do C++ for my own projects.
-- Wrapping everything in "new" C++ (for memory/cleanup safety). Sure, it helps, but at what cost of hidden overhead, and is still no substitute for avoiding sloppy/undisciplined coding.
-- Bloated / over-complex standard libraries.. "I know that, technically, that’s only one drawback, but it was such a big one I thought I’d mention it twice." --Kryten/Red Dwarf
[rant-end]
In some cases I will still write a C++ wrapper for my C code, if it's a library, just for people who prefer using an OO API.
Now don't get me wrong.. some of the features of C++ are nice (like function grouping, protected methods, polymorphism), but often not worth the price of all the negatives.
|
|
|
|
|
The man at the door said I could get a good argument here!
veni bibi saltavi
|
|
|
|
|
To the soapb... oh.
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
I'm sorry, but I'm not allowed to argue unless you've paid.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I paid the gentleman in the pink tutu at the door.
veni bibi saltavi
|
|
|
|
|
If you want me to go on arguing, you'll have to pay for another five minutes.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You're not Eric are you? I was told to ask for Eric.
veni bibi saltavi
|
|
|
|
|
No, he's an Idle
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Aside from everything else, being a comparative newcomer to this place (and seeing no other place around this place, this must be the place) - I have to ask. Which of the two in your picture is supposed to be you?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Which one was the Alien, and which the Predator?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I cautiously avoided asking if they were parental in nature. Now without a bottle of Gin in tow (and never put toe in Gin). After all, I don't know the guy as well as some of you beyond his poor taste in liquor.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I dunno, Gin can be rather pleasant, especially if you pour an unopened bottle of Vermouth into the glass.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: especially if you pour an unopened bottle of Vermouth into the glass. . . . and fill it to the top and skip the gin?
You'd probably be better off (flavor and aroma) by drinking witch hazel.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
No, the idea of the unopened bottle is that it lets the idea of Vermouth permeate the Gin* to create a truly Dry Martini.
* Instead of the actual substance, which would be a criminal offence.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Way back in the days of Prohibition (a funny little experiment that let religious fanatics tell everyone how to live) they produced a product called "Bathtub Gin[^]". It was so named because it's only redeeming quality was the (usually) drinkable alcohol.
That, however, would seem to be a step viz-a-viz production of the genuine article - worthy of production in that other floor-level container usually found in the same room as the bathtub.
Just sayin' . . . (and at least you got me to be positive about it)
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Do you just store them in the same cabinet?
Real programmers use butterflies
|
|
|
|
|
By preference, you don't store them in the same county.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I see what you did there, and I like it.
|
|
|
|
|
Nagy Vilmos wrote: The man at the door said I could get a good argument here!
Whisky is better than gin.
/trollface
Seriously though, welcome back. 🍻
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
'ello, decided the banter is better here?
|
|
|
|
|
I just posted a question at the top that could be taken as bait if someone were so inclined, though it wasn't written as bait, it's a C vs C++ thing, so I expect there to be casualties.
Real programmers use butterflies
|
|
|
|
|
Yes, arguments can be found. The "good" part is another argument in itself.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Upon entry, you do not "get" an argument, you supply an actual one for the formal one declared by the man at the door.
|
|
|
|