General > General Technical Chat
How many people code in C these days, and if so, why?
tszaboo:
C is great and it is worth learning. They absolutely should start all programmer courses with it. And C++ with all it's fault, extends on it. Even if you dont use a language all features, you can use the underlying ideas when you write code. For example, you can take the OO aspects, and write better C code for microcontrollers.
That being said, I'm not a programmer. I'm an EE, who uses programming as a tool to get another job done. I learned python a few years back, and it was a game changer for me. I never want to write C code ever, which would run on a PC. If any of my colleague does it, then my typical question is " whats wrong with you, you could've written that code in python, probably 2 lines". And it is.
I occasionally still write C code. Bringing up a MCU or something like that. Or honestly, spending a few days on setting up compilers, linker files, debuggers, licenses for all these, just to write a bitbanging SPI in a few minutes, or something trivial like that. Constantly repeating in myself " this would be 5 minutes on a PC with some REPL".
I am wondering when is it all going to change. I mean, I used to write ASM code for PIC16 and AVR8. And most kids are learning some bastardized C++ as Arduino. We've come a long way, but not far enough.
bd139:
We went all the way a while ago and everyone misunderstood it (FORTH)
nctnico:
--- Quote from: NANDBlog on May 04, 2020, 10:34:36 pm ---I am wondering when is it all going to change. I mean, I used to write ASM code for PIC16 and AVR8. And most kids are learning some bastardized C++ as Arduino. We've come a long way, but not far enough.
--- End quote ---
A few years ago I wanted to give embedded Lua a try to run on a microcontroller (AFAIK there is also micro-Python nowadays). Lack of time and the Lua environment needing more work than I cared for at the moment prevented me from going further. A lot of code doesn't need to run at lightning speed but does stuff which is complicated enough. A high level language certainly helps to make implementing high level functionality easier. Recently I finished a project which involves an embedded Linux platform. The customer can change the functionality using a Lua script (which talks to a device specific API written in C).
IMHO there is certainly a future for using languages like Lua and Python on microcontrollers. C and C++ are not very effective to write complicated control algorithms; C and C++ get in the way quickly. But this will probably end up in another 'assembler versus C' like debate which lasted for over a decade.
coppice:
--- Quote from: nctnico on May 04, 2020, 11:15:23 pm ---IMHO there is certainly a future for using languages like Lua and Python on microcontrollers.
--- End quote ---
Python is a bit of a resource hog, but I've seen people using Lua on quite small devices.
IDEngineer:
Answering the subject line: Probably 95% of my freshly authored code is in C99. The other 5% is Assembly on whatever platform, to hand-optimize specific sections of code.
I learned C++ when it was released, figuring it was the natural evolution of C. C++ taught me how to recognize when a language is too cumbersome: When you have to think more about how to express something in the language rather than actually doing it. That's what I always liked about C... it just feels so natural. Like a good oscilloscope, the tool disappears. It just becomes an extension of my brain, like my own fingers are probing the circuit (scope) or my own fingers are moving bits around (language). If you have to keep the scope manual handy, or the language docs open in another window, your tools are getting in your way.
I did a HUGE (and very successful) project in Java a few years back. Essentially C with a layer of OO on top. So, like C++ and just as useless. Haven't had a need to touch it since.
I recently learned Python to help teach a university course. OMFG. The bad features of many languages, with very few of their advantages. Could I get better at it? Sure... but why? Its major "advantage" is "it has so many canned libraries available". But that's true of C and many other languages. I'm glad I learned Python because now I can honestly steer students AWAY from it.
On most platforms, C is the first compiler that is offered. Other languages then (sometimes) follow, using C to build their environment. Which means that whatever platform you're considering, C is probably available. That's a darned strong recommendation for any language.
I'm open minded enough to learn new languages (hence Java, and Python). But the real world where actual work gets done and projects get shipped keeps bringing me back to C and Assembly. Maybe I'd feel differently if I worked on mainframes or something where you're widely abstracted from the hardware. But for the work I do down here in the trenches, where the line between hardware and firmware/software gets blurry in a hurry, it just keeps being C.
YMMV, not trying to start an(other) argument, just my $0.02, standard disclaimers, etc.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version