When C++ was created, its popularity skyrocketed. It was introduced as a general purpose programming language that was not only compiled but also object oriented. This meant that C++ had the performance of low level languages like C, being able to handle memory manually and using efficient stack and heap allocation, but also had the higher level paradigms such as classes and objects. However, as its popularity grew, its shortcomings became more apparent. Many developers had a hard time grasping the concept of manual memory management. Because they were writing in such a high level language, managing memory was not always the most intuitive and the accidental forgetting of a deallocation call would often always break the program. C++ also had to be compiled to each individual instruction set. This meant that a computer using an x86 chip running an MS-DOS based system wouldn’t be running the same code an ARM based chip running a Unix based system. This meant distribution of programs was much more difficult. Java was introduced to address these shortcomings.
Java is often regarded as the improved version of C++. While Java is not totally compiled, it utilizes certain features to ensure it could improve upon C++. While C++ usually runs by compiling code through gcc, Java runs on a program called the JVM, or Java Virtual Machine. The JVM is a program that can run Java bytecode. Java bytecode was introduced as a way to address the problem with distribution of programs. Developers could technically share their individual code files and have users compile them on their own computers, but this would risk proprietary information being leaked. Java addressed this issue by having its compiler interpret Java code and optimize it while making it non-human readable. This Java bytecode could then run on the JVM. The JVM was a cross platform program meaning Java code running on one computer would run identically on another. This improved not only performance but also code distribution. Developers were able to share their Java programs as individual JAR files without having to share the actual code of their programs. This is a large advantage over C++ as developers could now create programs in Java and easily distribute them to their consumers anywhere they could access them.
Additionally, Java enables automatic memory management. Because Java runs on a virtual machine, it is much easier to implement a garbage collector into the abstraction of the VM. This enables developers to not have to worry about how large their variables are, and instead let the JVM handle those problems. Like in C++, the new keyword allocates a new object on the heap. Additionally, Java uses both C++ level primitives and its own objects to represent variables. While variables like a char and int are primitives, String and ArrayList are not. However, all non-primitive Java classes have an abstraction in which the data they store is in some kind of Java primitive. Java’s object oriented nature allows it to be hidden from us while offering the same sort of functionality.
Today, Java is maintained by Oracle, with both proprietary and non-proprietary distributions. While the differences between the open source and closed source Java versions are minimal, the closed source Java distribution is much more well maintained. Java is also behind databases like Cassandra and MySQL which allow them to be run across different kinds of operating systems on servers. Additionally, games like Minecraft were written in Java, which just demonstrates its wide use cases.
Programming Languages and Resources for Software Developers
The most common programming languages for software engineers are C, C++, Python, and Java. Also, for building native mobile Apps, iOS Swift and Java Android are used for building iPhone and Android Apps respectively.
Java coding is well suited for those interested in pursuing a career in software engineering; however, other options are system admin, web design and development and mobile App design and development. It is advisable to consult with an IT career counselor to understand what career options best fits your skills. For instance, if you want to be a software engineer, learning HTML and CSS might not fit the bill. Here is an excellent article for learning more on coding and technology career roadmap. Once you know what career path you wish to pursue, you can make a plan on what, when, and how to learn. There are lots of online resources for learning coding and technology in general. For teenagers and high school students, High School Technology Services offers variety of hands-on training. For adults and professionals, Coding Bootcamps and DC Web Makers Companies offer basic to advance project-based programming and technology classes.