3 ms·
I'm currently writing a C program that runs on a router. The router has 4mb of flash. It also runs linux has wifi and all the usual crap. We added VPN support
by laichzeit0 14y ago
I'm currently writing a C program that runs on a router. The router has 4mb of flash. It also runs linux has wifi and all the usual crap. We added VPN support. I don't have the "luxury" of including Perl or any other "run time system" like Python or Ruby because I have about 50kb of flash left for my own code and any customizations. In this case C (maybe even C++, but why if C will work?) is the best choice for the small userspace app I have to write. Over the years I've worked on enough embedded systems of all sorts and C has been the obvious choice. It worked out pretty well.
Whenever I meet someone who extols the virtues of language X I always, sort of cynically, ask them what low-level embedded work they've done and how X could be utilized for that use-case. It's one of those areas where most programmers don't seem to have much background, which if they thought about it would make the utility of C readily apparent.
- andrewflnr 14y agoI guess I should have said, "a good programmer might choose to use C++...". My point was, just because C++ is low-level doesn't mean everyone who uses it knows what they're doing down there, or could have chosen a different language if it wash good idea. Edit:rephrased last clause.