SlideShare una empresa de Scribd logo
1 de 43
Introduction to
Programming
Creating and RunningYour First C# Program
Svetlin Nakov
Telerik Corporation
www.telerik.com
Table of Contents
1. What is Computer Programming?
2. Your First C# Program
3. What is .NET Framework?
4. What isVisual Studio?
5. What is MSDN Library?
2
What is Computer
Programming?
Define: Computer Programming
Computer programming: creating a
sequence of instructions to enable the
computer to do something
Definition by Google
4
Programming Phases
 Define a task/problem
 Plan your solution
 Find suitable algorithm to solve it
 Find suitable data structures to use
 Write code
 Fix program error (bugs)
 Make your customer happy
= Specification
= Design
= Implementation
=Testing & Debugging
= Deployment
5
Your First C# Program
First Look at C#
Sample C# program:
using System;
class HelloCSharp
{
static void Main()
{
Console.WriteLine("Hello, C#");
}
}
7
C# Code – How It Works?
using System;
class HelloCSharp
{
static void Main()
{
Console.WriteLine("Hello, C#");
}
}
Include the standard
namespace "System"
Define a class called
"HelloCSharp"
Define the Main()
method – the
program entry point
Print a text on the console by
calling the method "WriteLine"
of the class "Console"
8
C# Code Should BeWell Formatted
using System;
class HelloCSharp
{
static void Main()
{
Console.WriteLine("Hello, C#");
}
}
The { symbol should
be alone on a new line.
The block after the
{ symbol should be
indented by a TAB.
The } symbol should
be under the
corresponding {.
Class names should use PascalCase
and start with a CAPITAL letter.
9
Example of Bad Formatting
using
System
;
class HelloCSharp {
static
void Main( ) { Console
. WriteLine ("Hello, C#" ) ;Console.
WriteLine ( "Hello again"
) ;}}
Such formatting
makes the source
code unreadable.
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
WhatYou Need to Program?
 Knowledge of a programming language
 C#
 Task to solve
 Development environment, compilers, SDK
 Visual Studio, .NET Framework SDK
 Set of useful standard classes
 Microsoft .NET Framework FCL
 Help documentation
 MSDN Library
12
Your First C# Program
Live Demo
What is .NET
Framework?
What is .NET Framework?
 Environment for execution of .NET programs
 Powerful library of classes
 Programming model
 Common execution engine for many
programming languages
 C#
 Visual Basic .NET
 Managed C++
 ... and many others
15
Operating System (OS)
Common Language Runtime (CLR)
Base Class Library (BCL)
ADO.NET, LINQ and XML (DataTier)
WCF and WWF (Communication and WorkflowTier)
ASP.NET
Web Forms, MVC, AJAX
Mobile InternetToolkit
Windows
Forms
WPF Silverlight
C# C++ VB.NET J# F# JScript Perl Delphi …
Inside .NET Framework
 Building blocks of .NET Framework
FCL
CLR
16
CLR –The Heart of .NET
Framework
 Common Language Runtime (CLR)
 Managed execution environment
 Executes .NET applications
 Controls the execution process
 Automatic memory management (garbage
collection)
 Programming languages integration
 Multiple versions support for assemblies
 Integrated type safety and security
CLR
17
Framework Class Library
 Framework Class Library (FCL)
 Provides basic functionality to developers:
 Console applications
 WPF and Silverlight rich-media applications
 Windows Forms GUI applications
 Web applications (dynamic Web sites)
 Web services, communication and workflow
 Server & desktop applications
 Applications for mobile devices
18
What isVisual Studio?
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 ofVisual Studio
 Single tool for:
 Writing code in many languages (C#,VB, …)
 Using different technologies (Web,WPF, …)
 For different platforms (.NET CF, Silverlight, …)
 Full integration of most development activities
(coding, compiling, testing, debugging,
deployment, version control, ...)
 Very easy to use!
21
Visual Studio – Example
22
Visual Studio
Compiling, Running and Debugging C# Programs
Creating New Console Application
1. File  New  Project ...
2. Choose C# console application
3. Choose project directory and name
24
Creating New Console Application (2)
4. Visual Studio creates some source code for you
Namespace
not required
Class name
should be
changed
Some imports
are not required
25
Compiling Source Code
 The process of compiling includes:
 Syntactic checks
 Type safety checks
 Translation of the source code to lower level
language (MSIL)
 Creating of executable files (assemblies)
 You can start compilation by
 Using Build->Build Solution/Project
 Pressing [F6] or [Shift+Ctrl+B]
26
Running Programs
 The process of running application includes:
 Compiling (if project not compiled)
 Starting the application
 You can run application by:
 Using Debug->Start menu
 By pressing [F5] or [Ctrl+F5]
* NOTE: Not all types of projects are able to be
started!
27
DebuggingThe Code
 The process of debugging
application includes:
 Spotting an error
 Finding the lines of code that
cause the error
 Fixing the code
 Testing to check if the error is
gone and no errors are introduced
 Iterative and continuous process
28
Debugging inVisual Studio
 Visual Studio has built-in debugger
 It provides:
 Breakpoints
 Ability to trace the code execution
 Ability to inspect variables at runtime
29
Visual Studio
Compiling, Running and Debugging C# Programs
Live Demo
Visual Studio
Blank Solution
Creating a Solution
Without Projects
What Is a Blank Solution?
 AVisual Studio blank solution
 Solution with no projects in it
 Projects to be added later
 What is the point?
 Not making a project just to give proper name
 And not working in this project
VS Blank Solution
33
Visual Studio
Blank Solution
Live Demo
What is MSDN
Library?
What is MSDN Library?
 Complete documentation of all classes and
their functionality
 With descriptions of all methods, properties,
events, etc.
 With code examples
 Related articles
 Library of samples
 Use local copy or theWeb version at
http://msdn.microsoft.com/
36
MSDN Library
37
How to Use MSDN Library?
 Offline version
 Use the table of contents
 Use the alphabetical index
 Search for phrase or keyword
 Filter by technology
 Browse your favorite articles
 Online version
 Use the built-in search
38
MSDN Library
Browsing and Searching Documentation
Live Demo
Introduction to Programming
Questions?
http://academy.telerik.com
Exercises
1. Familiarize yourself with:
 MicrosoftVisual Studio
 Microsoft Developer Network (MSDN) Library
Documentation
 Find information about Console.WriteLine() method.
2. Create, compile and run a “Hello C#” console
application.
3. Modify the application to print your name.
4. Write a program to print the numbers 1, 101 and
1001.
41
Exercises (2)
5. Install at home:
1. Microsoft .NET Framework
2. MicrosoftVisual Studio (orVisual C# Express)
3. Microsoft Developer Network (MSDN)
6. Create console application that prints your first and
last name.
7. Create a console application that prints the current
date and time.
8. Create a console application that calculates and
prints the square of the number 12345.
42
Exercises (3)
9. Write a program that prints the first 10 members of
the sequence: 2, -3, 4, -5, 6, -7, ...
10. Provide a short list with information about the most
popular programming languages. How do they differ
from C#?
11. Describe the difference between C# and .NET
Framework.
12. *Write a program to read your age from the console
and print how old you will be after 10 years.
*NOTE: If you have any difficulties, search in Google.
43

Más contenido relacionado

La actualidad más candente

Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programmingNeeru Mittal
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programmingmshellman
 
Presentation on generation of languages
Presentation on generation of languagesPresentation on generation of languages
Presentation on generation of languagesRicha Pant
 
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Professor Lili Saghafi
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer ProgrammingAllen de Castro
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming conceptssalmankhan570
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming ConceptsJussi Pohjolainen
 
Programming languages
Programming languagesProgramming languages
Programming languagesAkash Varaiya
 
History of Programming Language
History of Programming LanguageHistory of Programming Language
History of Programming Languagetahria123
 
Generation of computer languages
Generation of computer languagesGeneration of computer languages
Generation of computer languageskitturashmikittu
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPTShivam Gupta
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
Comparative Study of programming Languages
Comparative Study of programming LanguagesComparative Study of programming Languages
Comparative Study of programming LanguagesIshan Monga
 
What is programming what are its benefits
What is programming  what are its benefits What is programming  what are its benefits
What is programming what are its benefits Vijay Singh Khatri
 
C# programming language
C# programming languageC# programming language
C# programming languageswarnapatil
 

La actualidad más candente (20)

Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Presentation on generation of languages
Presentation on generation of languagesPresentation on generation of languages
Presentation on generation of languages
 
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
 
Basic Computer Programming
Basic Computer ProgrammingBasic Computer Programming
Basic Computer Programming
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming concepts
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming Concepts
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
History of Programming Language
History of Programming LanguageHistory of Programming Language
History of Programming Language
 
Generation of computer languages
Generation of computer languagesGeneration of computer languages
Generation of computer languages
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 
Computer programming concepts
Computer programming conceptsComputer programming concepts
Computer programming concepts
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
Computer Language
Computer LanguageComputer Language
Computer Language
 
Comparative Study of programming Languages
Comparative Study of programming LanguagesComparative Study of programming Languages
Comparative Study of programming Languages
 
Introduction to programming languages
Introduction to programming languagesIntroduction to programming languages
Introduction to programming languages
 
What is programming what are its benefits
What is programming  what are its benefits What is programming  what are its benefits
What is programming what are its benefits
 
C# programming language
C# programming languageC# programming language
C# programming language
 

Destacado

Destacado (6)

Console applications IN C#
Console applications IN C#Console applications IN C#
Console applications IN C#
 
Presentation1
Presentation1Presentation1
Presentation1
 
C# basics
 C# basics C# basics
C# basics
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework Overview
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 

Similar a 01. introduction to-programming

LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxAOmaAli
 
01. Introduction to Programming
01. Introduction to Programming01. Introduction to Programming
01. Introduction to ProgrammingIntro C# Book
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programmingmaznabili
 
Lecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net frameworkLecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net frameworkAbdullahNadeem78
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notesWE-IT TUTORIALS
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoMamgmo Magnda
 
Unit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUnit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUjwala Junghare
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop AppFajar Baskoro
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfAnassElHousni
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnetNethaji Naidu
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroMohammad Shaker
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0Antonio Chagoury
 
.Net framework
.Net framework.Net framework
.Net frameworkRaghu nath
 
1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)Shoaib Ghachi
 

Similar a 01. introduction to-programming (20)

LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptx
 
01. Introduction to Programming
01. Introduction to Programming01. Introduction to Programming
01. Introduction to Programming
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programming
 
Introduction to Programming Lesson 01
Introduction to Programming Lesson 01Introduction to Programming Lesson 01
Introduction to Programming Lesson 01
 
Srgoc dotnet_new
Srgoc dotnet_newSrgoc dotnet_new
Srgoc dotnet_new
 
Lecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net frameworkLecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net framework
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul Yao
 
C# tutorial
C# tutorialC# tutorial
C# tutorial
 
Unit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUnit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdf
 
Membangun Desktop App
Membangun Desktop AppMembangun Desktop App
Membangun Desktop App
 
2310 b 03
2310 b 032310 b 03
2310 b 03
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnet
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#
 
.Net framework
.Net framework.Net framework
.Net framework
 
1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Último (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

01. introduction to-programming

  • 1. Introduction to Programming Creating and RunningYour First C# Program Svetlin Nakov Telerik Corporation www.telerik.com
  • 2. Table of Contents 1. What is Computer Programming? 2. Your First C# Program 3. What is .NET Framework? 4. What isVisual Studio? 5. What is MSDN Library? 2
  • 4. Define: Computer Programming Computer programming: creating a sequence of instructions to enable the computer to do something Definition by Google 4
  • 5. Programming Phases  Define a task/problem  Plan your solution  Find suitable algorithm to solve it  Find suitable data structures to use  Write code  Fix program error (bugs)  Make your customer happy = Specification = Design = Implementation =Testing & Debugging = Deployment 5
  • 6. Your First C# Program
  • 7. First Look at C# Sample C# program: using System; class HelloCSharp { static void Main() { Console.WriteLine("Hello, C#"); } } 7
  • 8. C# Code – How It Works? using System; class HelloCSharp { static void Main() { Console.WriteLine("Hello, C#"); } } Include the standard namespace "System" Define a class called "HelloCSharp" Define the Main() method – the program entry point Print a text on the console by calling the method "WriteLine" of the class "Console" 8
  • 9. C# Code Should BeWell Formatted using System; class HelloCSharp { static void Main() { Console.WriteLine("Hello, C#"); } } The { symbol should be alone on a new line. The block after the { symbol should be indented by a TAB. The } symbol should be under the corresponding {. Class names should use PascalCase and start with a CAPITAL letter. 9
  • 10. Example of Bad Formatting using System ; class HelloCSharp { static void Main( ) { Console . WriteLine ("Hello, C#" ) ;Console. WriteLine ( "Hello again" ) ;}} Such formatting makes the source code unreadable. 10
  • 11. 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
  • 12. WhatYou Need to Program?  Knowledge of a programming language  C#  Task to solve  Development environment, compilers, SDK  Visual Studio, .NET Framework SDK  Set of useful standard classes  Microsoft .NET Framework FCL  Help documentation  MSDN Library 12
  • 13. Your First C# Program Live Demo
  • 15. What is .NET Framework?  Environment for execution of .NET programs  Powerful library of classes  Programming model  Common execution engine for many programming languages  C#  Visual Basic .NET  Managed C++  ... and many others 15
  • 16. Operating System (OS) Common Language Runtime (CLR) Base Class Library (BCL) ADO.NET, LINQ and XML (DataTier) WCF and WWF (Communication and WorkflowTier) ASP.NET Web Forms, MVC, AJAX Mobile InternetToolkit Windows Forms WPF Silverlight C# C++ VB.NET J# F# JScript Perl Delphi … Inside .NET Framework  Building blocks of .NET Framework FCL CLR 16
  • 17. CLR –The Heart of .NET Framework  Common Language Runtime (CLR)  Managed execution environment  Executes .NET applications  Controls the execution process  Automatic memory management (garbage collection)  Programming languages integration  Multiple versions support for assemblies  Integrated type safety and security CLR 17
  • 18. Framework Class Library  Framework Class Library (FCL)  Provides basic functionality to developers:  Console applications  WPF and Silverlight rich-media applications  Windows Forms GUI applications  Web applications (dynamic Web sites)  Web services, communication and workflow  Server & desktop applications  Applications for mobile devices 18
  • 20. 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
  • 21. Benefits ofVisual Studio  Single tool for:  Writing code in many languages (C#,VB, …)  Using different technologies (Web,WPF, …)  For different platforms (.NET CF, Silverlight, …)  Full integration of most development activities (coding, compiling, testing, debugging, deployment, version control, ...)  Very easy to use! 21
  • 22. Visual Studio – Example 22
  • 23. Visual Studio Compiling, Running and Debugging C# Programs
  • 24. Creating New Console Application 1. File  New  Project ... 2. Choose C# console application 3. Choose project directory and name 24
  • 25. Creating New Console Application (2) 4. Visual Studio creates some source code for you Namespace not required Class name should be changed Some imports are not required 25
  • 26. Compiling Source Code  The process of compiling includes:  Syntactic checks  Type safety checks  Translation of the source code to lower level language (MSIL)  Creating of executable files (assemblies)  You can start compilation by  Using Build->Build Solution/Project  Pressing [F6] or [Shift+Ctrl+B] 26
  • 27. Running Programs  The process of running application includes:  Compiling (if project not compiled)  Starting the application  You can run application by:  Using Debug->Start menu  By pressing [F5] or [Ctrl+F5] * NOTE: Not all types of projects are able to be started! 27
  • 28. DebuggingThe Code  The process of debugging application includes:  Spotting an error  Finding the lines of code that cause the error  Fixing the code  Testing to check if the error is gone and no errors are introduced  Iterative and continuous process 28
  • 29. Debugging inVisual Studio  Visual Studio has built-in debugger  It provides:  Breakpoints  Ability to trace the code execution  Ability to inspect variables at runtime 29
  • 30. Visual Studio Compiling, Running and Debugging C# Programs Live Demo
  • 31. Visual Studio Blank Solution Creating a Solution Without Projects
  • 32. What Is a Blank Solution?  AVisual Studio blank solution  Solution with no projects in it  Projects to be added later  What is the point?  Not making a project just to give proper name  And not working in this project
  • 36. What is MSDN Library?  Complete documentation of all classes and their functionality  With descriptions of all methods, properties, events, etc.  With code examples  Related articles  Library of samples  Use local copy or theWeb version at http://msdn.microsoft.com/ 36
  • 38. How to Use MSDN Library?  Offline version  Use the table of contents  Use the alphabetical index  Search for phrase or keyword  Filter by technology  Browse your favorite articles  Online version  Use the built-in search 38
  • 39. MSDN Library Browsing and Searching Documentation Live Demo
  • 41. Exercises 1. Familiarize yourself with:  MicrosoftVisual Studio  Microsoft Developer Network (MSDN) Library Documentation  Find information about Console.WriteLine() method. 2. Create, compile and run a “Hello C#” console application. 3. Modify the application to print your name. 4. Write a program to print the numbers 1, 101 and 1001. 41
  • 42. Exercises (2) 5. Install at home: 1. Microsoft .NET Framework 2. MicrosoftVisual Studio (orVisual C# Express) 3. Microsoft Developer Network (MSDN) 6. Create console application that prints your first and last name. 7. Create a console application that prints the current date and time. 8. Create a console application that calculates and prints the square of the number 12345. 42
  • 43. Exercises (3) 9. Write a program that prints the first 10 members of the sequence: 2, -3, 4, -5, 6, -7, ... 10. Provide a short list with information about the most popular programming languages. How do they differ from C#? 11. Describe the difference between C# and .NET Framework. 12. *Write a program to read your age from the console and print how old you will be after 10 years. *NOTE: If you have any difficulties, search in Google. 43