Click here to Skip to main content
15,885,915 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
giulicard2-Mar-21 21:52
giulicard2-Mar-21 21:52 
AnswerRe: New code in C? Where and why, versus C++? Pin
trønderen2-Mar-21 6:32
trønderen2-Mar-21 6:32 
GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch2-Mar-21 7:19
mvahoney the codewitch2-Mar-21 7:19 
AnswerRe: New code in C? Where and why, versus C++? Pin
David O'Neil2-Mar-21 7:17
professionalDavid O'Neil2-Mar-21 7:17 
GeneralRe: New code in C? Where and why, versus C++? Pin
honey the codewitch2-Mar-21 7:20
mvahoney the codewitch2-Mar-21 7:20 
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 
Yes. I agree. To not mention that with the "placement new" operator is possible to create objects on existing memory blocks. Turning off the exception mechanism C++ is very good for the development of real-time embedded applications. Recreating the polymorfism in C, at best, has the same speed as in C++. But most of the time, C++ beats C in many areas, as the latter does not have templates. It's only possible to emulate them with macros, but macros, most of the time, are ugly and dangerous. Templates help with performances: for example, qsort has to do a callback to compare items; so, it spends CPU cycles, fools the CPU branch predictor, and possibly invalidates the level-1 instruction cache. With std::sort (or std::stable_sort) it's possible "to inject" the comparison into the algorithm. Yes, templates could make code bloating, but judicious use of non-template base classes could mitigate it.
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 
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 

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.