Chapter 2. Variables, Statements, and Methods Dive into C# code

You’re not just an IDE user. You’re a developer.

You can get a lot of work done using the IDE, but there’s only so far it can take you. Visual Studio is one of the most advanced software development tools ever made, but a powerful IDE is only the beginning. It’s time to dive in to C# code: how it’s structured, how it works, and how you can take control of it...because there’s no limit to what you can get your apps to do.

Take a closer look at the files in your console app

In Chapter 1, you created a new C# Console App project and named it MyFirstConsoleApp. When you did that, Visual Studio created two folders and three files.

Let’s take a closer look at the Program.cs file that it created. Open it up in Visual Studio:

A statement performs one single action

A console app is an app with a text-only user interface. All its input and output goes to a console, like the Windows command prompt, the macOS Terminal, or Linux Terminal.

Your app has two lines:

  1. The first line is a comment. Comments start with two forward slashes // and everything after those slashes is ignored. You can use comments to write notes about ...

Get Head First C#, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.