General > General Technical Chat
How many people code in C these days, and if so, why?
SiliconWizard:
--- Quote from: coppice on May 04, 2020, 11:18:24 pm ---
--- 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.
--- End quote ---
Lua is great, and the interpreter is quite small in size (although still not that small for very small devices, but I think there are very stripped down Lua interpreters for those.)
Thing to consider though is that, to do anything really useful with Lua, the basic object you have at your disposal is a dynamic table. Dynamic tables ARE Lua (if you wanted to sum it up very shortly.) And so they are not that great a fit for devices with a very small amount of RAM.
Now of course you can still do stuff in Lua without using tables, but from my experience, you'd be pretty limited. Just a small thought.
bd139:
Lua. Hmm.
https://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF
amyk:
I still use C becase it's simple and it works. Both embedded and desktop (Win32). "Modern C++" seems to have developed a disgusting fetish for abstraction and while the source may seem smaller, it creates a hugely bloated binary.
spudboy488:
I develop PCB test equipment in a one man shop. I have 2 preferred CPUs (PIC16F689 and PIC18F46K22) that I use depending on the project. I initially coded in assembly on the 689 but switched to Hi-Tech C when I started using the 46K22.
For me, using C allowed, basically, the same code can be used on both CPUs. There are obviously differences but the low level stuff is handled in the libraries I wrote. This hides the CPU differences from the high level test functions. I have base software that will set up each CPU depending on various #define statements and all I have to add is the custom test routines for the project.
Picuino:
In an electronics blog like this there will be many examples of microcontroller programmers who prefer to program in c because it is the best or the only high-level language option.
But in the world of computer programming, the c language is also the best option for many projects. Operating systems such as Linux, Windows or OSX, drivers, languages interpreted as Python or PHP and even compilers of other languages are all programmed in c.
According to the TIOBE index, the C language is the most widely used of all, much more than C++
https://www.tiobe.com/tiobe-index/
Although C++ is like C with improvements, it seems that the greater complexity of the language is precisely an argument against it.
One more reason to program in C is that it is very portable. You can port C libraries between different systems, but C++ libraries cannot. There is not always a C++ compiler available.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version