ITSE 1330 | C#

ACC

C# Overview

Topics at a Glance

The topics below are covered in the course. Keep in mind that C# development is an enormous subject. There are many additional resources available to the learner and some of the more prominent are listed on the Resources page at the end of the course. Even though many additional web and text resources exist, all of the information required to complete the course assignments is contained in the chapters on this ITSE1330 site. Students are encouraged to access alternate assets to enhance understanding.

Managed Language

C# is known as a "managed language". This means that deletion of memory is no longer required by the programmer. Memory is "managed" by a runtime execution engine. The deletion process is known as "garbage collection" and it happens automatically without programmer intervention. Java, JavaScript, VB.NET, and PHP are examples of other managed languages. The advantage of managed languages is that the task of memory clean-up happens automatically and is not the responsibility of the programmer. When unused memory is not deleted (reclaimed) significant stability and performance issues occur .

C and C++ are well-known examples of un-managed languages in which the programmer is responsible for deleting memory when it is no longer needed by the program. An advantage of un-managed languages is the programmer has more refined control over memory and can (must) specify when it is deleted. If a programmer allows a process to create memory and does not also delete the memory when it is no longer needed, then a condition known as a "memory leak" can occur which can stall or take-down a system due to insufficient memory resources being available. Another undesirable condition known as a "dangling pointer" can result when a pointer variable is not cleared after the memory to which it points has been deleted.

Compile-time Typing

C# shares a number of commonalities with other languages. For instance, like C, C++, and Java, C# is a strongly-typed language which requires that the type of data stored in variables must agree with the type of the variable and this must be determined at compile time (the first compilation phase). JavaScript, on the other hand, is loosely-typed which permits a variety of data types to be stored in the same variable. Use of the dynamic keyword in C# provides "dynamic typing" which enables the execution engine to determine type at runtime (the second compilation phase).

Sequence - Selection - Repetition

C# programs are also built using the same high-level constructs as all other programming languages, namely, sequence, selection, and repetition. The words decision and iteration can be used interchangeably with selection and repetition respectively. Sequence is performing one task in code after another. So, one line of code is executed and then the next and so on. Decision entails performing alternative tasks. For instance, if the Spurs win game seven of the NBA Finals they become world champions. Another example of a decision structure is, if I go snow skiing over spring break then we will not go to the beach. Iteration, the last of the three constructs, is an engineer's way of saying looping or performing some tasks multiple times. For instance, we may construct a loop to play a piece of music until the user cancels the operation. You will find it helpful to keep these three fundamental constructs in mind if you are a beginning programmer - sequence, selection, and repetition are used to build the world.

What's Next?

Before beginning our work with Visual Studio, let's take a brief tour of the most important aspects of object orientation. We will then proceed with the remaining topics in the course listed below and on the navigation panel on the left of all pages: