SlideShare uma empresa Scribd logo
1 de 18
Me
HOW TO COMMAND A COMPUTER ?
LIFE OF WINDOWS PROGRAMMERS BEFORE THE
.NET FRAMEWORK
To command a computer’s hardware, you must speak its language
which is binary language (Zeros and Ones) so we need to give
the data like (the numbers, characters,…) a code representing it and
we also we need to give the instructions a binary representation.
For example:
To represent “5” in 7 bits: 0000101
But is it Simple ? >> (First Problem).
ASSEMBLY PROGRAMMING
LANGUAGE
It’s an almost exactly like the machine language (zeros and ones) but
it uses words instead of zeros and ones
 BUT how can the computer understand it ?!
The Assembler have the answer of this question. The Assembler is a
program that translates your program- written in assembly language-
into machine code (zeros and ones)
Assembly considered a low-level programming language with no
abstraction as you deal with hardware directly like registers of the
processor.
But it is Complex >> (Second Problem) >> let’s take a peak at it
ASSEMBLY PROGRAMMING
LANGUAGE
HIGH LEVEL PROGRAMMING
LANGUAGES
High-Level Programming Languages solved the complexity of assembly
language and gives an abstraction for the programmer isolating it from
using assembly instructions.
This abstraction is provided by the Compiler. The Compiler is a program /
set of programs that translate your source code – written in a high level
language – into assembly language then the assembler translate it into
machine code.
Many programmers find C++ a difficult programming language for many
reasons like:
- Manual Memory Management
- Ugly Pointers
- Ugly Syntactical Constructs
WHAT ABOUT LANGUAGES
INTERACTION?
I mean if we have an application written in C++, how will it interact
with an application written in VB ?!
In 1991, Microsoft introduced its application development framework,
Component Object Model “COM”, which is an architecture that says:
“If you build your data types in accordance with the rules of COM,
you end up with a block of reusable binary code”
So, Languages can interact using COM but there is a problem !!
COM Data Type representation is Complex !! (Fifth Problem)
LET’S CONTINUE OUR STORY
By late 2000, Microsoft introduced the first beta version of .NET Framework in order
to solve these problems.
But “What’s the meaning of the Framework in general ?! “
Software Framework is a set of tools like Code Libraries, Compilers, that help in
developing a project. From a Programmer’s point of view, it can be considered
a Runtime Environment(an environment where your source code run) and libraries to
use it in your source code.
A CLOSER LOOK AT THE .NET
FRAMEWORK
“Life in a Multi-Language World”
.NET Framework support numerous programming languages (C#, Visual Basic, F#,
S#, so on) as programmers are a very particular lot when it comes to the choice of
a programming language.
*The Second Problem* has been solved as if you finds C/C++ difficult due to its
Ugly Arithmetic Pointers or its Ugly Syntactical Constructs you can use any .NET
language that you feel good with.
No pointers required! C# programs typically have no need for direct pointer
manipulation.
// Automatic memory management through garbage collection.
WHAT’S THE . NET ASSEMBLIES ?!
All .NET compilers emit a file of *.dll or *.exe extension which
is called Assembly File. The assembly file consists CIL “Common
Intermediate Language” Code , Metadata, and Assembly Manifest.
Let’s talk about these components one by one.
During compilation of any .NET programming language, your source
code is translated to another language called Common Intermediate
Language or Microsoft Intermediate Language (MSIL) rather than
being translated to object code. This Intermediate language can sit
above any instruction set of any processor.
EXAMPLE..
If I write a program that calculates the average of two integers in C#
and I re-write the same program in Visual Basic, the C# compiler and
the VB compiler will emit the same Assembly File with the same CIL
Code.
But Why Using CIL ?!
The answer of this question will direct us to the solution of the first
problem as the main benefit of CIL is (LANGUAGE INTEGRATION)
where all .NET languages are able to interact within a well-defined
binary area.
SO,
YOU CAN INTERACT WITH ANY .NET APPLICATION REGARDLESS OF
THE LANGUAGE WITH WHICH IT’S DEVELOPED!
LET’S CONTINUE..
Now, the two problems have been solved. Let’s continue discovering
.NET features.
As I mentioned before, the assembly file contains a metadata and
assembly manifest in addition to CIL. I expect now that you get the
meaning of CIL so I'll start talking about metadata and assembly
manifest.
The Metadata: describes every type (e.g., class, structure, enumeration)
defined in your code, as well as the members of each type (e.g.,
properties, methods, events).
Assembly Manifest contains metadata that describes the assembly itself
BASE CLASS LIBRARY (BCL)
“Framework” in general, Framework can be considered as a Runtime
Environment plus Predefined Class Libraries to be directly used by the
programmer
NAMESPACES !
But how are all the types (classes) organized within BCL ?!
.NET makes extensive use of namespace concept to keep all the
types within BCL well-organized. So, we can consider the namespace
as a logical grouping of related types contained in an assembly.
*Remember: All the .NET languages use BCL so all the .NET languages
use the same namespaces.
Example: All the classes related to file input and output will be
placed in the same namespace which is called “System.IO”.
LET’S SUMMARIZE
All what we talked about with respect to the .NET Framework can be summarized as the
following:
.NET Framework support numerous programming languages where each has its own
compiler but all the .NET compilers emit assemblies.
All .NET compilers translate your source code to Common Intermediate Language Code that
takes place in the assemblies to enable language interaction.
The assembly file also contains metadata that describes the types (classes, structures,…)
you used in your source code in addition to assembly manifest that describes the assembly
itself.
.NET provides the programmer Base Class Library that includes number of predefined
classes that represents many services to be used directly by the programmer. Also, this
encapsulation provides a shelter from the complexity of API Calls.
.NET makes an extensive use of “namespace” concept to keep all the related types well-
organized within BCL where all the related types are placed in the same assembly.
All the .NET languages use BCL with the same namespaces where there are two root
namespaces (Microsoft and System).
ENOUGH WITH COMPILATION TIME
AND LET’S MOVE TO .NET RUN-
TIME
The framework can be considered from the programmer’s point of
view as a Runtime Environment ( WHERE YOUR APPLICATION RUNS ! )
“Common Language Runtime” (CLR)
Yes, all the .NET languages go through the same runtime layer which
is Common Language Runtime (CLR). CLR can be considered the
virtual machine component of the .NET framework which is
responsible for execution the .NET programs.
A PEAK ON CLR.
CLR is responsible for translating the CIL Code to machine
instructions so that it can be executed, also its responsible for low
level details like garbage collection, application hosting, memory
management, and various security checks.
LET’S GO WITH THE FLOW
1. First you write the source code in any .NET language like C#.
2. The C# Compiler translate your code to Common Intermediate Language
emitting an assembly file or may be multi assembly files where the metadata
(describing the types you used in your code) and the assembly manifest
(describing the assembly itself) are placed.
3. CLR resolves the location of the assemblies needed for execution.
(According to the namespaces you used in your source code).
4. CLR reads the metadata in the assemblies to find the requested types.
5. CLR layout the requested types in the main memory (RAM).
6. CLR compiles the CIL Code associated with the assemblies into machine
language through a compiler termed as “JITT” (Just In Time Compilation).
7. Finally, the machine language instructions are executed.
Welcome to the .Net

Mais conteúdo relacionado

Mais procurados

Introduction to compiler development
Introduction to compiler developmentIntroduction to compiler development
Introduction to compiler developmentDeepOad
 
Component of .net
Component of .netComponent of .net
Component of .netSireesh K
 
C# programming language
C# programming languageC# programming language
C# programming languageswarnapatil
 
Introduction to .NET Programming
Introduction to .NET ProgrammingIntroduction to .NET Programming
Introduction to .NET ProgrammingKarthikeyan Mkr
 
Architecture of net framework
Architecture of net frameworkArchitecture of net framework
Architecture of net frameworkumesh patil
 
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)citizenmatt
 
