Академический Документы
Профессиональный Документы
Культура Документы
C# PROGRAMMING
IT111P
TODAY
• How awesome is C#?
• Differentiate C++ from C#
• Distinguish the different types of applications that can be
created with C# programming language.
• Identify and examine the basic elements of a C# program.
• Interpret a program written in C# programming language.
HOW AWESOME IS C#?
• C# is as awesome as the most awesome thing in this
awesome world.
• C# is the god of programming languages. HAHA!
• C# is the tool of awesome programmers.
• C# is always there when you’re down.
• C# will never leave you (from now until your graduation).
TRUER FACTS
TIOBE Programming Community Index for December 2011
TOP 5 Programming Languages
1. Java
2. C
3. C++
4. C#
5. Objective C
From: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
THE
ACTUAL
CHART
THEY SAY…
• that C# is basically Visual Basic with C++ characteristics
• that the syntax is very similar to Java
• that C# is basically from C++ which was from C
• that C stands for _________.
• that it is awesome
FIRST
• OOP / Object Oriented Programming – The concept behind
OOP is that applications can be organized around objects
rather than processes.
Namespace
comments
Class
Main
Method
Method Body -
Statements
1. COMMENTS
• Writing a comment is like making notes for yourself or for
readers of your program.
• Not considered as instructions
• Have no effect on the running of the program
• 2 MAJOR FUNCTIONS
1. Makes code more readable
2. Internally document what program statements are doing
1. COMMENTS
• THREE TYPES OF
COMMENTS
1. In line comment
2. Multiline or Block
comment
3. XML Documentation
comment
2. USING DIRECTIVES
• This section lists the
namespaces that the
application will be using
frequently,
• It saves the programmer from
specifying a fully qualified
name every time that a
method that is contained
within is used.
3. NAMESPACES
• Namespace is a grouping of related types contained in an
assembly.
• For example, the System.Drawing namespace consists of
classes, methods that are grouped together to achieve
similar tasks.
• You can define your own namespace and indicate that
these are names associated with your particular
application.
4. CLASS DEFINITION
• Everything in C# is designed around a class.
• A class is the building block of an object oriented
program.
• C# doesn’t allow anything to be defined outside a class.
• Every program must have at least one class.
• There are predefined classes in the .NET Framework,
example is the Drawing class which is an abstract class
that describes a 2-D drawing.
• This particular class contains its own set of methods and
properties.
*SIMPLE OOP
SIMULATION
Namespace: A category or brand of cars. Note that the brand
really doesn't have to dictate how the car is built. You can't
say a Honda always have four doors, or that it always has
4wd. Such specifics is up to the class to dictate.
Class: Blueprint for how to build a specific car.
Object: An actual car (instance) created from the car
blueprint (the class)
Method: Something a user of the car can make it do. Start(),
IncreaseThrottle(), Break(), OpenDoor() etc.
Property: Attributes, information and building blocks which
the car contains. E.g. Total running miles, color, steering
wheel dimension, stereo system etc etc.
5. MAIN() METHOD
• It is the “entry point” for all applications.
• This is where the program begins execution.
• Can be placed anywhere inside a class definition.