Chapter 3. Variables and Expressions
WHAT YOU WILL LEARN IN THIS CHAPTER
Basic C# syntax
Variables and how to use them
Expressions and how to use them
To use C# effectively, it's important to understand what you're actually doing when you create a computer program. Perhaps the most basic description of a computer program is that it is a series of operations that manipulate data. This is true even of the most complicated examples, such as vast, multifeatured Windows applications (e.g., Microsoft Office Suite). Although this is often completely hidden from users of applications, it is always going on behind the scenes.
To illustrate this further, consider the display unit of your computer. What you see onscreen is often so familiar that it is difficult to imagine it as anything other than a "moving picture." In fact, what you see is only a representation of some data, which in its raw form is merely a stream of 0s and 1s stashed away somewhere in the computer's memory. Any onscreen action—moving a mouse pointer, clicking on an icon, typing text into a word processor—results in the shunting around of data in memory.
Of course, simpler situations show this just as well. When using a calculator application, you are supplying data as numbers and performing operations on the numbers in much the same way as you would with paper and pencil—but a lot quicker!
If computer programs are fundamentally performing operations on data, this implies that you need a way to store that data, and some methods ...
Get Beginning Visual C# 2010 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.