Source vs object code
Source vs object codeSource vs object code
Source vs object codeSana Ullah
 
Language Translator ( Compiler)
Language Translator ( Compiler)Language Translator ( Compiler)
Language Translator ( Compiler)Nazmul Hyder
 
What is c#
What is c#What is c#
What is c#shwet18
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothBhavsingh Maloth
 

Mais procurados (18)

.Net Overview
.Net Overview.Net Overview
.Net Overview
 
Introduction to compiler development
Introduction to compiler developmentIntroduction to compiler development
Introduction to compiler development
 
Unit 1
Unit 1Unit 1
Unit 1
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Intro.net
Intro.netIntro.net
Intro.net
 
Inside.Net
Inside.NetInside.Net
Inside.Net
 
C#.NET
C#.NETC#.NET
C#.NET
 
C
CC
C
 
Component of .net
Component of .netComponent of .net
Component of .net
 
C# programming language
C# programming languageC# programming language
C# programming language
 
Introduction to .NET Programming
Introduction to .NET ProgrammingIntroduction to .NET Programming
Introduction to .NET Programming
 
Architecture of net framework
Architecture of net frameworkArchitecture of net framework
Architecture of net framework
 
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
 
Source vs object code
Source vs object codeSource vs object code
Source vs object code
 
Language Translator ( Compiler)
Language Translator ( Compiler)Language Translator ( Compiler)
Language Translator ( Compiler)
 
