Click here to Skip to main content
15,881,248 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: New code in C? Where and why, versus C++? Pin
Stuart Dootson3-Mar-21 1:24
professionalStuart Dootson3-Mar-21 1:24 
GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch3-Mar-21 1:29
mvahoney the codewitch3-Mar-21 1:29 
GeneralRe: New code in C? Where and why, versus C++? Pin
Stuart Dootson3-Mar-21 1:54
professionalStuart Dootson3-Mar-21 1:54 
GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch3-Mar-21 2:06
mvahoney the codewitch3-Mar-21 2:06 
AnswerRe: New code in C? Where and why, versus C++? Pin
Gary R. Wheeler3-Mar-21 2:57
Gary R. Wheeler3-Mar-21 2:57 
AnswerRe: New code in C? Where and why, versus C++? Pin
mischasan3-Mar-21 6:46
mischasan3-Mar-21 6:46 
GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch3-Mar-21 6:50
mvahoney the codewitch3-Mar-21 6:50 
AnswerRe: New code in C? Where and why, versus C++? Pin
Chad3F9-Mar-21 11:46
Chad3F9-Mar-21 11:46 
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.
GeneralIs this right place? Pin
Nagy Vilmos2-Mar-21 2:14
professionalNagy Vilmos2-Mar-21 2:14 
GeneralRe: Is this right place? Pin
den2k882-Mar-21 2:16
professionalden2k882-Mar-21 2:16 
GeneralRe: Is this right place? Pin
OriginalGriff2-Mar-21 2:17
mveOriginalGriff2-Mar-21 2:17 
GeneralRe: Is this right place? Pin
Nagy Vilmos2-Mar-21 2:27
professionalNagy Vilmos2-Mar-21 2:27 
GeneralRe: Is this right place? Pin
OriginalGriff2-Mar-21 2:28
mveOriginalGriff2-Mar-21 2:28 
GeneralRe: Is this right place? Pin
Nagy Vilmos2-Mar-21 2:46
professionalNagy Vilmos2-Mar-21 2:46 
GeneralRe: Is this right place? Pin
OriginalGriff2-Mar-21 2:50
mveOriginalGriff2-Mar-21 2:50 
GeneralRe: Is this right place? Pin
W Balboos, GHB2-Mar-21 2:18
W Balboos, GHB2-Mar-21 2:18 
GeneralRe: Is this right place? Pin
OriginalGriff2-Mar-21 2:29
mveOriginalGriff2-Mar-21 2:29 
GeneralRe: Is this right place? Pin
W Balboos, GHB2-Mar-21 2:33
W Balboos, GHB2-Mar-21 2:33 
GeneralRe: Is this right place? Pin
OriginalGriff2-Mar-21 2:51
mveOriginalGriff2-Mar-21 2:51 
GeneralRe: Is this right place? Pin
W Balboos, GHB2-Mar-21 3:12
W Balboos, GHB2-Mar-21 3:12 
GeneralRe: Is this right place? Pin
OriginalGriff2-Mar-21 3:26
mveOriginalGriff2-Mar-21 3:26 
GeneralRe: Is this right place? Pin
W Balboos, GHB2-Mar-21 3:33
W Balboos, GHB2-Mar-21 3:33 
GeneralRe: Is this right place? Pin
honey the codewitch2-Mar-21 5:04
mvahoney the codewitch2-Mar-21 5:04 
GeneralRe: Is this right place? Pin
OriginalGriff2-Mar-21 5:41
mveOriginalGriff2-Mar-21 5:41 
GeneralRe: Is this right place? Pin
Rage2-Mar-21 4:17
professionalRage2-Mar-21 4:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.