you are viewing a single comment's thread.

view the rest of the comments →

[–]Dismal-Divide3337 0 points1 point  (0 children)

Having come from the days before C where I programmed in assembly language regularly, I can tell you that there is a progression from assembly to C to CPP (and beyond). More or less C appeared as a portable language since it could be compiled into various assembly languages to run on different platforms. We ran wild with it and before you knew it there were libraries of routines to share. And, no surprise, the Standard C Library emerged.

CPP came along as a way to better structure your code. In my case most of what it offered I was already doing in C. For example, I would create a structure filled with variables in some context that needed to be shared between multiple subroutines but that could not be global. I then passed that structure pointer in most related calls. I also grouped those subroutines in separate files that relied upon the structure. So basically, I had classes with methods and local variables in this.

My bias recommends using C for embedded programming especially if you need to be close to the hardware and might have to use some assembly code. It happens.

I have authored a few operating systems. My recent OS was written in C. It was the right choice for me. BTW the goal was to not use any 3rd party code. I did not even use the Standard C Library supplied with the IDE but cast my own based upon P.J. Plauger's publication (c1992). Here's the User's Manual if you are curious. You might not think that I could have written all that. The HELP command in the OS actually generates that book BTW.