Introduction To Programming: Creating and Running Your First C# Program
Introduction To Programming: Creating and Running Your First C# Program
Programming
Creating and Running Your First C# Program
Telerik School
Academy
Telerik Software Academy
http://
schoolacademy.telerik.com
Table of Contents
1.
2.
3.
4.
5.
What is
Computer
Programming?
Define: Computer
Programming
Computer programming:
creating a sequence of
instructions to enable the
computer to do something
Definition by
Google
Programming Phases
Define a task/problem
= Specification
Plan your solution
= Design
Write code
= Implementation
Fix program error (bugs)
= Testing & Debugging
Make your customer happy
= Deployment
Your First C#
Program
First Look at C#
Sample C# program:
using System;
class HelloCSharp
{
static void Main()
{
Console.WriteLine("Hello, C#");
}
}
C# Code How It
Works?
Include the
standard
namespace
using System;
"System"
Define a class
called
"HelloCSharp"
Define the
Main() method
the program
entry point
class HelloCSharp
{
static void Main()
{
Console.WriteLine("Hello, C#");
}
}
using System;
The { symbol
class HelloCSharp
{
should be alone
static void Main()
on a new line.
{
Console.WriteLine("Hello, C#");
}
}
The } symbol
should be
under the
The block
after the
{ symbol
9
Example of Bad
Formatting
using
System
Such
formatting
makes the
source code
unreadable.
;
class
HelloCSharp
{
static
void
Main(
{
Console
.
WriteLine
C#"
) ;Console.
WriteLine
(
again"
)
)
("Hello,
"Hello
10
What is "C#"?
Programming language
A syntax that allow to give
instructions to the computer
C# features:
New cutting edge language
Extremely powerful
Easy to learn
Easy to read and understand
Object-oriented
11
Knowledge of a programming
language
C#
Task to solve
Development environment,
compilers, SDK
Help documentation
MSDN Library
12
What is .NET
Framework?
What is .NET
Framework?
C#
Visual Basic .NET
Managed C++
... and many others
15
ASP.NET
Web Forms, MVC,
Web API, SignalR
Windows WPF /
Forms XAML
WinJS /
Win8
FC
CF and WWF (Communication and Workflow Tier)
ADO.NET, EF, LINQ and XML (Data Tier)
CL
R
16
Language Runtime
(CLR)
Managed execution environment
CLR
17
Framework
Framework Class
Library
Visual Studio
Visual Studio Integrated
Development Environment (IDE)
Development tool that helps us to:
Write code
Design user interface
Compile code
Execute / test / debug applications
Browse the help
Manage project's files
20
Benefits of Visual
Studio
21
22
Visual Studio
1.
2.
3.
24
4.
Namespa
ce not
required
Some
imports are
not required
Class
name
should
be
change
d
25
Running Programs
28
Debugging in Visual
Studio
Breakpoints
Ability to trace the code execution
Ability to inspect variables at
runtime
29
Visual Studio
Visual
Studio
Blank
Creating a Solution
Solution
Without Projects
What Is a Blank
Solution?
VS Blank Solution
33
Visual Studio
Blank Solution
Live Demo
What is
MSDN
Library?
Related articles
Library of samples
Use local copy or the Web version
at http://msdn.microsoft.com/
36
MSDN Library
37
Online version
Use the built-in search: [F1]
38
MSDN Library
Browsing and Searching Documentation
Live Demo
Introduction to
Programming
Questions
?
http://academy.telerik.com
Exercises
1.
41
Exercises (2)
5.
Install at home:
Microsoft Visual Studio (or Visual Studio
Express)
42
Exercises (3)
10.Provide
43
Fundamentals of C# Programming
Track of Courses
academy.telerik.com
csharpfundamentals.telerik.com
facebook.com/TelerikAcademy
forums.academy.telerik.com