LWN.net Logo

Why use C?

Why use C?

Posted Jun 29, 2012 19:42 UTC (Fri) by dashesy (subscriber, #74652)
In reply to: Why use C? by tshow
Parent article: Why learn C? (O'Reilly Radar)

Good points! C is instruction-agnostic assembly language. You can write C code to run on almost any micro-controller and the result is almost the same as direct assembly. I used C for 8951, because assembly code is hard to remember and maintain and saving few bytes is not worth it. If I want to target a *real* embedded system with known and limited memory, or where code reuse is not good (a firmware) I choose C, but trying to use C to write GUI is insane.

I think part of the reason many people are scared of Linux desktop is the old crappy looking GUI toolkits they saw 10 years ago in their college, and modern and shiny GUI like Qt needs a higher level languages.


(Log in to post comments)

Why use C?

Posted Jun 30, 2012 1:04 UTC (Sat) by Wol (guest, #4433) [Link]

If you're targeting hardware with little ram, use Forth! :-)

Anecdotes again :-) but a competent Forth programmer should be able to produce code that's smaller than the equivalent assembly!

A Forth executable is, by it's very nature, stripped of pretty much all extraneous stuff, and very compact into the bargain. So much so that it's very hard for an assembler programmer to keep their version down so small.

Cheers,
Wol

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds