Sound Check

A few things before we drop the needle

This eBook was developed as a companion to my CIS156 course at Estrella Mountain Community College, which serves as an introduction to programming for students in a variety of career and degree programs. The centerpiece of the book is really the video content, with the text providing context, code examples, and additional details.

I believe that being able to read and learn from technical text is a critical skill for programmers and other IT professionals. But, I also know that many students aren’t likely to read large amounts of assigned text. So, this book is my attempt at a compromise: you will need to do some reading, but you’ll have video content that puts the concepts into practice.

The nature of this course means that I work with students from a few different career paths. While some students are majoring in Programming and Systems Analysis (or some other coding-related degree) and will go on to be professional programmers, most of my students will need only a basic understanding of programming concepts to succeed in their chosen field. Cybersecurity and system administration students, for example, may create or use Python scripts to automate tasks, but are unlikly to participate in large-scale software development projects. Students going on to careers in IT management will benefit from understanding how software is created, but probably won’t write much code themselves. Even web development students—who will write code of some kind—will probably not develop for a console or desktop environment, as we do when learning Python. So, I don’t expect most of my students to need a deep, technical understanding of Python. The ones who will go on to programming careers will be taking additional coding classes where they will deepen their understanding of Python and other languages, so for this course I can strip the content down; what musicians might call low fidelity, or lo-fi.

Setting aside all of that pedagogical reasoning, I really don’t like making student pay for textbooks. Traditional textbooks are outrageously expeensive and go much deeper into programming than my introductory students need. My goal isn’t to create a comprehensive reference source.

Instead, I want students to leave this course understanding fundamentals of progrmming that will serve as a foundation or additional learning, or as a basis for working with scripts and software developers

And my ulterior motive is to help you enjoy programming and experience the nerdy goodness of writing a cool piece of code, so that at the end of the course you are interested in sticking with it and learning more.

And if the book sucks, at least you didn’t pay for it.

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.

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: Beginning Python (CIS156)

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

Although our goal is the learn coding fundamentals that will apply to any programming language, we do need to use one specific language to do it. We’re going to use Python for this course, and we’ll learn more about the language (and why we’re using it) in the next chapter.

In order to create and run Python programs, we’ll need a couple of things installed on your computer.

Python

The Python installation includes a handful of tools, including the Python interpreter, which runs Python programs.

Integrated Development Environment (IDE)

An application used to write and test your Python programs

These two tools can be used on pretty much any laptop or desktop computer that runs Windows, macOS, or linux, even if it’s not very powerful.

While Python development on a Chromebook, iPad, or similar device may be technically possible, it’s difficult for beginners and is not supported for this course.

All of the tools we’ll use are free (or offer a free version that’s adequate for our needs).

Installing Python

Your IDE installation may install Python if necessary, but I recommend installing it first to ensure that you have the correct version.

Python is available free of charge from the official Python website, python.org. Python is continuously being updated and improved, so there are many different versions available. In general, you should install the latest stable release, and since multiple versions of Python can coexist on the same computer, there’s no reason not to install the latest version for this course.

macOS comes with an old version of Python (2.x) already installed, but that version is outdated and not suitable for this course.

To install Python:

  1. Go to python.org.

  2. Click on the Downloads link.

  3. The website should automatically detect your operating system and provide a link to the appropriate installer. Confirm that it’s correct, then click the link to begin the download. If it does not correctly identify your operating system, the site will provide links to find other versions.

  4. Run the installer and follow the prompts to complete the installation.

Note: the Python website is subject to change. If the instructions above are out of date, please contact me at tim.mcmichael@estrellamountain.edu so I can update them.

Selecting an IDE

An Integrated Development Environment (IDE) is an application coders use to develop programs. Think of it as a word processor—you can write your History essay in Microsoft Word or Google Docs. They both do pretty much the same thing, and your professor won’t know or care which one you use, so picking between them is a matter of preference. If you’re already familiar with a particular IDE—and that IDE supports Python—you can choose to use it for this course. If you’re new to programming, or if you want to make sure you’re using a tool I can help you with, I have a couple of recommendations.

JetBrains PyCharm

JetBrains PyCharm is a commericial IDE that is designed specifically for Python development. It is very robust and is widely used by professional Python developers.

For most students, this will be the best choice.

