Is Arduino breathing new life into C?

My son is taking a beginning programming class at our community college and it is C. My brother took that same class 20+ years ago. I learned it 30 years ago. I wonder why anyone would use c anymore unless they were programming resource limited devices like the atmega328.

Because, as K&R say:
"In our experience, C has proven to be a pleasant, expressive and versatile language for a wide variety of programs. It is easy to learn, and it wears well as one's experience with it grows."

Surely since the programming is actually done on a PC, the resources of the target device are irrelevant? Any language could presumably be used on the PC side, as long as its compiler was good enough to create machine code that fits in the target?

Just a reminder - Arduino is programmed using C++.

Wonder what the Arduino team would have used if C hadn't been invented? Forth maybe? :grin:

Pascal.

outsider:
Wonder what the Arduino team would have used if C hadn't been invented? Forth maybe? :grin:

It won't fit in most AVR memory spaces.

outsider:
Wonder what the Arduino team would have used if C hadn't been invented? Forth maybe? :grin:

B :smiley:

shawnlg:
My son is taking a beginning programming class at our community college and it is C. My brother took that same class 20+ years ago. I learned it 30 years ago. I wonder why anyone would use c anymore unless they were programming resource limited devices like the atmega328.

In the world of microcontrollers, C has always been dominant. ~20 years ago a significant number of microcontrollers were programmed in assembly, but since 2000 C has replaced most assembly programming.

Part of my current job is to review code from customers of our analog and power ICs: 99% of what I see is done in C. The compilers usually support C/C++, but the actual code I get is almost always C. That said, there's another FW engineer in my company that supports different ICs and he says he sees C++ regularly (his largest customer is Cisco, however, which is a product space in which I've never designed).

Oddly enough, the only product I can think of off the top of my head that doesn't use C is the Roomba, which uses Lisp of all things.

So no, you can't credit the Arduino with breathing new life into C. Technically, it's programmed with a language called Processing which is derived from C++ which in turn was derived from C.

I remember back in the early '80s I became semi proficient with GW Basic on my 286 and decided to step up to a "Pro" language so bought a copy of Borland Turbo C. After a few days of cursing and hair pulling I said "who the heck would ever try to program with this sh**"!. Boy, was I wrong, I love it now.

Don't forget Unix, Linux and Android. The kernels are always C/C++ AFAIK.

Oh yes, the Arduino team could have used the Bash shell language, whatever that is. Why didn't I think of that? :grin:

BigBobby:
So no, you can't credit the Arduino with breathing new life into C. Technically, it's programmed with a language called Processing which is derived from C++ which in turn was derived from C.

Processing is derived from Java. Perhaps you're thinking of Wiring.

AWOL:
Processing is derived from Java. Perhaps you're thinking of Wiring.

Hmm...ok. Thanks for letting me know.

Although most of Java's syntax was borrowed from C/C++ so there is still a connection :slight_smile:

Honestly, I was using the Arduino for over a month before someone on StackOverflow freaked out on me for using C/C++ tags on my question about the Arduino. He downvoted me and scolded me for calling Processing code C/C++ (at which point I thought "wtf is Processing?).

outsider:
Wonder what the Arduino team would have used if C hadn't been invented? Forth maybe? :grin:

LOL...you can program the Arduino Uno in Forth!

http://playground.arduino.cc/CommonTopics/ForthOnArduino

Not like I'd recommend it. Honestly, I haven't heard Forth mentioned in years.

BigBobby:
Technically, it's programmed with a language called Processing which is derived from C++ which in turn was derived from C.

Wonder what the Arduino team would have used if C hadn't been invented? Forth maybe?

Arduino is far from the first "easy to use microcomputer for the masses." Nearly all of the predecessors (and competitors) have used some version of BASIC. (8051 BASIC, Stamp BASIC, PICAxe BASIC)

Forth fits fine (and you can put Forth on Arduino hardware), but it has pretty much proven itself NOT to be the sort of language that mere mortals can use very easily.

The next generation might be using Python (BBC Micro:bit runs micro-python.)

There are a bunch of popular languages for desktops that suffer from large RAM requirements. While a modern microcontroller can have a megabyte or so of flash for program storage, RAM is usually much more constrained (<128kbytes. Usually a LOT less - The original Arduino had 1k.) Modern desktop languages essentially throw RAM at a bunch of the traditional "problems", and would MUCH rather have 1M of RAM...

One of the nice things about C is that it has relatively few keywords. Dennis was smart enough to push many language details and the I/O into the Standard Library. Still, C has a robust set of operators that play nicely at the hardware level.

Also, partly because of the above, it's pretty easy to move a C compiler from one platform to another by just messing around a bit with the code generator. As a result, there are a lot of very useful programming tools available that have been developed for C over the past three decades. My software company developed our own C compiler back in the 80's because we needed a C compiler that had floating point numbers for our statistics package. Whitesmith's was the only one that had FP at the time and continents drift faster than it printed out FP numbers in a tight loop. We developed our compiler with the BDS C compiler in a "self-eating watermellon" fashion. Today, major companies find it fairly easy to move across platforms because of the tools that are available.

While C may not be the "best" language around, but it must have something going for it or it wouldn't still be in such widespread use after all this time.

The answer to the Title is simple.

NO.

C/C++ would survive quite nicely without the Arduino system.

That said I only use C/C++ on the Arduino because I have no choice.

...R