Developing “Hello World”

There are at least two ways to enter, compile, and run the programs in this book: use the Visual Studio .NET Integrated Development Environment (IDE), or use a text editor and a command-line compiler (along with some additional command-line tools to be introduced later).

Although you can develop software outside Visual Studio .NET, the IDE provides enormous advantages. These include indentation support, Intellisense word completion, color coding, and integration with the help files. Most important, the IDE includes a powerful debugger and a wealth of other tools.

Although this book tacitly assumes that you’ll be using Visual Studio .NET, the tutorials focus more on the language and the platform than on the tools. You can copy all the examples into a text editor such as Windows Notepad or Emacs, save them as text files, and compile them with the C# command-line compiler that is distributed with the .NET Framework SDK. Note that some examples in later chapters use Visual Studio .NET tools for creating Windows Forms and Web Forms, but even these you can write by hand in Notepad if you are determined to do things the hard way.

Editing “Hello World”

To create the “Hello World” program in the IDE, select Visual Studio .NET from your Start menu or a desktop icon, and then choose File New Project from the menu toolbar. This will invoke the New Project window (if you are using Visual Studio for the first time, the New Project window might appear without further ...

Get Programming C#, Second 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.