General > General Technical Chat
How many people code in C these days, and if so, why?
<< < (10/99) > >>
Karel:
One could say that C is the most import programming language, together with Java.
SiliconWizard:
Take this for what it is of course, but the TIOBE index is in line with this: https://www.tiobe.com/tiobe-index/
BBBbbb:
Few remarks:
- In embedded space C is dominant. In safety critical industries C is absolutely dominant. Only space I know Cpp is dominant is Game Dev.
- Writing C style in Cpp is not C! There are differences between them. The more complex your SW gets, you'll find yourself digging through obscurities and undefined behaviors... and there are differences...
- I used to know Cpp, then I looked at what's done in Cpp17 (and Cpp20), and I have no idea what's going on.
SiliconWizard:

--- Quote from: BBBbbb on May 04, 2020, 12:51:33 pm ---- Writing C style in Cpp is not C! There are differences between them. The more complex your SW gets, you'll find yourself digging through obscurities and undefined behaviors... and there are differences...
--- End quote ---

Yes. I often warn against this. The standards for the common "subset" between C and C++ are quite different on a number of points.


--- Quote from: BBBbbb on May 04, 2020, 12:51:33 pm ---- I used to know Cpp, then I looked at what's done in Cpp17 (and Cpp20), and I have no idea what's going on.

--- End quote ---

As I often say, C++ looks like some kind of "all you can eat buffet".
It's a bit as though, to stay afloat for that long, the C++ committee had to add (/borrow from other languages) as many features and paradigms as they possibly could, and it's still going strong.
rstofer:

--- Quote from: engrguy42 on May 03, 2020, 05:45:28 pm ---
--- Quote from: rstofer on May 03, 2020, 05:39:22 pm ---
I have spent about 20 years trying to build up any enthusiasm for C++ and I just can't get there. 


--- End quote ---

I hear ya...but if you want a lot of fun try writing a ray tracer for 3D graphics.  :-+

It's a ton of fun, and C++ is almost mandatory. Although I think C and C++ are pretty much interchangeable with those graphics API's.

And then tie that into a C# interface and GUI.  :-+

And yeah, I have lots of fond memories of Fortran  :D

Are there still compilers available for that?? Hmm.......

--- End quote ---

There is gfortran which is fully compliant with Fortran 95 and implements large chunks of Fortran 2003 and Fortran 2008.  It seems to accept the fixed format arrangement of Fortran 77 and earlier.

Or, stepping back 50 years or so, I have an IBM1130 emulation running on an FPGA and I can use IBM Fortran IV (which wasn't fully Fortran IV) that I know and love.  Sure, it doesn't have the .EQ. type operators and it's missing a lot of other stuff but it, and compilers like it, got us to the Moon.  BTW, the 1130 Fortran compiler used 27 passes because the source and the compiler had to fit in machines as small as 4K words.  The company machine I used had 8k and my emulation has 32K, the max.  The original ran at about 400 kHz and mine runs at 50 MHz.

I mess around with Fortran quite a bit.  There are some classic functions that come up in engineering school (particularly in the math courses) that are worth coding up just for giggles.  Something like Euler's Method for solving differential equations comes to mind.  Could I write the code in C or C++, sure!  But it belongs in Fortran.

MATLAB comes into play quite a bit and the scripting language is somewhat similar to Fortran.

Just pick the right tool for the job and move on.

In C, I can get data hiding with static variables and I can limit the scope of functions by declaring them static.  It's nowhere near as sophisticated as the C++ class but it gets much of the benefit.  I use the same 'getters' and 'setters' concepts.


Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod