Click here to Skip to main content
14,846,774 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.
 
AnswerRe: New code in C? Where and why, versus C++? Pin
trønderen2-Mar-21 6:32
Membertrø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
mveW Balboos, GHB3-Mar-21 2:42 
AnswerRe: New code in C? Where and why, versus C++? Pin
giulicard2-Mar-21 21:41
Membergiulicard2-Mar-21 21:41 
AnswerRe: New code in C? Where and why, versus C++? Pin
Martin ISDN2-Mar-21 23:40
MemberMartin ISDN2-Mar-21 23:40 
i would use C as a personal preference. it's subjective.

also i rather be in company of C programmers than C++, that is also one reason you would use a particular language.

but, i assume you posted a question to get some objective info as why C is a better choice than C++ in your use case scenario.

maybe it is not. C++ was designed by Bjarne with zero cost abstractions in mind - "What you don’t use, you don’t pay for. And further: What you do use, you couldn’t hand code any better."

lots of people in the game making business use C style code with the C++ compiler or as little as possible classes, shallow hierarchies and such. the C++ compiler is a powerful beast and we (the programmers) are in the business of automation. so in that sense it's a better choice.

C++ does not force you to use it in any way, that's good. i think Bjarne was hot on the OOP subject, if you read early editions of the book, but not so any more. he merely says C++ gives you complete support for OOP if you want it, among other things.

here is a statement from Bjarne's book that you may consider when programming embedded - "Except for the new, delete, typeid, dynamic_cast, throw operators and the try block, individual C++ expressions and statements need no run-time support."

for myself, i don't dislike OOP as a technical solution and capability. i dislike object orientation in people. that philosophy, look everything is an "object" and everything is related in hierarchies, took a wrong turn.

instead of a solution for a problem it became a problem of it's own and a philosophy of life. solving the problem of say input data > processing > output data with classes and objects (if you like) became looking at classes as something that has a life of it's own. carried away by work on the class rather then on the whole...

you know what i mean, that thing: this is a car and a car is a vehicle. then in the boom of OOP it became, either you do it our way or the highway.

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
MemberBehzad 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
MemberGary R. Wheeler3-Mar-21 2:57 
AnswerRe: New code in C? Where and why, versus C++? Pin
mischasan3-Mar-21 6:46
Membermischasan3-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
MemberChad3F9-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 

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.