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 intended to be a companion to my CIS162AD course at Estrella Mountain Community College, which is an introduction to coding using the C# programming language. I’m trying to provide a lot of the content you’ll need in videos; this text organizes those videos and provides some additional information, code examples, and details.

I’m an English major, and I believe reading technical information is a critical skill for programmers. But, I also recognize that many students aren’t likely to push through large chunks of assigned reading. So the balance I’m going for is providing some technical information and details in the text, but not forcing you to get all of your learning by reading.

Keep in mind that while some of my students are majoring in Programming and Systems Analysis or some other coding-related degree, I also have a lot of students who aren’t going to be professional coders—​it would be foolish of me to think they really need a deep dive into this stuff. And since the ones who are majoring in Programming will go on to take additional programming classes where they can build on their coding knowledge, I feel like I can get away with keeping it a little stripped-down here—​what musicians might call low fidelity.

Aside from all that, I hate making students pay for textbooks. They keep getting more and more expensive, and many of those books go into far more depth than my first-year programming students need. Those big textbooks at least make good technical reference sources both during the course and down the road—​but being that kind of comprehensive reference is not my goal.

My main goal is to help you learn the fundamentals, and for you to walk away with a solid foundation in coding. 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 intersted 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

Before starting a chapter, review the relevant information on the "overview" page in Canvas. Then, start reading the chapter in this eBook.

  • This book is lo-fi because much of the content you need is delivered in videos, 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.

  • Each chapter begins with What’s the Point?, which gives you an idea of what you should be able to do after reading the chapter.

  • Reading and watching videos isn’t enough to learn programming. You need to stop occasionally 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 some cases, these markers also indicate the spot where you have learned enough to complete a practice assignment for class.

  • 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.

  • There are some topics that I think are important or useful but fall outside the scope of the course. These optional or expanded topics are marked with a Deep Cut or B-Side icon, 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.

    B-Sides

    These are links to outside resources that are related to our content. Assignments and quizzes will not include these topics—​they are only included in case you’re curious.

  • All coursework (assignments and quizzes) will be in Canvas. I make an effort to align assignments to the content in the eBook, so the examples in the eBook and videos should help.

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: Introduction to C# (CIS162AD)

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

We’ll be learning the fundamental of computer programming using a language called C#--we’ll learn more about C# in the next chapter. Software development (coding) requires some tools that probably aren’t already installed on your computer. We’re going to look at some popular options for those tools and get them installed.

There are options available for Windows, macOS, and Linux computers.

C# development on a Chromebook, iPad, or similar device is problematic and not recommended for beginners.

The Canvas course includes some options for students who don’t have a computer capable of running the necessary software; you won’t need to purchase a new computer to complete this course. Similarly, all of the tools we’ll use are free (or offer a free version that’s adequate for our needs).

Required Tools

We’ll need two tools to develop C# programs:

The .NET Software Development Kit (SDK)

This is the software that enables our computer to run C# programs.

An Integrated Development Environment (IDE)

This is the software we’ll use to write and test your C# programs.

In general, it’s better to install the .NET SDK first, then install your IDE. However, the IDE you choose may include the .NET SDK, so you may only need to install one thing.

Selecting an IDE

An Integrated Development Environment (IDE) is the application we’ll use while developing our 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 C#--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’ll help you decide.

The first consideration is the operating system you’re using--Windows, macOS, or Linux--because that will determine which options are available to you. You can learn C# using any of those operating systems, but be aware that C# has traditionally been focuesed on Windows development, so most of the resources you’ll find out there are going to be for Windows. I’m a Mac user myself, so I’ll take care of macOS and Linux learners, but you should know there are many more examples and videos out there for Windows users. If that’s a concern for you, consider using a Windows computer for this course.

I will provide enough information to get started with any of the options below; once you’ve gotten the hang of how to create and run a project, all of my videos and examples will work the same way regardless of which IDE you’re using.

The simplest choice for Windows users is Visual Studio Community. macOS and Linux users wanting something as user friendly as possible—​and as close to Visual Studio Community as possible—​should use JetBrains Rider. People who like VS Code from previous coding experience should have no problem sticking with that.

Microsoft Visual Studio Community

Microsoft owns the C# language, so the original and most mature IDE for C# development is Microsoft Visual Studio. It’s the de facto standard (meaning, the most common choice) for C# development on Windows Visual Studio is an enterprise-grade IDE that’s used by professional developers all over the world, and is the industry standard for C# development.

Microsoft has another product called Visual Studio Code, which is a different product and not the same thing as Visual Studio. We’ll look at that below.

Visual Studio is the safest choice for Windows users, and it’s available in several "editions" to suit different needs; the free version is called Visual Studio Community and that’s all we’ll need for our purposes.

There are two potential reasons to pick an IDE other than Visual Studio:

  • It’s packed with features, but that includes a ton of stuff we won’t need or use. That means it’s potentially overwhelming for beginners. I don’t think it’s a big deal, but if you’re after a simpler experience, you might want to look at the other options.

  • It’s Windows-only, so if you’re using macOS or Linux, Visual Studio Community is not an option. Note: Microsoft used to offer a version of Visual Studio for macOS, but it was discontinued in 2020. I strongly recommend against using that version, even if you can find it.

In most of my own videos, I will be not be recorded using Visual Studio, but that’s because I’m using a Mac.

Other IDE Options

If you don’t want to (or can’t) use Visual Studio, there are other options available to you. I have two recommendations.

JetBrains Rider

JetBrains Rider is a commericial IDE that is designed specifically for C# development. The Rider user experience seems to be modeled after Visual Studio—​and I mean that in a good way.

For most students, this will be the next-best choice (after Visual Studio Community).

Pros
  • Available for Windows, macOS, and Linux.

  • Free for personal (non-commercial) use.

  • It’s a full-featured IDE that’s specifically designed for C# development.

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

Cons
  • It’s 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.

  • It’s not as popular as Visual Studio or Visual Studio Code, so there are fewer resources available to help you learn how to use it.

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

Visual Studio Code

Microsoft also offers a free, open-source IDE with the potentially confusing name Visual Studio Code, "VS Code". It’s intended to be a very lightweight, flexible IDE that can be used for many different programming languages. The base version of VS Code doesn’t include much support for C# (or any other language), but you can add that support with an easy-to-install extension. 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.

If you’re not already familiar with VS Code, I don’t think there’s a compelling reason to choose it over Visual Studio Community or JetBrains Rider.

Pros
  • Available for Windows, macOS, and Linux.

  • Free and open-source.

  • It’s 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.

  • Microsoft is agressively improving C# support in VS Code, so it’s getting better all the time.

Cons
  • Not as feature-rich as Visual Studio or 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.

I’ll probably record some of my video content using Rider and some using VS Code, so you’ll see both in action. VS Code is currently my favorite IDE, but I’m learning Rider so I can hopefully provide support to students who choose either.
Something Else?

You’re welcome to use any IDE you like, as long as it creates and handles solution files (.sln files), which we’ll learn about later. 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 one specific caution: don’t rely on a web-based IDE for this course. 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—​and likely don’t support .sln 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 C# formatting conventions and solution formats.

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

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.

Installing Visual Studio Community

Note Visual Studio Community will automatically install the .NET SDK, so you won’t need to install it separately.

Installing the .NET SDK and JetBrains Rider

After installing your IDE and, if necessary, the .NET SDK, you’re ready to start creating C# programs!


Check Yourself Before You Wreck Yourself (on the assignments)

Review Questions

  1. What tools do you need to develop C# 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: