Home > Hot in web development > The Resurgence of C Programming

The Resurgence of C Programming

Way back in the early 1970s, learning C was a rite of passage for many students. By today’s standards, it’s not a very high-level language. But back in those early days, long before the arrival of Java and Python, C was considered high level, especially when compared to assembly languages.

In the preface to their book The C Programming Language, Brian W. Kernighan and Dennis M. Ritchie note that C “is not specialized to any particular area of application. But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly more powerful languages.”

To some degree, C was written for the purpose of elevating UNIX from a machine-level operating system to something resembling a universal platform for a wide range of software applications. Since its inception in 1972, C has been the common language of UNIX, which essentially means that it’s everywhere.

C and C++ are at the heart of Arduino, the open source project for building do-it-yourself devices and hardware. “Arduino code is essentially C and C++,” says Massimo Banzi, a cofounder of the Arduino project. “Right now, you can write Arduino code on an 8-bit microcontroller and then on an ARM processor. You can go right up to a Samsung Artik, which is essentially a Linux machine with an 8-core processor. We can run Arduino on top of Windows 10.”

Example 1-2. The same behavior as Example 1-1, using Arduino’s simplified C dialect (from the book Arduino Cookbook, 2nd Edition)
const int ledPin = 13; // LED connected to digital pin 13    void setup()  {    pinMode(ledPin, OUTPUT);  }    void loop()  {    digitalWrite(ledPin, HIGH); // set the LED on    delay(2000); // wait for two seconds    digitalWrite(ledPin, LOW); // set the LED off    delay(2000); // wait for two seconds  }

Learning About Software by Tinkering with Hardware

How does this play out in the real world? Let’s say you’re an aerospace engineer and you’re asked to improve the functionality of an actuator that moves a control surface, such as an aileron on the wing of an airplane. You might begin by using components from an Arduino kit to create a low-cost prototype of the actuator.

After you’ve got your prototype working, you can tinker around with it and optimize its performance. “If you are an engineer, you can take your idea and use Arduino to build prototypes very fast,” says Banzi. “So you might begin with Arduino and then decide to reimplement the code using another tool. But you might also wind up using Arduino all the way. Or you could use a C compiler to move your code to a piece of hardware that doesn’t run Arduino, but will run C or C++.”

Read Full Article

admin
The WebRecital is a dedicated User Interface/User Experience professionals who come together to provide design and research workshops, portfolio reviews, and educational outreach to the greater Seattle area.
http://webrecital.com/

Leave a Reply

Your email address will not be published. Required fields are marked *