Introduction

History of C

C was originally developed by Dennis Ritchie at Bell Labs between 1969 and 1973. It was used to a large degree to program the early Unix operating system. It was standardized in 1989 by the American National Standards Institute (ANSI), and later by the International Organization for Standardization (ISO). C is an extremely influential language. Its syntax has been widely copied by other languages, including C++, C#, Java, and JavaScript. For this reason C will look very familiar to Java programmers, though subtly wrong.

Ken Thompson (left) and Dennis Ritchie (right).

Ken Thompson (left) and Dennis Ritchie (right).

In contrast, Java was developed by James Gosling, Mike Sheridan, and Patrick Naughton in 1991.

James Gosling, the creator of Java, in 2008.

James Gosling, the creator of Java, in 2008.

Differences between C and Java

One of C’s most notable features is that it translates very naturally into the underlying machine code, on which modern computers run. This is a strength in that the code you write can be very efficient. But it’s also a weakness, in that less is done automatically for you by the compiler, which can significantly increase development time. Think of C as being like a manual-transmission or stick-shift car, in comparison to Java’s automatic-transmission. You have more control with C, but there aren’t as many guard rails for you when you make a mistake. This can be very frustrating for programmers who are new to C (just like driving a stick might be very frustrating if you’re used to an automatic).

This primer is not intended to turn you into an expert C programmer—that will only come after many hours of coding and solving difficult bugs. But it will help get you started, and answer some of your basic questions.

In this book, We will divide the differences between C and Java into three main categories:

  1. Syntax and practical differences: These are the small differences between C and Java that can be stumbling blocks as you learn the new language.

  2. Memory management: C’s memory management is much more hands-on, and it allows you to do a couple things that aren’t even possible in a Java program. We will discuss how it works here.

  3. Objects and Classes in C: C does not have classes like Java does. However it does contain something called a struct, which is related. We will discuss what it is, and how it can be used to program in an object-oriented way.


Licenses and Attributions


Speak Your Mind