SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
Programming
Fundamentals I
Course Code 109


Sri Lanka Institute of Information Technology

                         Jagath Wickramarathne
                               Jagath.w@sliit.lk
Lecture 2 - Learning C# Basics
• Introducing the .NET Platform.
• Steps involved in C# program development.
• Computer Programming Languages.
• What Is .NET?
• Writing a Simple C# Program.
• Commenting Code.
• Identifiers and Keywords.
• Convention and Style.
• Getting Started with C# and Visual Studio 2008.
How user interacts with Computer
                                               • Click to edit Master text styles
                                                                                  App
                                                                                      lica
                                                           – Second level         Soft tion
                                                                                      ware
                                                           – Third level
                                                              • Fourth level
                                                                  – Fifth level




http://www.nickhalstead.com/wp-content/computer-user.jpg
Software . . .?




             http://patentu.blogspot.com/2007/03/what-is-software.html
Why Computer Programs?
A computer program is a sequence of instructions that enable a computer to accomplish a particular task.
Computer Programming Languages
A programming language is a machine-readable artificial language
designed to express computations that can be performed by a
machine, particularly a computer.


Programming languages can be used to create
programs that specify the behavior of a machine,
to express algorithms precisely, or as a mode of human communication.
                                                                   http://en.wikipedia.org/wiki/Programming_language




•   http://www.levenez.com/lang/


•   http://www.engin.umd.umich.edu/CIS/course.des/cis400/
How you can select a Computer
Programming Language
   How you can select a Computer Programming Language
What Is .NET?
• Microsoft .NET, is a platform for developing
  software.

• You are building applications on: Microsoft .NET
  (pronounced “Dot Net”).

• You learn about the parts of .NET,
   – including the Common Language Runtime (CLR),
   – the .NET Framework Class Library, and how .NET supports
     multiple languages.
NET supports multiple programming
                    languages.

•   Literally dozens of languages target the .NET CLR as a platform.
PF I
PF II                 ITA
What Can a C# Program Do?
• Typical programming tasks includes putting data
  into a database or pulling it out, displaying high
  speed graphics in a game or video, controlling
  electronic devices attached to the PC or even
  playing music and/or sound effects.

• You can even write software to generate music
  or help you compose.
                              http://cplus.about.com/od/introductiontoprogramming/a/cshbeginners.htm
Is C# The Best Programming
                      Language?
• Some computer languages were written for a specific
  purpose.
  – Java was originally devised to control toasters.
  – C for Operating Systems Programming.
  – Pascal to teach good programming techniques.



• But C# is a general purpose language with features to make
  programs more robust.
  – Fully OOP
  – Automatic garbage collection (don’t have to delete objects)
  – No pointers
  – Only booleans allowed in if statements
  – Everything inherits from System.Object
  – Array bounds checking at runtime
Which Computers Can Run C#?

Any that can run the

   • .NET framework.

   • On Linux under MonoProject & IDE.
How Do I Get Started With C#?
• .NET framework.


• First you need a Editor.


• Then a C# compiler.
    – There are a number of commercial and free ones available.


    – The list below has instructions for downloading and installing two free compilers.


    – Both are completely free and include an IDE to make life easier for you to edit, compile and debug your
      applications.


    – Download and Install Borland's Turbo C# Explorer.



    – Download and Install Microsoft's Visual C# 2005 Express Edition.
Could I Get A Programming Job?
• There are an increasing number of C# jobs out there and
  it has the backing of Microsoft so is likely to be around
  for a considerable length of time.

• The top three most popular programming languages
  according to the quarterly Tiobe.com survey, are Java, C
  and C#.

• Eg. Search Google
   –   “most popular programming languages”
   –   “C# + Salary”
How to write Computer Programs
• There are four general phases


   – Specify the problem,


   – Analyze and break down into a series of steps towards
     solution, (i.e., design an algorithm),


   – Write the code,


   – Compile and run (i.e., test the program)
Steps involved in C# program development
C# Compilation Process




              http://www.mastercsharp.com/article.aspx?ArticleID=90&&TopicID=4
Where Do I Go Now?
• First you have to learn to program in C#.
  – Text Book
  – MSDN
  – Internet
  – E-books
  – Join The Forums
  – http://dotnetforum.lk/
  – Etc.
Writing a Simple C# Program
Editor / IDE         Project Type

Notepad              Console Application



Visual Studio 2008   Windows Forms
                     Application
C# - Console Applications
        using Visual Studio 2008 Command Prompt
• Step I
   – Open a notepad.
• Step II
   – Write the following code and save as “FirstProgram.cs”.
