History of C
In contrast, Java was developed by James Gosling, Mike Sheridan, and Patrick Naughton in 1991.
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:
Syntax and practical differences: These are the small differences between C and Java that can be stumbling blocks as you learn the new language.
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.
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.