In order to get a more "big picture" view of computer science, let's take a moment to understand what software engineering is.
Roles of a Software Engineer
When we think about potential careers that come out of computer science, the most common one is being a software engineer. In this video, we'll take a moment to break down the details of what exactly it means to be a software engineer, ranging from what they consider when they write code to how they stay up-to-date with the ever-changing world of tech.
So looks like software engineers have a lot on their plate! Keep these things in mind as you begin your own venture into software engineering. Now, we'll shift to something a little more technical aspect of software engineering: the levels at which computer code exists.
The Levels of Computer Code
When we say that software engineers write "code", that's actually a pretty vague statement. This is because there are many levels at which computer code exists. It could be something as low-level as programming an individual circuit to light up a car's tail-light in a special pattern, or something as high-level as designing a machine learning model to recognize handwritten characters.
From Assembly to High-Level Languages
In the next few videos, we'll build from the ground up: from low-level machine and assembly languages to high-level programming languages.
So looks like there's a connection between these levels of software. Let's explore that further by understanding compilers and interpreters.
Compilers and Interpreters
When a software engineer writes code in a high-level language like Java, it has to get converted all the way down to machine language (which is just strings of binary) for the computer to understand. This is accomplished by compilers and interpreters, which both do the same job, just in two slightly different ways.
To review, the difference between compilers and interpreters lies in how they translate and execute code. Compilers translate all the source code into machine language at once, saving the resulting machine code as an executable. This executable file can then get shipped out to a user and be executed all at once. Interpreters, on the other hand, translate and execute the source code at the same time. This means that you need to actually have the source code when you want to execute the program, unlike compilers, which can just send out the machine code executable file.
Bytecode and the Java Virtual Machine
Java is unique because it doesn't use just a compiler or just an interpreter — it uses both! Let's dive in to this mixed compiler-interpreter approach and see how it actually works.
Java's bytecode approach was developed for efficiency, particularly for efficiency over the Internet. (Just-in-time compilers are also another example of improving efficiency.) You'll soon find that this is a recurring theme in computer science!
The Reusability of Code
Our last topic in this overview of software engineering is something very practical: the reusability of code. Let's dive in.
The biggest takeaway from this video should be that when you write code, it should be clear and easy for someone else to read and reuse. In the next unit, we'll explore some specifics of Java.