• Step III
   – Open Visual Studio 2008 Command Prompt.
   – Change the current directory to the place where you save “FirstProgram.cs”.
• Step IV
   – Type “csc FirstProgram1.cs” compile command.
• Step IV
   – Run FirstProgram1.exe
C# Fundamental
Demo One
• How to create a C# console application using
  Visual Studio 2008 Command Prompt.
C# - Windows Applications
         using Visual Studio 2008
• Step I
     • Run Microsoft Visual studio 2008.
• Step II
     • Create new project “Windows Forms Application”
• Step III
     • Design Interface / Form
• Step IV
     • Compile
• Step V
     • Run
Demo Two

• How to create a C# Windows Forms
  application using Visual Studio 2008.
  – Solution
  – Project
     • .EXE
Demo Three

   Navigating through Design and Code modes.

   Different windows / Features in VS2008 IDE.
C# - Convention and Style
•   It is common practice in C# to use whitespace and indentation to facilitate easier reading of code.


•   The names should describe what the program does.


•   A program may have any amount of white-space between language elements.


•   Identifiers are structured, using either Pascal casing or camel casing.


•   In Pascal casing the first letter of each word in a name is capitalized
     – HelloWorld, DotProduct, and AmortizationSchedule.
     – This is normally used in all instances except for parameters (passed to methods), private fields (class member
       variables), and local variables (method variables).


•   With camel casing, the first letter of the first word is lowercase, and subsequent words are capitalized.
     – bookTitle, employeeName, and totalCompensation.
     – Parameters, private fields, and local variables use camel casing.
Commenting Code
•   Part of writing good code is ensuring it is properly documented.


•   These commenting techniques prove useful any time you want to comment out a block of incomplete code to get a good compile or
    any other time you want to leave a block of code in place temporarily.


•   The compiler ignores comments when reading the source code.


•   There are three types of commenting syntax in C#:


     – single line


     – multiline


     – XML


•   The multiline and single-line comments are great for helping yourself or other programmers understand your code.


•   XML documentation commenting feature that is good for both reading code and providing external documentation .
•    Single-Line Comments



      –   They begin with the double forward slash marker,




//The single-line comment



•    Multiline Comments



      –   Multiline comment delimiters are the begin comment /* and end comment */ markers.

      –   Anything between these two markers is considered a comment.



/*

* File Name: Program.cs

* Author: Nishani Ranpatabendi

*/



•    XML Documentation Comments



      –   XML documentation comment supports tools that extract comments into an external XML document.

      –   This XML can be consumed by tools or run through XSLT style sheets to produce readable documentation.

      –   XML documentation comments start with a triple slash, ///, on each line.




      –   /// <summary>

      –   /// first method executed in application

      –   /// </summary>

      –   /// <param name=”args”>command-line options</param>



      –   static void Main(string[] args)

      –   {

      –           // other code

      –   }
Identifiers and Keywords
• Identifiers and keywords are important because you need to know
  how to name your variables, custom types, methods, and so on.


• Identifiers are names of the types and variables in your program.


• Keywords are reserved words in the C# language.


• The difference between identifiers and keywords is that keywords
  are reserved for C# language syntax and can’t be used for naming
  your variables, types, and so on.
Reserved words in the C# language




 You can prefix keywords with the @ character and use it as an identifier.
Case Sensitive Languages
• C# programming language is case sensitive.
   – If the language considers two identifiers to be different if
     they consist of the same characters in the same order except
     for variations in upper and lower case.


• Name name NAME would be three different
  identifiers in a language which is case sensitive.


• C# is case sensitive.
Summery
• Introducing the .NET Platform.
• Steps involved in C# program development.
• Computer Programming Languages.
• What Is .NET?
• Writing a Simple C# Program.
• Commenting Code.
• Identifiers and Keywords.
• Convention and Style.
• Getting Started with C# and Visual Studio 2008.
Reference
            http://msdn.microsoft.com/en-us/vcsharp/bb798022.aspx




o edit Master subtitle style

Contenu connexe

Tendances

Programing language
Programing languagePrograming language
Programing languageJames Taylor
 
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
 
4 evolution-of-programming-languages
4 evolution-of-programming-languages4 evolution-of-programming-languages
4 evolution-of-programming-languagesRohit Shrivastava
 
Programming languages
Programming languagesProgramming languages
Programming languagesMuntasirMuhit
 
Basic Programming Concept
Basic Programming ConceptBasic Programming Concept
Basic Programming ConceptCma Mohd
 
An overview of computers and programming languages
An overview of computers and programming languages An overview of computers and programming languages
An overview of computers and programming languages Ahmad Idrees
 
Ch1 language design issue
Ch1 language design issueCh1 language design issue
Ch1 language design issueJigisha Pandya
 
Machine language
Machine languageMachine language
Machine languageRipal Dhruv
 
Programming languages and concepts by vivek parihar
Programming languages and concepts by vivek pariharProgramming languages and concepts by vivek parihar
Programming languages and concepts by vivek pariharVivek Parihar
 
BASIC Programming Language
BASIC Programming LanguageBASIC Programming Language
BASIC Programming LanguageJeff Valerio
 
Logical programming languages and functional programming languages
Logical programming languages and functional programming languagesLogical programming languages and functional programming languages
Logical programming languages and functional programming languagesnahianzarif
 
software development and programming languages
software development and programming languages software development and programming languages
software development and programming languages PraShant Kumar
 
Programming languages
Programming languagesProgramming languages
Programming languagesAsmasum
 
Programming languages
Programming languagesProgramming languages
Programming languagesSimon Mui
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and developmentAli Raza
 

Tendances (20)

Programing language
Programing languagePrograming language
Programing language
 
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
 
4 evolution-of-programming-languages
4 evolution-of-programming-languages4 evolution-of-programming-languages
4 evolution-of-programming-languages
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Basic Programming Concept
Basic Programming ConceptBasic Programming Concept
Basic Programming Concept
 
An overview of computers and programming languages
An overview of computers and programming languages An overview of computers and programming languages
An overview of computers and programming languages
 
Ch1 language design issue
Ch1 language design issueCh1 language design issue
Ch1 language design issue
 
Machine language
Machine languageMachine language
Machine language
 
Programming languages and concepts by vivek parihar
Programming languages and concepts by vivek pariharProgramming languages and concepts by vivek parihar
Programming languages and concepts by vivek parihar
 
Programming language
Programming languageProgramming language
Programming language
 
BASIC Programming Language
BASIC Programming LanguageBASIC Programming Language
BASIC Programming Language
 
Logical programming languages and functional programming languages
Logical programming languages and functional programming languagesLogical programming languages and functional programming languages
Logical programming languages and functional programming languages
 
Computer Programming - Lecture 1
Computer Programming - Lecture 1Computer Programming - Lecture 1
Computer Programming - Lecture 1
 
Computer programming concepts
Computer programming conceptsComputer programming concepts
Computer programming concepts
 
software development and programming languages
software development and programming languages software development and programming languages
software development and programming languages
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 

Similaire à C# Fundamental

Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Dastan Kamaran
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Dastan Kamaran
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterHossam Hassan
 
Chapter-introduction about java programming
Chapter-introduction about java programmingChapter-introduction about java programming
Chapter-introduction about java programmingDrRajeshkumarPPatel
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingMalikaJoya
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptxPmarkNorcio
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introductionmengistu23
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxZiyadMohammed17
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptxAshenafiGirma5
 
Programming using C++ - slides.pptx
Programming using C++ - slides.pptxProgramming using C++ - slides.pptx
Programming using C++ - slides.pptxHeadoftheDepartment
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxpercivalfernandez3
 
Advance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfAdvance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfpercivalfernandez2
 
Introduct To C Language Programming
Introduct To C Language ProgrammingIntroduct To C Language Programming
Introduct To C Language Programmingyarkhosh
 
Understanding C and its Applications.pdf
Understanding C and its Applications.pdfUnderstanding C and its Applications.pdf
Understanding C and its Applications.pdfAdeleHansley
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkDr.Neeraj Kumar Pandey
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingManoj Tyagi
 

Similaire à C# Fundamental (20)

C programming
C programmingC programming
C programming
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Chapter-introduction about java programming
Chapter-introduction about java programmingChapter-introduction about java programming
Chapter-introduction about java programming
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Introduction_to_Programming.pptx
Introduction_to_Programming.pptxIntroduction_to_Programming.pptx
Introduction_to_Programming.pptx
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptx
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptx
 
Programming using C++ - slides.pptx
Programming using C++ - slides.pptxProgramming using C++ - slides.pptx
Programming using C++ - slides.pptx
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptx
 
Advance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfAdvance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdf
 
Introduct To C Language Programming
Introduct To C Language ProgrammingIntroduct To C Language Programming
Introduct To C Language Programming
 
Understanding C and its Applications.pdf
Understanding C and its Applications.pdfUnderstanding C and its Applications.pdf
Understanding C and its Applications.pdf
 
C# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net FrameworkC# lecture 1: Introduction to Dot Net Framework
C# lecture 1: Introduction to Dot Net Framework
 