Pros
  • Available for Windows, macOS, and Linux.

  • Free for personal (non-commercial) use.

  • It’s a full-featured IDE that’s specifically designed for Python development out of the box.

  • Similar look and feel to other JetBrains products, so if you’ve used IntelliJ IDEA or Rider, for example, it will feel familiar.

Cons
  • Not free for commercial use, so if you’re planning to use it for a job or to make money, you’ll need to pay for a license.

  • Not as lightweight as VS Code, so it might be slower on older computers.

Visual Studio Code

Microsoft offers a free, open-source IDE called Visual Studio Code, or "VS Code". It’s intended to be a very lightweight, flexible IDE that can be used for many different programming languages. The idea is that the base installation is minimal, and then you add extensions to provide support for the specific work you’re doing. In fact, it’s so lightweight that many people argue that it’s not really an IDE at all—it’s more of a text editor with some IDE features. In other words, it doesn’t come with built-in support for Python (or any other language), but its easy to add that support after installation.

Microsoft has another product called Visual Studio Community, which is a different product and not the same thing as Visual Studio Code.
Pros
  • Available for Windows, macOS, and Linux.

  • Free and open-source.

  • Very popular, so there are lots of resources available to help you learn how to use it.

  • Supports many different programming languages, so you can use it for other courses or projects.

  • The extensions used for Python have been around for a while and work very well.

Cons
  • Not as feature-rich as JetBrains Rider, even with extensions installed.

  • Not as user-friendly; created for power users, so it can feel a little primitive to beginners.

  • Support for C# is relatively recent; though it’s getting better, it’s not as robust as the other options.

  • Although there are a lot of resources for VS Code, most of those will be for different programming languages.

Much of my video content is recorded using VS Code, but I try to mix it up so that there are examples using both IDEs.

Something Else?

You’re welcome to use any IDE you like. But be aware that I will not be able to support you if you run into trouble with an IDE I’m not familiar with, and I can’t give points for files that, for one reason or another, I’m not able to open and run. And one specific caution: don’t rely on a web-based IDE for this course (i.e., a web page that lets you write and run Python code). They’re fine for some things, but they’re not adequate for the programs we’ll create as the course goes on. And since web-based IDEs often output weird files, you’re at risk of getting a zero on work created using such a tool. I’m not going to spend time sorting out code that doesn’t use standard formatting conventions and file formats.

You can install and use multiple IDEs on your computer, so you can try them and see which one you like best.

IDE Installation Instructions

The linked documents below provide detailed installation instructions—but they are fairly straightforward, so even if some of the details are out of date, you should be able to figure it out. If that’s not the case, email me at tim.mcmichael@estrellamountain.edu so I can update this content.

Installing JetBrains PyCharm

The JetBrains website includes a page with detailed and up-to-date installation instruction for PyCharm.

While JetBrains recommends installing through their JetBrains Toolbox application, which manages and updates a variety of JetBrains products, the page also includes directions for a "standalone" installation. For this course, either installation method is acceptable.

If you plan to use other JetBrains products, or if you prefer a simplified installation and update process, the Toolbox application is a good choice. If you are trying to minimize the number of applications on your cmoputer, you may prefer the standalone approach.

Note: There used to be a free Community Edition and a paid Professional Edition of PyCharm, but JetBrains has unified to a single product. The single PyCharm installation is free for personal use, and you can purchase a license for commercial use if needed.

Installing Visual Studio Code for Python

COMING SOON!!!

AI Settings

By default, these IDEs will enable AI-assisted code completion features, which are like the autocomplete features on your smartphone, but for coding. These features can be helpful, but they are problematic for beginners and, in an educational setting, can easily cross over the line into academic dishonesty. Many IDE vendors have also implemented a paywall model for these features, requiring you to pay for a subscription after a period of free use.

In my own courses, we take a look at these features and have assignments that specifically use them, but AI-assisted code completion is not allowed on any other assignments. And, you’ll want to save your free use of the AI tools for those times in the course when we’ll be using them.

For now, you’ll need to disable AI assistance with the understanding that you can easily en-enable it later.

After installing your IDE of choice, you’ll be ready to write your first Python program—which we’ll do in the next chapter!


Check Yourself Before You Wreck Yourself (on the assignments)

Review Questions

  1. What tools do you need to develop Python programs?

  2. What does IDE stand for and what is it’s role in software development?

  3. What IDE did you choose? Why?

Sample answers provided in the Liner Notes. :sectnums: