SlideShare a Scribd company logo
C# Series, Week 0
Jamshid Hashimi, CodeWeekend
Agenda
• What is C#?
• Why C#?
• History of C#
• What is Object?
• Object Oriented Programming
• Managed Languages
• C# Syntax
• Installing C#
• Downloading and Installing Visual Studio
What is C#
• C# (pronounced "C-sharp") is an object-oriented programming
language from Microsoft that aims to combine the computing power
of C++ with the programming ease of Visual Basic. C# is based on C++
and contains features similar to those of Java.
• Designed by: Microsoft
• Developed by: Microsoft
• First Appeared at: 2000, 15 years ago
• Stable Release: 5.0
• Development Team Lead by: Anders Hejlsberg
Why C#?
• Modernized Language
• C# is a modernized version of C++
• It was C, then C++. Now it C#
• Type-safety
• You can not use uninitialized variables
• You can not walk past the end of an array
• Object Oriented
• C# goes to another level, even simple data types can be treated as Objects.
• Simplified Syntax
• C++ is powerful but not easy. C# is type safe, for example C# does away with Pointers. C# do not
allow direct memory manipulation, so pointers are not needed.
• Header files have also been removed from C#. The namespace and reference operators, :: and ->
respectively, have been replaced with a single operator, the period (.).
• int and bool data types are completely different now!
• C# removes memory management issues by using .NET garbage collection scheme.
Why C#?
• XML Comments
• Comments can be source code independent
• Not Just Microsoft
• Mono
• The power to be unsafe
• You can directly access to memory
• If you want to drive without a seatbelt, you are free to do so.
• Is a general purpose language
• Dev Productivity
History of C#
• January 1999: Anders Hejlsberg formed a team to build a new
language, named Cool, which stood for “C-like Object Oriented
Language”.
• July 2000, PDC: Language name changed to C#
• Anders Hejlsberg:
• C# Principle designer and lead architect
• Also designed Turbo Pascal and Delphi
• Stated: Flaws in other languages (e.g. C++, Java, Delphi, and Smalltalk) drove
the fundamentals of CLR, which, in return drove the design of C#.
• “It is not a clone of Java, it is much closer to C++ in its design”
• To many programmers, C# is Microsoft’s answer to Java.
History of C#
• The name
• Inspired by musical notation where a sharp indicates that the written note
should made a semitone higher in pitch.
• C++, means C incremented and C#, means C++ incremented. (# is made by
four +)
What is Object?
• Object is the foundational piece of object oriented programming language.
• An object typically makes a concept.
• An object is something e.g. customer
• An object has data e.g. customer’s first name
• An object performs action
• Make a customer preferred
• Color a car
• Change customer’s name
• Object is a thing
• To define a thing we need to talk about its characteristics.
What is Object?
• Suppose you are a Personnel Manager for a company and need to hire
someone in an important position.
• You select one resume, Jane
• You are Jack
• You call her
• Arrange an interview, she will fly to your location
• You two never met before, so started asking few questions from each other: height,
hair type, cloth color and briefcase color
• Without realizing it, you used objects in the course of your conversation
• You created a Person class. A class is a template used to describe an object.
• A class is an abstraction or simplification of some object your observe in the real
world.
• Objects has two basic components:
• Properties that describe the object
• Methods, or actions, that you want to associate with the object
What is Object?
Object Oriented Programming
• To be object oriented, a language is designed around the concept of
objects.
• Objects have certain properties as exhibits certain behaviors.
• It means language generally includes support for:
• Encapsulation
• Inheritance
• Polymorphism
Object Oriented Programming
• Encapsulation
• The wall around code
• I don’t want you to get confused
• I just want you get in touch with me with the Windows and Doors.
• A customer has a first name, but you don’t care how that’s stored. You just
want to get in and extract the information needed.
• We encapsulate to keep our code secure.
Object Oriented Programming
• Inheritance
• Fundamentally based on the idea of code reuse.
• You create behaviors, others can use it through inheritance channel.
• The quality you get from your parents 
Object Oriented Programming
Object Oriented Programming
• Polymorphism
• from Greek πολύς, polys, "many, much" and μορφή, morphē, "form, shape"
• Objects can appear in different shapes, forms.
• Instead of sticking with the concept of “many shapes”, perhaps the definition should
be amended to mean “many messages.”
• In essence Polymorphism means that you can send the same message to a group of
different classes and that each class will know how to respond correctly to that
message.
• clsBuilding – base class, RemoveSnow() - virtual
• clsApartment – RemoveSnow() - override
• clsCommercial – RemoveSnow() – override
• myApt.RemoveSnow()
• myComm.RemoveSnow()
• myHome.RemoveSnow() – We don’t have a RemoveSnow method for our clsHome object.
Still it outputs.
Managed Languages
• Managed language depends on services provided by a runtime
environment
• C# is one of many programming languages which it compiles into managed
code. (others are: F#, C++, VB and more..)
• Managed runtime in .NET is called Common Language Runtime (CLR)
• Common Language Runtime (CLR) provides:
• Automatic Memory Management
• Exception Handling
• Standard Types
• Security
Managed Languages
• Managed Code
• Managed code is a code that has its execution managed by .NET framework
Common Language Runtime (CLR)
• When you compile C# code to .exe, it is compiled to Common Intermediate
Language (CIL), bytecode.
• Whenever you run a CIL executable, it is executed on Microsoft Common
Language Runtime (CLR) virtual machine.
• You must have the .NET runtime installed on any client machines where your
program will be running.
• C# do not compiles directly to machine code. It compiles to CIL (bytecode).
CLR executes the bytecode to machine code.
C# Syntax
• C# syntax is based on C and C++ syntax
• Identifiers are names of classes, methods, variables and so on
• Console, Writeline, AcceptDetails(), GetArea(), length, width, Display and so
on.
• Keywords are compiler reserved words
• Public, class, string, get, set, void and so on.
• Using keyword is used to include namespaces inside our program.
C# Syntax
C# Syntax
C# Syntax
Thank You! 

More Related Content

Similar to Introduction to C# - Week 0 (20)

CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)
Dilawar Khan
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++
farooq2016
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptx
percivalfernandez3
 
Advance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfAdvance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdf
percivalfernandez2
 
Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#
Jussi Pohjolainen
 
C sharp
C sharpC sharp
C sharp
Ahmed Vic
 
Ios development
Ios developmentIos development
Ios development
Shakil Ahmed
 
Xcode, Basics and Beyond
Xcode, Basics and BeyondXcode, Basics and Beyond
Xcode, Basics and Beyond
rsebbe
 
C#
C#C#
C#
Momentum Design Lab
 
Lec1.pptx
Lec1.pptxLec1.pptx
Lec1.pptx
MunibaKhan12
 
The Big Picture
The Big PictureThe Big Picture
The Big Picture
Munazza-Mah-Jabeen
 
C_Programming_Notes_ICE
C_Programming_Notes_ICEC_Programming_Notes_ICE
C_Programming_Notes_ICE
Gilbert NZABONITEGEKA
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
jatin batra
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
Sireesh K
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
Tanveer Malik
 
Introduction to .NET
Introduction to .NETIntroduction to .NET
Introduction to .NET
Joni
 
Session#1 csharp MTCS
Session#1 csharp MTCSSession#1 csharp MTCS
Session#1 csharp MTCS
Ahmad Ehab
 
Bootstrapping iPhone Development
Bootstrapping iPhone DevelopmentBootstrapping iPhone Development
Bootstrapping iPhone Development
ThoughtWorks
 
ASP.NET Session 3
ASP.NET Session 3ASP.NET Session 3
ASP.NET Session 3
Sisir Ghosh
 
C++ l 1
C++ l 1C++ l 1
C++ l 1
vineet_singh
 
CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)CS4443 - Modern Programming Language - I Lecture (1)
CS4443 - Modern Programming Language - I Lecture (1)
Dilawar Khan
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++
farooq2016
 
Advance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptxAdvance C# Programming Part 1.pptx
Advance C# Programming Part 1.pptx
percivalfernandez3
 
Advance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfAdvance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdf
percivalfernandez2
 
Xcode, Basics and Beyond
Xcode, Basics and BeyondXcode, Basics and Beyond
Xcode, Basics and Beyond
rsebbe
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
jatin batra
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
Sireesh K
 
Introduction to .NET
Introduction to .NETIntroduction to .NET
Introduction to .NET
Joni
 
Session#1 csharp MTCS
Session#1 csharp MTCSSession#1 csharp MTCS
Session#1 csharp MTCS
Ahmad Ehab
 
Bootstrapping iPhone Development
Bootstrapping iPhone DevelopmentBootstrapping iPhone Development
Bootstrapping iPhone Development
ThoughtWorks
 
ASP.NET Session 3
ASP.NET Session 3ASP.NET Session 3
ASP.NET Session 3
Sisir Ghosh
 

More from Jamshid Hashimi (20)

Week 2: Getting Your Hands Dirty – Part 2
Week 2: Getting Your Hands Dirty – Part 2Week 2: Getting Your Hands Dirty – Part 2
Week 2: Getting Your Hands Dirty – Part 2
Jamshid Hashimi
 
Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1
Jamshid Hashimi
 
RIST - Research Institute for Science and Technology
RIST - Research Institute for Science and TechnologyRIST - Research Institute for Science and Technology
RIST - Research Institute for Science and Technology
Jamshid Hashimi
 
How Coding Can Make Your Life Better
How Coding Can Make Your Life BetterHow Coding Can Make Your Life Better
How Coding Can Make Your Life Better
Jamshid Hashimi
 
Mobile Vision
Mobile VisionMobile Vision
Mobile Vision
Jamshid Hashimi
 
Tips for Writing Better Code
Tips for Writing Better CodeTips for Writing Better Code
Tips for Writing Better Code
Jamshid Hashimi
 
Launch Your Local Blog & Social Media Integration
Launch Your Local Blog & Social Media IntegrationLaunch Your Local Blog & Social Media Integration
Launch Your Local Blog & Social Media Integration
Jamshid Hashimi
 
Customizing Your Blog 2
Customizing Your Blog 2Customizing Your Blog 2
Customizing Your Blog 2
Jamshid Hashimi
 
Customizing Your Blog 1
Customizing Your Blog 1Customizing Your Blog 1
Customizing Your Blog 1
Jamshid Hashimi
 
Introduction to Blogging
Introduction to BloggingIntroduction to Blogging
Introduction to Blogging
Jamshid Hashimi
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to Wordpress
Jamshid Hashimi
 
CodeIgniter Helper Functions
CodeIgniter Helper FunctionsCodeIgniter Helper Functions
CodeIgniter Helper Functions
Jamshid Hashimi
 
CodeIgniter Class Reference
CodeIgniter Class ReferenceCodeIgniter Class Reference
CodeIgniter Class Reference
Jamshid Hashimi
 
Managing Applications in CodeIgniter
Managing Applications in CodeIgniterManaging Applications in CodeIgniter
Managing Applications in CodeIgniter
Jamshid Hashimi
 
CodeIgniter Practice
CodeIgniter PracticeCodeIgniter Practice
CodeIgniter Practice
Jamshid Hashimi
 
CodeIgniter & MVC
CodeIgniter & MVCCodeIgniter & MVC
CodeIgniter & MVC
Jamshid Hashimi
 
PHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniterPHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniter
Jamshid Hashimi
 
Exception & Database
Exception & DatabaseException & Database
Exception & Database
Jamshid Hashimi
 
MySQL Record Operations
MySQL Record OperationsMySQL Record Operations
MySQL Record Operations
Jamshid Hashimi
 
MySQL JOIN & UNION
MySQL JOIN & UNIONMySQL JOIN & UNION
MySQL JOIN & UNION
Jamshid Hashimi
 
Week 2: Getting Your Hands Dirty – Part 2
Week 2: Getting Your Hands Dirty – Part 2Week 2: Getting Your Hands Dirty – Part 2
Week 2: Getting Your Hands Dirty – Part 2
Jamshid Hashimi
 
Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1
Jamshid Hashimi
 
RIST - Research Institute for Science and Technology
RIST - Research Institute for Science and TechnologyRIST - Research Institute for Science and Technology
RIST - Research Institute for Science and Technology
Jamshid Hashimi
 
How Coding Can Make Your Life Better
How Coding Can Make Your Life BetterHow Coding Can Make Your Life Better
How Coding Can Make Your Life Better
Jamshid Hashimi
 
Tips for Writing Better Code
Tips for Writing Better CodeTips for Writing Better Code
Tips for Writing Better Code
Jamshid Hashimi
 
Launch Your Local Blog & Social Media Integration
Launch Your Local Blog & Social Media IntegrationLaunch Your Local Blog & Social Media Integration
Launch Your Local Blog & Social Media Integration
Jamshid Hashimi
 
Introduction to Blogging
Introduction to BloggingIntroduction to Blogging
Introduction to Blogging
Jamshid Hashimi
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to Wordpress
Jamshid Hashimi
 
CodeIgniter Helper Functions
CodeIgniter Helper FunctionsCodeIgniter Helper Functions
CodeIgniter Helper Functions
Jamshid Hashimi
 
CodeIgniter Class Reference
CodeIgniter Class ReferenceCodeIgniter Class Reference
CodeIgniter Class Reference
Jamshid Hashimi
 
Managing Applications in CodeIgniter
Managing Applications in CodeIgniterManaging Applications in CodeIgniter
Managing Applications in CodeIgniter
Jamshid Hashimi
 
PHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniterPHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniter
Jamshid Hashimi
 

Recently uploaded (20)

AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 

Introduction to C# - Week 0

  • 1. C# Series, Week 0 Jamshid Hashimi, CodeWeekend
  • 2. Agenda • What is C#? • Why C#? • History of C# • What is Object? • Object Oriented Programming • Managed Languages • C# Syntax • Installing C# • Downloading and Installing Visual Studio
  • 3. What is C# • C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. • Designed by: Microsoft • Developed by: Microsoft • First Appeared at: 2000, 15 years ago • Stable Release: 5.0 • Development Team Lead by: Anders Hejlsberg
  • 4. Why C#? • Modernized Language • C# is a modernized version of C++ • It was C, then C++. Now it C# • Type-safety • You can not use uninitialized variables • You can not walk past the end of an array • Object Oriented • C# goes to another level, even simple data types can be treated as Objects. • Simplified Syntax • C++ is powerful but not easy. C# is type safe, for example C# does away with Pointers. C# do not allow direct memory manipulation, so pointers are not needed. • Header files have also been removed from C#. The namespace and reference operators, :: and -> respectively, have been replaced with a single operator, the period (.). • int and bool data types are completely different now! • C# removes memory management issues by using .NET garbage collection scheme.
  • 5. Why C#? • XML Comments • Comments can be source code independent • Not Just Microsoft • Mono • The power to be unsafe • You can directly access to memory • If you want to drive without a seatbelt, you are free to do so. • Is a general purpose language • Dev Productivity
  • 6. History of C# • January 1999: Anders Hejlsberg formed a team to build a new language, named Cool, which stood for “C-like Object Oriented Language”. • July 2000, PDC: Language name changed to C# • Anders Hejlsberg: • C# Principle designer and lead architect • Also designed Turbo Pascal and Delphi • Stated: Flaws in other languages (e.g. C++, Java, Delphi, and Smalltalk) drove the fundamentals of CLR, which, in return drove the design of C#. • “It is not a clone of Java, it is much closer to C++ in its design” • To many programmers, C# is Microsoft’s answer to Java.
  • 7. History of C# • The name • Inspired by musical notation where a sharp indicates that the written note should made a semitone higher in pitch. • C++, means C incremented and C#, means C++ incremented. (# is made by four +)
  • 8. What is Object? • Object is the foundational piece of object oriented programming language. • An object typically makes a concept. • An object is something e.g. customer • An object has data e.g. customer’s first name • An object performs action • Make a customer preferred • Color a car • Change customer’s name • Object is a thing • To define a thing we need to talk about its characteristics.
  • 9. What is Object? • Suppose you are a Personnel Manager for a company and need to hire someone in an important position. • You select one resume, Jane • You are Jack • You call her • Arrange an interview, she will fly to your location • You two never met before, so started asking few questions from each other: height, hair type, cloth color and briefcase color • Without realizing it, you used objects in the course of your conversation • You created a Person class. A class is a template used to describe an object. • A class is an abstraction or simplification of some object your observe in the real world. • Objects has two basic components: • Properties that describe the object • Methods, or actions, that you want to associate with the object
  • 11. Object Oriented Programming • To be object oriented, a language is designed around the concept of objects. • Objects have certain properties as exhibits certain behaviors. • It means language generally includes support for: • Encapsulation • Inheritance • Polymorphism
  • 12. Object Oriented Programming • Encapsulation • The wall around code • I don’t want you to get confused • I just want you get in touch with me with the Windows and Doors. • A customer has a first name, but you don’t care how that’s stored. You just want to get in and extract the information needed. • We encapsulate to keep our code secure.
  • 13. Object Oriented Programming • Inheritance • Fundamentally based on the idea of code reuse. • You create behaviors, others can use it through inheritance channel. • The quality you get from your parents 
  • 15. Object Oriented Programming • Polymorphism • from Greek πολύς, polys, "many, much" and μορφή, morphē, "form, shape" • Objects can appear in different shapes, forms. • Instead of sticking with the concept of “many shapes”, perhaps the definition should be amended to mean “many messages.” • In essence Polymorphism means that you can send the same message to a group of different classes and that each class will know how to respond correctly to that message. • clsBuilding – base class, RemoveSnow() - virtual • clsApartment – RemoveSnow() - override • clsCommercial – RemoveSnow() – override • myApt.RemoveSnow() • myComm.RemoveSnow() • myHome.RemoveSnow() – We don’t have a RemoveSnow method for our clsHome object. Still it outputs.
  • 16. Managed Languages • Managed language depends on services provided by a runtime environment • C# is one of many programming languages which it compiles into managed code. (others are: F#, C++, VB and more..) • Managed runtime in .NET is called Common Language Runtime (CLR) • Common Language Runtime (CLR) provides: • Automatic Memory Management • Exception Handling • Standard Types • Security
  • 17. Managed Languages • Managed Code • Managed code is a code that has its execution managed by .NET framework Common Language Runtime (CLR) • When you compile C# code to .exe, it is compiled to Common Intermediate Language (CIL), bytecode. • Whenever you run a CIL executable, it is executed on Microsoft Common Language Runtime (CLR) virtual machine. • You must have the .NET runtime installed on any client machines where your program will be running. • C# do not compiles directly to machine code. It compiles to CIL (bytecode). CLR executes the bytecode to machine code.
  • 18. C# Syntax • C# syntax is based on C and C++ syntax • Identifiers are names of classes, methods, variables and so on • Console, Writeline, AcceptDetails(), GetArea(), length, width, Display and so on. • Keywords are compiler reserved words • Public, class, string, get, set, void and so on. • Using keyword is used to include namespaces inside our program.