What is c#
What is c#What is c#
What is c#
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh Maloth
 
compiler vs interpreter
compiler vs interpretercompiler vs interpreter
compiler vs interpreter
 

Destaque

The PITCH. Don't suck it. Rock it.
The PITCH. Don't suck it. Rock it.The PITCH. Don't suck it. Rock it.
The PITCH. Don't suck it. Rock it.pr.co
 
PR - a Pirate Manifesto
PR - a Pirate ManifestoPR - a Pirate Manifesto
PR - a Pirate Manifestopr.co
 
24 Productivity Habits of Successful People - by @prdotco
24 Productivity Habits of Successful People - by @prdotco24 Productivity Habits of Successful People - by @prdotco
24 Productivity Habits of Successful People - by @prdotcopr.co
 

Destaque (6)

TP's Big Pivot
TP's Big PivotTP's Big Pivot
TP's Big Pivot
 
producto 1
producto 1producto 1
producto 1
 
презентація досвіду
презентація досвідупрезентація досвіду
презентація досвіду
 
The PITCH. Don't suck it. Rock it.
The PITCH. Don't suck it. Rock it.The PITCH. Don't suck it. Rock it.
The PITCH. Don't suck it. Rock it.
 
PR - a Pirate Manifesto
PR - a Pirate ManifestoPR - a Pirate Manifesto
PR - a Pirate Manifesto
 
24 Productivity Habits of Successful People - by @prdotco
24 Productivity Habits of Successful People - by @prdotco24 Productivity Habits of Successful People - by @prdotco
24 Productivity Habits of Successful People - by @prdotco
 

Semelhante a Welcome to the .Net

.Net framework
.Net framework.Net framework
.Net frameworkViv EK
 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net frameworkFaisal Aziz
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxdawod yimer
 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iRakesh Joshi
 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iRakesh Joshi
 
.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligetiNaveen Kumar Veligeti
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qaabcxyzqaz
 
.Net framework
.Net framework.Net framework
.Net frameworkRaghu nath
 
election survey comapny in delhi|election survey company|election survey comp...
election survey comapny in delhi|election survey company|election survey comp...election survey comapny in delhi|election survey company|election survey comp...
election survey comapny in delhi|election survey company|election survey comp...dnnindia
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineAbdelrahman Hosny
 
computerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptxcomputerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptxSubramanian Mani
 

Semelhante a Welcome to the .Net (20)

Introduction to .net
Introduction to .netIntroduction to .net
Introduction to .net
 
Chapter1
Chapter1Chapter1
Chapter1
 
.Net framework
.Net framework.Net framework
.Net framework
 
.Net
.Net.Net
.Net
 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net framework
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptx
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part i
 
Dot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part iDot net-interview-questions-and-answers part i
Dot net-interview-questions-and-answers part i
 
The Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.NetThe Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.Net
 
.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qa
 
.Net framework
.Net framework.Net framework
.Net framework
 
election survey comapny in delhi|election survey company|election survey comp...
election survey comapny in delhi|election survey company|election survey comp...election survey comapny in delhi|election survey company|election survey comp...
election survey comapny in delhi|election survey company|election survey comp...
 
Programming
Programming Programming
Programming
 
Part i
Part iPart i
Part i
 
Computer programming languages
Computer programming languagesComputer programming languages
Computer programming languages
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual Machine
 
computerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptxcomputerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptx
 

Welcome to the .Net

  • 1. Me
  • 2. HOW TO COMMAND A COMPUTER ? LIFE OF WINDOWS PROGRAMMERS BEFORE THE .NET FRAMEWORK To command a computer’s hardware, you must speak its language which is binary language (Zeros and Ones) so we need to give the data like (the numbers, characters,…) a code representing it and we also we need to give the instructions a binary representation. For example: To represent “5” in 7 bits: 0000101 But is it Simple ? >> (First Problem).
  • 3. ASSEMBLY PROGRAMMING LANGUAGE It’s an almost exactly like the machine language (zeros and ones) but it uses words instead of zeros and ones  BUT how can the computer understand it ?! The Assembler have the answer of this question. The Assembler is a program that translates your program- written in assembly language- into machine code (zeros and ones) Assembly considered a low-level programming language with no abstraction as you deal with hardware directly like registers of the processor. But it is Complex >> (Second Problem) >> let’s take a peak at it
  • 5. HIGH LEVEL PROGRAMMING LANGUAGES High-Level Programming Languages solved the complexity of assembly language and gives an abstraction for the programmer isolating it from using assembly instructions. This abstraction is provided by the Compiler. The Compiler is a program / set of programs that translate your source code – written in a high level language – into assembly language then the assembler translate it into machine code. Many programmers find C++ a difficult programming language for many reasons like: - Manual Memory Management - Ugly Pointers - Ugly Syntactical Constructs
  • 6. WHAT ABOUT LANGUAGES INTERACTION? I mean if we have an application written in C++, how will it interact with an application written in VB ?! In 1991, Microsoft introduced its application development framework, Component Object Model “COM”, which is an architecture that says: “If you build your data types in accordance with the rules of COM, you end up with a block of reusable binary code” So, Languages can interact using COM but there is a problem !! COM Data Type representation is Complex !! (Fifth Problem)
  • 7. LET’S CONTINUE OUR STORY By late 2000, Microsoft introduced the first beta version of .NET Framework in order to solve these problems. But “What’s the meaning of the Framework in general ?! “ Software Framework is a set of tools like Code Libraries, Compilers, that help in developing a project. From a Programmer’s point of view, it can be considered a Runtime Environment(an environment where your source code run) and libraries to use it in your source code.
  • 8. A CLOSER LOOK AT THE .NET FRAMEWORK “Life in a Multi-Language World” .NET Framework support numerous programming languages (C#, Visual Basic, F#, S#, so on) as programmers are a very particular lot when it comes to the choice of a programming language. *The Second Problem* has been solved as if you finds C/C++ difficult due to its Ugly Arithmetic Pointers or its Ugly Syntactical Constructs you can use any .NET language that you feel good with. No pointers required! C# programs typically have no need for direct pointer manipulation. // Automatic memory management through garbage collection.
  • 9. WHAT’S THE . NET ASSEMBLIES ?! All .NET compilers emit a file of *.dll or *.exe extension which is called Assembly File. The assembly file consists CIL “Common Intermediate Language” Code , Metadata, and Assembly Manifest. Let’s talk about these components one by one. During compilation of any .NET programming language, your source code is translated to another language called Common Intermediate Language or Microsoft Intermediate Language (MSIL) rather than being translated to object code. This Intermediate language can sit above any instruction set of any processor.
  • 10. EXAMPLE.. If I write a program that calculates the average of two integers in C# and I re-write the same program in Visual Basic, the C# compiler and the VB compiler will emit the same Assembly File with the same CIL Code. But Why Using CIL ?! The answer of this question will direct us to the solution of the first problem as the main benefit of CIL is (LANGUAGE INTEGRATION) where all .NET languages are able to interact within a well-defined binary area. SO, YOU CAN INTERACT WITH ANY .NET APPLICATION REGARDLESS OF THE LANGUAGE WITH WHICH IT’S DEVELOPED!
  • 11. LET’S CONTINUE.. Now, the two problems have been solved. Let’s continue discovering .NET features. As I mentioned before, the assembly file contains a metadata and assembly manifest in addition to CIL. I expect now that you get the meaning of CIL so I'll start talking about metadata and assembly manifest. The Metadata: describes every type (e.g., class, structure, enumeration) defined in your code, as well as the members of each type (e.g., properties, methods, events). Assembly Manifest contains metadata that describes the assembly itself
  • 12. BASE CLASS LIBRARY (BCL) “Framework” in general, Framework can be considered as a Runtime Environment plus Predefined Class Libraries to be directly used by the programmer
  • 13. NAMESPACES ! But how are all the types (classes) organized within BCL ?! .NET makes extensive use of namespace concept to keep all the types within BCL well-organized. So, we can consider the namespace as a logical grouping of related types contained in an assembly. *Remember: All the .NET languages use BCL so all the .NET languages use the same namespaces. Example: All the classes related to file input and output will be placed in the same namespace which is called “System.IO”.
  • 14. LET’S SUMMARIZE All what we talked about with respect to the .NET Framework can be summarized as the following: .NET Framework support numerous programming languages where each has its own compiler but all the .NET compilers emit assemblies. All .NET compilers translate your source code to Common Intermediate Language Code that takes place in the assemblies to enable language interaction. The assembly file also contains metadata that describes the types (classes, structures,…) you used in your source code in addition to assembly manifest that describes the assembly itself. .NET provides the programmer Base Class Library that includes number of predefined classes that represents many services to be used directly by the programmer. Also, this encapsulation provides a shelter from the complexity of API Calls. .NET makes an extensive use of “namespace” concept to keep all the related types well- organized within BCL where all the related types are placed in the same assembly. All the .NET languages use BCL with the same namespaces where there are two root namespaces (Microsoft and System).
  • 15. ENOUGH WITH COMPILATION TIME AND LET’S MOVE TO .NET RUN- TIME The framework can be considered from the programmer’s point of view as a Runtime Environment ( WHERE YOUR APPLICATION RUNS ! ) “Common Language Runtime” (CLR) Yes, all the .NET languages go through the same runtime layer which is Common Language Runtime (CLR). CLR can be considered the virtual machine component of the .NET framework which is responsible for execution the .NET programs.
  • 16. A PEAK ON CLR. CLR is responsible for translating the CIL Code to machine instructions so that it can be executed, also its responsible for low level details like garbage collection, application hosting, memory management, and various security checks.
  • 17. LET’S GO WITH THE FLOW 1. First you write the source code in any .NET language like C#. 2. The C# Compiler translate your code to Common Intermediate Language emitting an assembly file or may be multi assembly files where the metadata (describing the types you used in your code) and the assembly manifest (describing the assembly itself) are placed. 3. CLR resolves the location of the assemblies needed for execution. (According to the namespaces you used in your source code). 4. CLR reads the metadata in the assemblies to find the requested types. 5. CLR layout the requested types in the main memory (RAM). 6. CLR compiles the CIL Code associated with the assemblies into machine language through a compiler termed as “JITT” (Just In Time Compilation). 7. Finally, the machine language instructions are executed.