SlideShare a Scribd company logo
C# and F# Programming Language
C SHARP It was developed by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270).  C# is one of the programming languages designed for the Common Language Infrastructure. "C sharp" was inspired by musical notation where a sharp indicates that the written note should be made a semitone higher in pitch. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg, who was previously involved with the design of Turbo Pascal, Embarcadero Delphi.
Design Goals of C# C# language is intended to be a simple, modern, general-purpose, object-oriented programming language. The language, and implementations thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, detection of attempts to use uninitialized variables, and automatic garbage collection. The language is intended for use in developing software components suitable for deployment in distributed environments. Source code portability is very important, as is programmer portability, especially for those programmers already familiar with C and C++.
Design Goals of C# Support for internationalization is very important. C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions. Although C# applications are intended to be economical with regard to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language.
Versions of C#
Distinguishing Features of C# It has no global variables or functions. All methods and members must be declared within classes. Static members of public classes can substitute for global variables and functions. Local variables cannot shadow variables of the enclosing block, unlike C and C++. Variable shadowing is often considered confusing by C++ texts. C# supports a strict Boolean data type. In C#, memory address pointers can only be used within blocks specifically marked as unsafe, and programs with unsafe code need appropriate permissions to run.  Managed memory cannot be explicitly freed.
Distinguishing Features of C# Multiple inheritance is not supported, although a class can implement any number of interfaces. C# is more type safe than C++.  C# currently (as of version 4.0) has 77 reserved words.
Categories of data types Value types ,[object Object]
Examples of value types are all primitive types, such as int (a signed 32-bit integer), float (a 32-bit IEEE floating-point number), char (a 16-bit Unicode code unit), and System.DateTime (identifies a specific point in time with nanosecond precision).,[object Object]
Examples of reference types are object (the ultimate base class for all other C# classes), System.String (a string of Unicode characters), and System.Array (a base class for all C# arrays).,[object Object]
Preprocessor C# features "preprocessor directives" (though it does not have an actual preprocessor) based on the C preprocessor that allow programmers to define symbols but not macros. Conditionals such as #if, #endif, and #else are also provided. Directives such as #region give hints to editors for code folding. public class Foo { #region Procedures     public void IntBar(intfirstParam) {}     public void StrBar(string firstParam) {}     public void BoolBar(bool firstParam) {}     #endregion     #region Constructors     public Foo() {}     public Foo(intfirstParam) {}     #endregion }
"Hello world" example using System; class Program {     static void Main()     { Console.WriteLine("Hello world!");     } }
using System; ,[object Object],class Program ,[object Object],static void Main() ,[object Object],Console.WriteLine("Hello world!"); ,[object Object],[object Object]
Simple/primitive types
Advanced numeric types
Lifted (nullable) types
Special feature keywords
Special feature keywords
C Sharp Identifier An identifier can: ,[object Object]
contain both upper case and lower case Unicode letters. Case is significant.An identifier cannot: ,[object Object]
start with a symbol, unless it is a keyword (check Keywords).
have more than 511 chars.,[object Object]
C Sharp Literals
C Sharp Literals
 Variables Variables are identifiers associated with values. They are declared by writing the variable's type and name, and are optionally initialized in the same statement by assigning a value. Declare intMyInt;         // Declaring an uninitialized variable called 'MyInt', of type 'int' Initialize intMyInt;        // Declaring an uninitialized variable MyInt = 35;       // Initializing the variable Declare & initialize intMyInt = 35;   // Declaring and initializing the variable at the same time
 Operators
Conditional structures if statement ,[object Object],Simple one-line statement: if (i == 3) ... ; Multi-line with else-block (without any braces): if (i == 2)     ... else     ...
Conditional structures switch statement ,[object Object],switch (ch) { case 'A':         ...         break;     case 'B':     case 'C':          ...          break;     default:         ...         break; }
Jump statements The goto statement can be used in switch statements to jump from one case to another or to fall through from one case to the next. switch(n) {     case 1: Console.WriteLine("Case 1");         break;     case 2: Console.WriteLine("Case 2"); goto case 1;     case 3: Console.WriteLine("Case 3");     case 4: // Compilation will fail here as cases cannot fall through in C#. Console.WriteLine("Case 4"); goto default; // This is the correct way to fall through to the next case.     default: Console.WriteLine("Default"); }
Iteration structures while loop while (i == true) {     ... } do ... while loop do {     ... } while (i == true); for loop ,[object Object],for (int i = 0; i < 10; i++) {     ... }
break statement The break statement breaks out of the closest loop or switch statement. Execution continues in the statement after the terminated statement, if any. int e = 10; for (int i=0; i < e; i++) {     while (true)     {         break;     }     // Will break to this point. }
continue statement The continue statement discontinues the current iteration of the current control statement and begins the next iteration. intch; while ((ch = GetChar()) >= 0) {     if (ch == ' ')         continue;    // Skips the rest of the while-loop     // Rest of the while-loop     ... }
Modifiers Modifiers are keywords used to modify declarations of types and type members. Most notably there is a sub-group containing the access modifiers. ,[object Object]
const - Specifies that a variable is a constant value that has to be initialized when it gets declared.
event - Declare an event.
extern - Specify that a method signature without a body uses a DLL-import.
override - Specify that a method or property declaration is an override of a virtual member or an implementation of a member of an abstract class.
readonly - Declare a field that can only be assigned values as part of the declaration or in a constructor in the same class.
sealed - Specifies that a class cannot be inherited.
static - Specifies that a member belongs to the class and not to a specific instance. (see section static)
unsafe - Specifies an unsafe context, which allows the use of pointers.
virtual - Specifies that a method or property declaration can be overridden by a derived class.
volatile - Specifies a field which may be modified by an external process and prevents an optimizing compiler from modifying the use of the field.,[object Object]
F SHARP F# uses pattern matching to resolve names into values. It is also used when accessing discriminated unions. F# comes with a Microsoft Visual Studio language service that integrates it with the IDE. All functions in F# are instances of the function type, and are immutable as well. The F# extended type system is implemented as generic .NET types.
Examples A few small samples follow: (* This is a comment *) (* Sample hello world program *) printfn "Hello World!"
 Operators
Operators
Functions

More Related Content

What's hot

Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and Answer
Vineet Kumar Saini
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
sajjad ali khan
 
New c sharp4_features_part_ii
New c sharp4_features_part_iiNew c sharp4_features_part_ii
New c sharp4_features_part_ii
Nico Ludwig
 
Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020
VigneshVijay21
 
Language tour of dart
Language tour of dartLanguage tour of dart
Language tour of dart
Imran Qasim
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
adarshynl
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
Md. Mahedee Hasan
 
CSharp difference faqs- 1
CSharp difference faqs- 1CSharp difference faqs- 1
CSharp difference faqs- 1
Umar Ali
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
nadim akber
 
C sharp
C sharpC sharp
C sharp
sanjay joshi
 
Deep C
Deep CDeep C
Deep C
Olve Maudal
 
delphi-interfaces.pdf
delphi-interfaces.pdfdelphi-interfaces.pdf
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
Dr.Neeraj Kumar Pandey
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
Leandro Schenone
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoobirbal
 
C#unit4
C#unit4C#unit4
C#unit4
raksharao
 

What's hot (18)

Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and Answer
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
New c sharp4_features_part_ii
New c sharp4_features_part_iiNew c sharp4_features_part_ii
New c sharp4_features_part_ii
 
Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020
 
Language tour of dart
Language tour of dartLanguage tour of dart
Language tour of dart
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
 
CSharp difference faqs- 1
CSharp difference faqs- 1CSharp difference faqs- 1
CSharp difference faqs- 1
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
 
C sharp
C sharpC sharp
C sharp
 
Deep C
Deep CDeep C
Deep C
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
 
delphi-interfaces.pdf
delphi-interfaces.pdfdelphi-interfaces.pdf
delphi-interfaces.pdf
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
C reference manual
C reference manualC reference manual
C reference manual
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoo
 
C#unit4
C#unit4C#unit4
C#unit4
 

Viewers also liked

Celebrate Italian, Polish and Native American Heritage in October
Celebrate Italian, Polish and Native American Heritage in OctoberCelebrate Italian, Polish and Native American Heritage in October
Celebrate Italian, Polish and Native American Heritage in October
Staff Management | SMX
 
Kham pha Pajero Sport bang hinh anh
Kham pha Pajero Sport bang hinh anhKham pha Pajero Sport bang hinh anh
Kham pha Pajero Sport bang hinh anh
Vina Star Motors Corporation
 
Bodas albert camus
Bodas   albert camusBodas   albert camus
Bodas albert camus
quinteroregos
 
Bản tin Mitsubishi tháng 1/2012
Bản tin Mitsubishi tháng 1/2012Bản tin Mitsubishi tháng 1/2012
Bản tin Mitsubishi tháng 1/2012
Vina Star Motors Corporation
 
Procure con indirect east 2013 brochure
Procure con indirect east 2013 brochureProcure con indirect east 2013 brochure
Procure con indirect east 2013 brochureStaff Management | SMX
 

Viewers also liked (7)

Celebrate Italian, Polish and Native American Heritage in October
Celebrate Italian, Polish and Native American Heritage in OctoberCelebrate Italian, Polish and Native American Heritage in October
Celebrate Italian, Polish and Native American Heritage in October
 
Age Awareness
Age AwarenessAge Awareness
Age Awareness
 
Disability Discrimination Month
Disability Discrimination MonthDisability Discrimination Month
Disability Discrimination Month
 
Kham pha Pajero Sport bang hinh anh
Kham pha Pajero Sport bang hinh anhKham pha Pajero Sport bang hinh anh
Kham pha Pajero Sport bang hinh anh
 
Bodas albert camus
Bodas   albert camusBodas   albert camus
Bodas albert camus
 
Bản tin Mitsubishi tháng 1/2012
Bản tin Mitsubishi tháng 1/2012Bản tin Mitsubishi tháng 1/2012
Bản tin Mitsubishi tháng 1/2012
 
Procure con indirect east 2013 brochure
Procure con indirect east 2013 brochureProcure con indirect east 2013 brochure
Procure con indirect east 2013 brochure
 

Similar to c# at f#

fds unit1.docx
fds unit1.docxfds unit1.docx
fds unit1.docx
AzhagesvaranTamilsel
 
C++ Training
C++ TrainingC++ Training
C++ Training
SubhendraBasu5
 
434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
MAHESHV559910
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
InfinityWorld3
 
C Language Presentation.pptx
C Language Presentation.pptxC Language Presentation.pptx
C Language Presentation.pptx
PradeepKumar206701
 
1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx
tarifarmarie
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
Yashsharma304389
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
Sagar Pednekar
 
java vs C#
java vs C#java vs C#
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
sachindane
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
shubhra chauhan
 
C programming notes
C programming notesC programming notes
C programming notes
Prof. Dr. K. Adisesha
 
CSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfCSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdf
ssusera0bb35
 
Introduction to c sharp
Introduction to c sharpIntroduction to c sharp
Introduction to c sharp
immamir2
 
Basic Structure Of C++
Basic Structure Of C++Basic Structure Of C++
Basic Structure Of C++
DevangiParekh1
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
AdiseshaK
 
Introduction of C# BY Adarsh Singh
Introduction of C# BY Adarsh SinghIntroduction of C# BY Adarsh Singh
Introduction of C# BY Adarsh Singh
singhadarsh
 

Similar to c# at f# (20)

Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
fds unit1.docx
fds unit1.docxfds unit1.docx
fds unit1.docx
 
C++ Training
C++ TrainingC++ Training
C++ Training
 
434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
 
C Language Presentation.pptx
C Language Presentation.pptxC Language Presentation.pptx
C Language Presentation.pptx
 
1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx1 CMPS 12M Introduction to Data Structures Lab La.docx
1 CMPS 12M Introduction to Data Structures Lab La.docx
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
 
java vs C#
java vs C#java vs C#
java vs C#
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
Final requirement
Final requirementFinal requirement
Final requirement
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
C programming notes
C programming notesC programming notes
C programming notes
 
CSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdfCSharpCheatSheetV1.pdf
CSharpCheatSheetV1.pdf
 
Introduction to c sharp
Introduction to c sharpIntroduction to c sharp
Introduction to c sharp
 
Basic Structure Of C++
Basic Structure Of C++Basic Structure Of C++
Basic Structure Of C++
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
 
Introduction of C# BY Adarsh Singh
Introduction of C# BY Adarsh SinghIntroduction of C# BY Adarsh Singh
Introduction of C# BY Adarsh Singh
 

Recently uploaded

DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
MERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDFMERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDF
scholarhattraining
 
kitab khulasah nurul yaqin jilid 1 - 2.pptx
kitab khulasah nurul yaqin jilid 1 - 2.pptxkitab khulasah nurul yaqin jilid 1 - 2.pptx
kitab khulasah nurul yaqin jilid 1 - 2.pptx
datarid22
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
christianmathematics
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 

Recently uploaded (20)

DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
MERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDFMERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDF
 
kitab khulasah nurul yaqin jilid 1 - 2.pptx
kitab khulasah nurul yaqin jilid 1 - 2.pptxkitab khulasah nurul yaqin jilid 1 - 2.pptx
kitab khulasah nurul yaqin jilid 1 - 2.pptx
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 

c# at f#

  • 1. C# and F# Programming Language
  • 2. C SHARP It was developed by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270). C# is one of the programming languages designed for the Common Language Infrastructure. "C sharp" was inspired by musical notation where a sharp indicates that the written note should be made a semitone higher in pitch. C#'s principal designer and lead architect at Microsoft is Anders Hejlsberg, who was previously involved with the design of Turbo Pascal, Embarcadero Delphi.
  • 3. Design Goals of C# C# language is intended to be a simple, modern, general-purpose, object-oriented programming language. The language, and implementations thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, detection of attempts to use uninitialized variables, and automatic garbage collection. The language is intended for use in developing software components suitable for deployment in distributed environments. Source code portability is very important, as is programmer portability, especially for those programmers already familiar with C and C++.
  • 4. Design Goals of C# Support for internationalization is very important. C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions. Although C# applications are intended to be economical with regard to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language.
  • 6. Distinguishing Features of C# It has no global variables or functions. All methods and members must be declared within classes. Static members of public classes can substitute for global variables and functions. Local variables cannot shadow variables of the enclosing block, unlike C and C++. Variable shadowing is often considered confusing by C++ texts. C# supports a strict Boolean data type. In C#, memory address pointers can only be used within blocks specifically marked as unsafe, and programs with unsafe code need appropriate permissions to run. Managed memory cannot be explicitly freed.
  • 7. Distinguishing Features of C# Multiple inheritance is not supported, although a class can implement any number of interfaces. C# is more type safe than C++. C# currently (as of version 4.0) has 77 reserved words.
  • 8.
  • 9.
  • 10.
  • 11. Preprocessor C# features "preprocessor directives" (though it does not have an actual preprocessor) based on the C preprocessor that allow programmers to define symbols but not macros. Conditionals such as #if, #endif, and #else are also provided. Directives such as #region give hints to editors for code folding. public class Foo { #region Procedures public void IntBar(intfirstParam) {} public void StrBar(string firstParam) {} public void BoolBar(bool firstParam) {} #endregion #region Constructors public Foo() {} public Foo(intfirstParam) {} #endregion }
  • 12. "Hello world" example using System; class Program { static void Main() { Console.WriteLine("Hello world!"); } }
  • 13.
  • 19.
  • 20.
  • 21. start with a symbol, unless it is a keyword (check Keywords).
  • 22.
  • 25. Variables Variables are identifiers associated with values. They are declared by writing the variable's type and name, and are optionally initialized in the same statement by assigning a value. Declare intMyInt; // Declaring an uninitialized variable called 'MyInt', of type 'int' Initialize intMyInt; // Declaring an uninitialized variable MyInt = 35; // Initializing the variable Declare & initialize intMyInt = 35; // Declaring and initializing the variable at the same time
  • 27.
  • 28.
  • 29. Jump statements The goto statement can be used in switch statements to jump from one case to another or to fall through from one case to the next. switch(n) { case 1: Console.WriteLine("Case 1"); break; case 2: Console.WriteLine("Case 2"); goto case 1; case 3: Console.WriteLine("Case 3"); case 4: // Compilation will fail here as cases cannot fall through in C#. Console.WriteLine("Case 4"); goto default; // This is the correct way to fall through to the next case. default: Console.WriteLine("Default"); }
  • 30.
  • 31. break statement The break statement breaks out of the closest loop or switch statement. Execution continues in the statement after the terminated statement, if any. int e = 10; for (int i=0; i < e; i++) { while (true) { break; } // Will break to this point. }
  • 32. continue statement The continue statement discontinues the current iteration of the current control statement and begins the next iteration. intch; while ((ch = GetChar()) >= 0) { if (ch == ' ') continue; // Skips the rest of the while-loop // Rest of the while-loop ... }
  • 33.
  • 34. const - Specifies that a variable is a constant value that has to be initialized when it gets declared.
  • 35. event - Declare an event.
  • 36. extern - Specify that a method signature without a body uses a DLL-import.
  • 37. override - Specify that a method or property declaration is an override of a virtual member or an implementation of a member of an abstract class.
  • 38. readonly - Declare a field that can only be assigned values as part of the declaration or in a constructor in the same class.
  • 39. sealed - Specifies that a class cannot be inherited.
  • 40. static - Specifies that a member belongs to the class and not to a specific instance. (see section static)
  • 41. unsafe - Specifies an unsafe context, which allows the use of pointers.
  • 42. virtual - Specifies that a method or property declaration can be overridden by a derived class.
  • 43.
  • 44. F SHARP F# uses pattern matching to resolve names into values. It is also used when accessing discriminated unions. F# comes with a Microsoft Visual Studio language service that integrates it with the IDE. All functions in F# are instances of the function type, and are immutable as well. The F# extended type system is implemented as generic .NET types.
  • 45. Examples A few small samples follow: (* This is a comment *) (* Sample hello world program *) printfn "Hello World!"
  • 51. Types
  • 58. The End Presented by: Harry Kim Balois BSCS 41A