Intro1
Intro1Intro1
Intro1
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 

Plus de Thilini munasinghe

Plus de Thilini munasinghe (6)

RDBMS_IT_Lecture_View_Via_SQL
RDBMS_IT_Lecture_View_Via_SQLRDBMS_IT_Lecture_View_Via_SQL
RDBMS_IT_Lecture_View_Via_SQL
 
HNDIT_SRI_LANKA
HNDIT_SRI_LANKAHNDIT_SRI_LANKA
HNDIT_SRI_LANKA
 
Ict act in sri lanka
Ict act in sri lankaIct act in sri lanka
Ict act in sri lanka
 
Software configuration management
Software configuration managementSoftware configuration management
Software configuration management
 
Foss introduction and history
Foss introduction and historyFoss introduction and history
Foss introduction and history
 
Foss business model
Foss business modelFoss business model
Foss business model
 

C# Fundamental

  • 1. Programming Fundamentals I Course Code 109 Sri Lanka Institute of Information Technology Jagath Wickramarathne Jagath.w@sliit.lk
  • 2. Lecture 2 - Learning C# Basics • Introducing the .NET Platform. • Steps involved in C# program development. • Computer Programming Languages. • What Is .NET? • Writing a Simple C# Program. • Commenting Code. • Identifiers and Keywords. • Convention and Style. • Getting Started with C# and Visual Studio 2008.
  • 3. How user interacts with Computer • Click to edit Master text styles App lica – Second level Soft tion ware – Third level • Fourth level – Fifth level http://www.nickhalstead.com/wp-content/computer-user.jpg
  • 4. Software . . .? http://patentu.blogspot.com/2007/03/what-is-software.html
  • 5. Why Computer Programs? A computer program is a sequence of instructions that enable a computer to accomplish a particular task.
  • 6. Computer Programming Languages A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that specify the behavior of a machine, to express algorithms precisely, or as a mode of human communication. http://en.wikipedia.org/wiki/Programming_language • http://www.levenez.com/lang/ • http://www.engin.umd.umich.edu/CIS/course.des/cis400/
  • 7. How you can select a Computer Programming Language  How you can select a Computer Programming Language
  • 8. What Is .NET? • Microsoft .NET, is a platform for developing software. • You are building applications on: Microsoft .NET (pronounced “Dot Net”). • You learn about the parts of .NET, – including the Common Language Runtime (CLR), – the .NET Framework Class Library, and how .NET supports multiple languages.
  • 9. NET supports multiple programming languages. • Literally dozens of languages target the .NET CLR as a platform. PF I PF II ITA
  • 10. What Can a C# Program Do? • Typical programming tasks includes putting data into a database or pulling it out, displaying high speed graphics in a game or video, controlling electronic devices attached to the PC or even playing music and/or sound effects. • You can even write software to generate music or help you compose. http://cplus.about.com/od/introductiontoprogramming/a/cshbeginners.htm
  • 11. Is C# The Best Programming Language? • Some computer languages were written for a specific purpose. – Java was originally devised to control toasters. – C for Operating Systems Programming. – Pascal to teach good programming techniques. • But C# is a general purpose language with features to make programs more robust. – Fully OOP – Automatic garbage collection (don’t have to delete objects) – No pointers – Only booleans allowed in if statements – Everything inherits from System.Object – Array bounds checking at runtime
  • 12. Which Computers Can Run C#? Any that can run the • .NET framework. • On Linux under MonoProject & IDE.
  • 13. How Do I Get Started With C#? • .NET framework. • First you need a Editor. • Then a C# compiler. – There are a number of commercial and free ones available. – The list below has instructions for downloading and installing two free compilers. – Both are completely free and include an IDE to make life easier for you to edit, compile and debug your applications. – Download and Install Borland's Turbo C# Explorer. – Download and Install Microsoft's Visual C# 2005 Express Edition.
  • 14. Could I Get A Programming Job? • There are an increasing number of C# jobs out there and it has the backing of Microsoft so is likely to be around for a considerable length of time. • The top three most popular programming languages according to the quarterly Tiobe.com survey, are Java, C and C#. • Eg. Search Google – “most popular programming languages” – “C# + Salary”
  • 15. How to write Computer Programs • There are four general phases – Specify the problem, – Analyze and break down into a series of steps towards solution, (i.e., design an algorithm), – Write the code, – Compile and run (i.e., test the program)
  • 16. Steps involved in C# program development
  • 17. C# Compilation Process http://www.mastercsharp.com/article.aspx?ArticleID=90&&TopicID=4
  • 18. Where Do I Go Now? • First you have to learn to program in C#. – Text Book – MSDN – Internet – E-books – Join The Forums – http://dotnetforum.lk/ – Etc.
  • 19. Writing a Simple C# Program Editor / IDE Project Type Notepad Console Application Visual Studio 2008 Windows Forms Application
  • 20. C# - Console Applications using Visual Studio 2008 Command Prompt • Step I – Open a notepad. • Step II – Write the following code and save as “FirstProgram.cs”. • Step III – Open Visual Studio 2008 Command Prompt. – Change the current directory to the place where you save “FirstProgram.cs”. • Step IV – Type “csc FirstProgram1.cs” compile command. • Step IV – Run FirstProgram1.exe
  • 22. Demo One • How to create a C# console application using Visual Studio 2008 Command Prompt.
  • 23. C# - Windows Applications using Visual Studio 2008 • Step I • Run Microsoft Visual studio 2008. • Step II • Create new project “Windows Forms Application” • Step III • Design Interface / Form • Step IV • Compile • Step V • Run
  • 24. Demo Two • How to create a C# Windows Forms application using Visual Studio 2008. – Solution – Project • .EXE
  • 25. Demo Three  Navigating through Design and Code modes.  Different windows / Features in VS2008 IDE.
  • 26. C# - Convention and Style • It is common practice in C# to use whitespace and indentation to facilitate easier reading of code. • The names should describe what the program does. • A program may have any amount of white-space between language elements. • Identifiers are structured, using either Pascal casing or camel casing. • In Pascal casing the first letter of each word in a name is capitalized – HelloWorld, DotProduct, and AmortizationSchedule. – This is normally used in all instances except for parameters (passed to methods), private fields (class member variables), and local variables (method variables). • With camel casing, the first letter of the first word is lowercase, and subsequent words are capitalized. – bookTitle, employeeName, and totalCompensation. – Parameters, private fields, and local variables use camel casing.
  • 27. Commenting Code • Part of writing good code is ensuring it is properly documented. • These commenting techniques prove useful any time you want to comment out a block of incomplete code to get a good compile or any other time you want to leave a block of code in place temporarily. • The compiler ignores comments when reading the source code. • There are three types of commenting syntax in C#: – single line – multiline – XML • The multiline and single-line comments are great for helping yourself or other programmers understand your code. • XML documentation commenting feature that is good for both reading code and providing external documentation .
  • 28. Single-Line Comments – They begin with the double forward slash marker, //The single-line comment • Multiline Comments – Multiline comment delimiters are the begin comment /* and end comment */ markers. – Anything between these two markers is considered a comment. /* * File Name: Program.cs * Author: Nishani Ranpatabendi */ • XML Documentation Comments – XML documentation comment supports tools that extract comments into an external XML document. – This XML can be consumed by tools or run through XSLT style sheets to produce readable documentation. – XML documentation comments start with a triple slash, ///, on each line. – /// <summary> – /// first method executed in application – /// </summary> – /// <param name=”args”>command-line options</param> – static void Main(string[] args) – { – // other code – }
  • 29. Identifiers and Keywords • Identifiers and keywords are important because you need to know how to name your variables, custom types, methods, and so on. • Identifiers are names of the types and variables in your program. • Keywords are reserved words in the C# language. • The difference between identifiers and keywords is that keywords are reserved for C# language syntax and can’t be used for naming your variables, types, and so on.
  • 30. Reserved words in the C# language You can prefix keywords with the @ character and use it as an identifier.
  • 31. Case Sensitive Languages • C# programming language is case sensitive. – If the language considers two identifiers to be different if they consist of the same characters in the same order except for variations in upper and lower case. • Name name NAME would be three different identifiers in a language which is case sensitive. • C# is case sensitive.
  • 32. Summery • Introducing the .NET Platform. • Steps involved in C# program development. • Computer Programming Languages. • What Is .NET? • Writing a Simple C# Program. • Commenting Code. • Identifiers and Keywords. • Convention and Style. • Getting Started with C# and Visual Studio 2008.
  • 33. Reference http://msdn.microsoft.com/en-us/vcsharp/bb798022.aspx o edit Master subtitle style

Notes de l'éditeur

  1. Parts of an elephant Touching an elephant one blind might be wondering that elephant is a wall …as he has touched the body part of the the elephant One might has touched the tail… N he might br wondering that elephant is a rope…. N another might has touched the legs N he might be wondering that elephant is what you call tree…. N one who touched the ears he might think elephant is a fan like thing 
  2. Software/ computer programs for different purposes We have Microsoft office package