Soundcheck
A few things before we drop the needle
This eBook isn’t trying to to cover everything a regular textbook would cover. It’s a little stripped-down and simplified—what musicians might call low fidelity, or lo-fi.
This content is intended to be a companion to CIS150AB, which is an introduction to object-oriented programming. Since you’ll be attending (or viewing recordings of) lectures, and you’ll have access to additional content in Canvas (our LMS), this text doesn’t try to cover everything; it tries to give you the basic information you’ll need in order to get the most out of that other content.
It’s also lo-fi because the purpose of this particular course, at least from my perspective, is not to give students a comprehensive look at a programming language. It’s an introductory course that’s taken by a variety of students. If you’re a coding student—majoring in Programming and Systems Analysis or Web Design and Development, for example—you’ll take language-specific courses that will get much more detailed, so our goal here is to give you a foundation for that. If you’re majoring in something else, you might never write another line of code after the semester ends—I want you to learn about programming and software development so you can communicate with the coders in your workplace and have a general understanding of how an idea becomes a program or app.
It’s also possible that I just don’t know very much. You know, a lo-fi brain.
But why are we stuck reading THIS eBook?
The primary reason I wrote this is because real (high fidelity?!?) textbooks are expensive. As I started to record more and more videos to supplement the real textbook I was using, students had less and less reason to actually read it. But I can’t cover everything we need in my videos, so I started writing content to fill in details I couldn’t get to.
To be clear, this isn’t lo-fi just because students don’t bother to read textbooks that are dense and detailed. That sometimes seems true, but you’re different; I can tell just by looking at you! The truth is, professional developers need to be good at reading; you’ll need to read documentation to stay current and develop new skills. But I acknowledge that many students prefer video content and in-person instruction rather than reading, so this is my attempt to meet those students halfway.
This eBook might not be very good or very detailed, but it is very free.
And why are we using Java instead of MY favorite language?
Looking at you, Python nerds…
Okay, there are a few reasons I use Java to teach OOP:
-
It’s cross-platform, so my students can use Windows, macOS, or Linux machines and I can grade the work without hassle on whatever machine I’m currently using.
-
I like the way Java implements OOP, which I think is "stronger" than in Python, for example (though not as strong as C#, in my opinion).
-
Java is strongly, statically typed, meaning we have to declare data types when we make our variables and that type can’t change. I believe this "stricter" approach to data types is better for beginners.
-
Since it uses C syntax, Java skills transfer well to many other languages.
-
At Estrella Mountain Community College, we have other CIS classes that teach C# (my favorite OOP language) and Python. I want students using something different for this course so that they get exposed to multiple languages before they graduate.
If I’m doing this right, what you’re mostly learning here is a good foundation of OOP (and general programming) skills and concepts. We happen to be using Java to do that, but these skills transfer to pretty much any other language you want to learn.
How to Use This Book
-
Each chapter begins with What’s the Point?, which gives you an idea of what you should be able to do after finishing the chapter content.
-
This book is lo-fi because much of the content you need is delivered via video content, making this a little stripped down. When you see Time to Watch, just watch the embedded (or hyperlinked) YouTube video. Quizzes in Canvas may include questions about the video content, and assignments will require the skills and concepts covered in videos.
Time To Watch!
Be sure to watch the embedded video. Where applicable, there will be links to files used/created in the video.
-
After the video, continue reading the chapter. The text content in the eBook is intended to be brief, with an overview of the topic, code examples, and details not covered in the videos.
-
Reading and watching videos isn’t enough to learn programming. You need to stop regularly and try out what you’re learning.
Take It for a Spin
When you see Take It for a Spin, it’s a good time to open your IDE and write some code. In many cases, these markers also indicate the spot where you have learned enough to complete a practice assignment for class.
-
There are some topics that I think are important or useful (or just cool) but fall outside the scope of the course. These optional or expanded topics are marked as Deep Cuts, with links to additional information, either on an external website or in the [deep-cuts] section at the end of the book.
Deep Cut
These generally add a little extra to skills/concepts in the eBook and videos. Since I’ve intentionally kept the content pretty minimal, I’ve left out all kinds of interesting and useful stuff. Assignments and quizzes will not include these topics, but these are things I expand on at the end of the book.
-
At the end of each chapter, Check Yourself Before You Wreck Yourself (on the assignments) provides a few questions to help you review the material. You can find sample answers to these questions at the very end of the eBook, in the Liner Notes section.
Related Resources
In general, this book includes resources within each chapter. The following links collect those resources so you can find them when necessary.
GitHub landing page: https://timmcmichael.github.io
YouTube channel: @ProfTimEMCC
Course YouTube playlist: Object-Oriented Programming Fundamentals (CIS150AB)
Source code files:
The source code files shown in the eBook and videos are available on GitHub; a link at the beginning of each chapter will take you to the appropriate folder in the repository. If you have trouble finding something (or using the GitHub site), please contact me at tim.mcmichael@estrellamountain.edu or in Canvas.
Setting Up Your Programming Environment
Our goal is to learn the fundamentals of object-oriented programming using the Java programming language. You might not even know what those things mean yet, but to get started you’ll need a couple of things installed on your computer.
- Java Development Kit (JDK)
-
A collection of software, used to develop Java programs. Most importantly, it includes a compiler.
- Integrated Development Environment (IDE)
-
An application used to write and test source code.
These two tools can be used on pretty much any laptop or desktop computer, even if it’s not very powerful.
Java development on a Chromebook or iPad is tricky and not recommended for beginners. Use a different computer if at all possible. |
The Canvas course includes some options for students who don’t have a computer capable of running the necessary software.
Install the Java Development Kit
I recommend installing the JDK available at https://adoptium.net, and the Oracle JDK is another great option. The linked documents below provide detailed installation instructions—but if they are outdated at the moment, there are about a gazillion web pages and Youtube videos that will show you the process. I recommend installing the JDK before installing your IDE.
Install an IDE
A computer program is created by writing source code, which is just text and can be created using any text editor. However, developing programs with something like Notepad or TextEdit—which come with Windows and macOS, respectively—means going through some potentially confusing (or at least intimidating) steps each time you want to run your program. Though IDEs do much more, the most important thing they do for beginners is give you a "run" button you can press whenever you want to test your code.
You can definitely write Java programs without using an IDE, but it’s kinda like getting engaged to someone you’ve only ever met online: just because it turns out okay for some people doesn’t mean it’s a good idea for you. The only people who should write code without an IDE already know too much about programming to be wasting their time reading this book.
There are many great IDEs out there, including many free options, and ultimately it doesn’t matter which one you use: they all produce the same files, and a person looking at the files can’t tell what IDE you used. It’s like choosing between Word and Google Docs; each has strengths and weaknesses, but you can write romantic poems about your online fiancé (or fiancée) in either one.
I primarily use Visual Studio Code ("VS Code"), so that’s what you’ll see in most of my videos. It’s completely free and is available for Windows, macOS, and Linux. You can download it at https://code.visualstudio.com, and the videos below walk through installing VS Code and the tools it needs for Java development. I recommend installing a JDK (see previous section) prior to installing an IDE.
Visual Studio Code is not the same as Visual Studio! There’s a free version of Visual Studio (called Visual Studio Community) but it’s not intended to be used with Java. You’re going to want Visual Studio Code (aka "VS Code") for your Java coding. |
Once you’ve installed the JDK above, install the IDE you are going to use to learn Java. There’s nothing wrong with trying out multiple IDEs to find out which one you prefer. Other popular options include eclipse, IntelliJ IDEA, and Apache NetBeans, and they all have free versions that are great for learning Java.
But my recommendation is to install VS Code.
Time To Watch!
Installing VS Code on Windows for Java
Note: If you are on a school-issued laptop, or are having trouble with the Windows installer, you can also install from the Windows app store: Installing VS Code on Windows from Microsoft Store
Installing VS Code on macOS for Java
Once you’ve installed the JDK and VS Code (along with the Java extensions), you’re ready to create your first program.
Check Yourself Before You Wreck Yourself (on the assignments)
Review Questions
Sample answers provided in the Liner Notes. :sectnums: