Sunday 28 August 2016

C#


Introduction to C#


A computer needs a set of instructions called a program to perform any operation. A program needs to be written in a specific language called programming language, so that the computer can understand the instructions. C# is one such programming language.

This chapter introduces you to C#. It explains how to define classes and declare variables in C#. In addition, it discusses how to create the object of a class. Further, it discusses how to write and execute C# programs.

Objectives


In this chapter, you will learn to:

  •    Identify C# basics
  •    Declare variables
  •    Write and execute C# programs

Introducing C#


Computer languages have come a long way since the 1940s. During that period, scientists punched instructions into large, room-sized computer systems. These instructions were given in machine language, which consisted of a long series of zeroes and ones. These machine language instructions were executed directly by the CPU. The machine language is called the First Generation of computer languages.

The 1950s saw the emergence of the Second Generation of computer languages, the assembly language. Assembly language is easier to write than machine language but still extremely complicated for a common man. However, the computer could still understand only machine language. Therefore, the Assembler software was developed to translate the code written in assembly language into machine language.

In 1967, Martin Richard developed a language called BPCL for writing operating systems. An operating system is a set of programs that manages the resources of a computer and its interactions with users. The era of the Third Generation of computer languages had arrived. In 1970, Ken Thompson modified BPCL to create a new language called B. While working for Bell Laboratories, Thompson teamed up with Dennis Ritchie and wrote an initial version of the Unix operating system for a DEC PDP-7 computer.