Click here to Skip to main content
15,867,330 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
David O'Neil2-Mar-21 8:10
professionalDavid O'Neil2-Mar-21 8:10 
GeneralRe: New code in C? Where and why, versus C++? Pin
W Balboos, GHB3-Mar-21 2:42
W Balboos, GHB3-Mar-21 2:42 
AnswerRe: New code in C? Where and why, versus C++? Pin
giulicard2-Mar-21 21:41
giulicard2-Mar-21 21:41 
AnswerRe: New code in C? Where and why, versus C++? Pin
Martin ISDN2-Mar-21 23:40
Martin ISDN2-Mar-21 23:40 
GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch3-Mar-21 0:34
mvahoney the codewitch3-Mar-21 0:34 
AnswerRe: New code in C? Where and why, versus C++? Pin
Behzad Sedighzadeh2-Mar-21 23:48
Behzad Sedighzadeh2-Mar-21 23:48 
GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch3-Mar-21 0:29
mvahoney the codewitch3-Mar-21 0:29 
AnswerRe: New code in C? Where and why, versus C++? Pin
Stuart Dootson3-Mar-21 0:01
professionalStuart Dootson3-Mar-21 0:01 
This is absolutely what I do. And I agree with you that so long as you understand and are happy with the 'hidden' code that C++ abstractions introduce, there's nothing wrong with using them.

The only time I'll use C rather than C++ is if I'm targeting a platform that doesn't have a C++ compiler. And yes, I have one of those - it's a proprietary processor, has a port of GCC, Gnat (the GCC Ada compiler) but not G++. Yes, it's for a safety critical application. No, I can't talk any more about it.

C++17 and 20 have introduced some nice new little abstractions, like std::string_view and std::span that would be useful in a C-ish world - basically, they're just pointer and length in a struct...

Also - things like lambdas, once you realise they're just a function pointer (if you have no captures) or a function object, are equally usable in a resource constrained environment.

The main thing I'd be wary of would be over many templates, in case they introduce too much code with multiple instantiations of functions for different template parameters.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p


modified 3-Mar-21 6:08am.

GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch3-Mar-21 0:28
mvahoney the codewitch3-Mar-21 0:28 
GeneralRe: New code in C? Where and why, versus C++? Pin
Stuart Dootson3-Mar-21 1:10
professionalStuart Dootson3-Mar-21 1:10 
GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch3-Mar-21 1:19
mvahoney the codewitch3-Mar-21 1:19 
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 
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 

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.