SlideShare a Scribd company logo
1 of 12
Difference between C, C++ ,C#
(CSharp).net
Brought to you by www.SiryMedia.in
• C - an older programming language that is described as Hands-on. As
the programmer you must tell the program to do everything. Also this
language will let you do almost anything. It does not support object
oriented code. Thus no classes.
• C++ - an extension language per se of C. In C code ++ means increment
1. Thus C++ is better than C. It allows for highly controlled object
oriented code. Once again a very hands on language that goes into
MUCH detail.
• C# - Full object oriented code resembling the style of C/C++ code. This
is really closer to JAVA. C# is the latest version of the C style languages
and is very good for developing web applications.
• Both C and C++ give you a lower level of abstraction that, with increased complexity,
provides a breadth of access to underlying machine functionality that are not
necessarily exposed with other languages. C++ adds the convenience (reduced
development time) of a fully object oriented language which can, potentially, add an
additional performance cost. In terms of real world applications, I see these
languages applied in the following domains:
• C is a Kernel level software for Hardware device drivers with Applications where
access to old, stable code is required.
• C,C++ is a Application or Server development where memory management needs to
be fine tuned (and can't be left to generic garbage collection solutions).
• Development environments that require access to libraries that do not interface well
with more modern managed languages.
• Although managed C++ can be used to access the .NET framework, it is not a
seamless transition.
• C# provides a managed memory model that adds a higher level of abstraction again. This level of
abstraction adds convenience and improves development times, but complicates access to lower
level APIs and makes specialized performance requirements problematic.
• It is certainly possible to implement extremely high performance software in a managed memory
environment, but awareness of the implications is essential.
• The syntax of C# is certainly less demanding (and error prone) than C/C++ and has, for the
initiated programmer, a shallower learning curve.
• C# is a Rapid client application development. With High performance Server development (Stack
Overflow for example) that benefits from the .NET framework.
• Applications that require the benefits of the .NET framework in the language it was designed for.
• Johannes Rössel makes the valid point that the use C# Pointers, Unsafe and Unchecked keywords
break through the layer of abstraction upon which C# is built. I would emphasize that type of
programming is the exception to most C# development scenarios and not a fundamental part of
the language (as is the case with C/C++).
Garbage Collection
• Garbage Collection (GC) is the single most important factor in differentiating between these languages.
• While C and C++ can be used with GC, it is a bolted-on afterthought and cannot be made to work as well
(the best known is here) - it has to be "conservative" which means that it cannot collect all unused memory.
• C# is designed from the ground up to work on a GC platform, with standard libraries also designed that way.
It makes an absolutely fundamental difference to developer productivity that has to be experienced to be
believed.
• There is a belief widespread among C/C++ users that GC equates with "bad performance". But this is out-of-
date folklore (even the Boehm collector on C/C++ performs much better than most people expect it to). The
typical fear is of "long pauses" where the program stops so the GC can do some work. But in reality these
long pauses happen with non-GC programs, because they run on top of a virtual memory system, which
occasionally interrupts to move data between physical memory and disk.
• There is also widespread belief that GC can be replaced with shared_ptr, but it can't; the irony is that in a
multi-threaded program, shared_ptr is slower than a GC-based system.
• There are environments that are so frugal that GC isn't practical - but these are increasingly rare. Cell phones
typically have GC. The CLR's GC that C# typically runs on appears to be state-of-the-art.
• Since adopting C# about 18 months ago I've gone through several phases of pure performance tuning with a
profiler, and the GC is so efficient that it is practically invisible during the operation of the program.
• GC is not a panacea, it doesn't solve all programming problems, it only really cleans up memory allocation, if
you're allocating very large memory blocks then you will still need to take some care, and it is still possible to
have what amounts to a memory leak in a sufficiently complex program - and yet, the effect of GC on
productivity makes it a pretty close approximation to a panacea!
• Undefined Behavior
• C++ is founded on the notion of undefined behavior. That is, the language specification defines the outcome
of certain narrowly defined usages of language features, and describes all other usages as causing undefined
behavior, meaning in principle that the operation could have any outcome at all (in practice this means
hard-to-diagnose bugs involving apparently non-deterministic corruption of data).
• Almost everything about C++ touches on undefined behavior. Even very nice forthcoming features like
lambda expressions can easily be used as convenient way to corrupt the stack (capture a local by reference,
allow the lambda instance to outlive the local).
Complexity
• C# is founded on the principle that all possible operations should have defined behavior. The
worst that can happen is an exception is thrown. This completely changes the experience of
software construction.
• (There's unsafe mode, which has pointers and therefore undefined behavior, but that is strongly
discouraged for general use - think of it as analogous to embedded assembly language.)
• In terms of complexity, C++ has to be singled out, especially if we consider the very-soon-to-be
standardized new version. C++ does absolutely everything it can to make itself effective, short of
assuming GC, and as a result it has an awesome learning curve. The language designers excuse
much of this by saying "Those features are only for library authors, not ordinary users" - but to be
truly effective in any language, you need to build your code as reusable libraries. So you can't
escape.
• On the positive side, C++ is so complex, it's like a playground for nerds! I can assure you that you
would have a lot of fun learning how it all fits together. But I can't seriously recommend it as a
basis for productive new work (oh, the wasted years...) on mainstream platforms.
• C keeps the language simple (simple in the sense of "the compiler is easy to
write"), but this makes the coding techniques more arcane.
• Note that not all new language features equate with added complexity. Some
language features are described as "syntactic sugar", because they are
shorthand that the compiler expands for you. This is a good way to think of a
great deal of the enhancements to C# over recent years. The language
standard even specifies some features by giving the translation to longhand,
e.g. using statement expands into try/finally.
• At one point, it was possible to think of C++ templates in the same way. But
they've since become so powerful that they are now form the basis of a whole
separate dimension of the language, with its own enthusiastic user
communities and idioms.
Libraries
• The strangest thing about C and C++ is that they don't have a standard interchangeable form of pre-
compiled library. Integrating someone else's code into your project is always a little fiddly, with obscure
decisions to be made about how you'll be linking to it.
• Also, the standard library is extremely basic - C++ has a complete set of data structures and a way of
representing strings (std::string), but that's still minimal. Is there a standard way of finding a list of files in a
directory? Amazingly, no! Is there standard library support for parsing or generating XML? No. What about
accessing databases? Be serious! Writing a web site back-end? Are you crazy? etc.
• So you have to go hunting further afield. For XML, try Xerces. But does it use std::string to represent strings?
Of course not!
• And do all these third-party libraries have their own bizarre customs for naming classes and functions? The
situation in C# couldn't be more different; the fundamentals were in place from the start, so everything
inter-operates beautifully (and because the fundamentals are supplied by the CLR, there is cross-language
support).
• It's not all perfect; generics should have been in place from the start but wasn't, which does leave a visible
scar on some older libraries; but it is usually trivial to fix this externally. Also a number of popular libraries
are ported from Java, which isn't as good a fit as it first appears.
Closures (Anonymous Methods with Local
Variable Capture)
• Java and C are practically the last remaining mainstream languages to lack
closures, and libraries can be designed and used much more neatly with them
than without (this is one reason why ported Java libraries sometimes seem
clunky to a C# user).
• The amusing thing about C++ is that its standard library was designed as if
closures were available in the language (container
types, <algorithm>, <functional>). Then ten years went by, and now they're
finally being added! They will have a huge impact (although, as noted above,
they leak undefined behavior).
• C# and JavaScript are the most widely used languages in which closures are
"idiomatically established". (The major difference between those languages
being that C# is statically typed while JavaScript is dynamically typed).
For more understanding visit our c# program example
playlist in our channel SIRYMEDIA
Or
Click below links in description
Thank You
For more updates subscribe to our YouTube channel
SiryMedia
To watch more videos visit our website
www.sirymedia.in

More Related Content

What's hot

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
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++Abdul Hafeez
 
Introduction to c_language
Introduction to c_languageIntroduction to c_language
Introduction to c_languageWay2itech
 
C traps and pitfalls for C++ programmers
C traps and pitfalls for C++ programmersC traps and pitfalls for C++ programmers
C traps and pitfalls for C++ programmersRichard Thomson
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Geeks Anonymes
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languagesppd1961
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programmingavikdhupar
 
C# programming language
C# programming languageC# programming language
C# programming languageswarnapatil
 
C and C++ Industrial Training Jalandhar
C and C++ Industrial Training JalandharC and C++ Industrial Training Jalandhar
C and C++ Industrial Training JalandharDreamtech Labs
 

What's hot (20)

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
 
C vs c++
C vs c++C vs c++
C vs c++
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
Differences between c and c++
Differences between c and c++Differences between c and c++
Differences between c and c++
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
C vs c++
C vs c++C vs c++
C vs c++
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++
 
Introduction to c_language
Introduction to c_languageIntroduction to c_language
Introduction to c_language
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
C traps and pitfalls for C++ programmers
C traps and pitfalls for C++ programmersC traps and pitfalls for C++ programmers
C traps and pitfalls for C++ programmers
 
C presentation
C presentationC presentation
C presentation
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)Modern c++ (C++ 11/14)
Modern c++ (C++ 11/14)
 
Clanguage
ClanguageClanguage
Clanguage
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
C# programming language
C# programming languageC# programming language
C# programming language
 
C and C++ Industrial Training Jalandhar
C and C++ Industrial Training JalandharC and C++ Industrial Training Jalandhar
C and C++ Industrial Training Jalandhar
 

Viewers also liked

C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#sudipv
 
C# for C++ Programmers
C# for C++ ProgrammersC# for C++ Programmers
C# for C++ Programmersrussellgmorley
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#Sagar Pednekar
 
Discussing Fundamentals of C
Discussing Fundamentals of CDiscussing Fundamentals of C
Discussing Fundamentals of Ceducationfront
 
C and C ++ Training in Ambala ! BATRA COMPUTER CENTRE
C and C ++ Training in Ambala ! BATRA COMPUTER CENTREC and C ++ Training in Ambala ! BATRA COMPUTER CENTRE
C and C ++ Training in Ambala ! BATRA COMPUTER CENTREjatin batra
 
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 CENTREjatin batra
 
C# for C++ programmers
C# for C++ programmersC# for C++ programmers
C# for C++ programmersMark Whitaker
 
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREC & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREjatin batra
 
Intro to C++ Basic
Intro to C++ BasicIntro to C++ Basic
Intro to C++ BasicShih Chi Lin
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteachingeteaching
 
History of C/C++ Language
History of C/C++ LanguageHistory of C/C++ Language
History of C/C++ LanguageFarid Hilal
 
Overview of c++ language
Overview of c++ language   Overview of c++ language
Overview of c++ language samt7
 
Corrosion control
Corrosion controlCorrosion control
Corrosion controlZTE Nepal
 
A Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkA Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkZachary Blair
 
Статический и динамический полиморфизм в C++, Дмитрий Леванов
Статический и динамический полиморфизм в C++, Дмитрий ЛевановСтатический и динамический полиморфизм в C++, Дмитрий Леванов
Статический и динамический полиморфизм в C++, Дмитрий ЛевановYandex
 

Viewers also liked (20)

Ppt of c++ vs c#
Ppt of c++ vs c#Ppt of c++ vs c#
Ppt of c++ vs c#
 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#
 
C# for C++ Programmers
C# for C++ ProgrammersC# for C++ Programmers
C# for C++ Programmers
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
Discussing Fundamentals of C
Discussing Fundamentals of CDiscussing Fundamentals of C
Discussing Fundamentals of C
 
C and C ++ Training in Ambala ! BATRA COMPUTER CENTRE
C and C ++ Training in Ambala ! BATRA COMPUTER CENTREC and C ++ Training in Ambala ! BATRA COMPUTER CENTRE
C and C ++ Training in Ambala ! BATRA COMPUTER CENTRE
 
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
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
C# for C++ programmers
C# for C++ programmersC# for C++ programmers
C# for C++ programmers
 
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREC & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
 
Intro to C++ Basic
Intro to C++ BasicIntro to C++ Basic
Intro to C++ Basic
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteaching
 
History of C/C++ Language
History of C/C++ LanguageHistory of C/C++ Language
History of C/C++ Language
 
C# interview
C# interviewC# interview
C# interview
 
Overview of c++ language
Overview of c++ language   Overview of c++ language
Overview of c++ language
 
Corrosion control
Corrosion controlCorrosion control
Corrosion control
 
A Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkA Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application Framework
 
Smart Pointers
Smart PointersSmart Pointers
Smart Pointers
 
Статический и динамический полиморфизм в C++, Дмитрий Леванов
Статический и динамический полиморфизм в C++, Дмитрий ЛевановСтатический и динамический полиморфизм в C++, Дмитрий Леванов
Статический и динамический полиморфизм в C++, Дмитрий Леванов
 

Similar to difference between c c++ c#

Migrating From Cpp To C Sharp
Migrating From Cpp To C SharpMigrating From Cpp To C Sharp
Migrating From Cpp To C SharpGanesh Samarthyam
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Ganesh Samarthyam
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageGanesh Samarthyam
 
Difference between java and c#
Difference between java and c#Difference between java and c#
Difference between java and c#TECOS
 
20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptxSuman Garai
 
C# and java comparing programming languages
C# and java  comparing programming languagesC# and java  comparing programming languages
C# and java comparing programming languagesShishir Roy
 
Swift programming language
Swift programming languageSwift programming language
Swift programming languageNijo Job
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages mohamed drahem
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?Mindfire LLC
 
Consider the following interrupting system. The active-edge inputs o.pdf
Consider the following interrupting system. The active-edge inputs o.pdfConsider the following interrupting system. The active-edge inputs o.pdf
Consider the following interrupting system. The active-edge inputs o.pdffasttrackscardecors
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189Mahmoud Samir Fayed
 
C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.Richard Taylor
 
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
 
Programming Languages #devcon2013
Programming Languages #devcon2013Programming Languages #devcon2013
Programming Languages #devcon2013Iván Montes
 

Similar to difference between c c++ c# (20)

C c#
C c#C c#
C c#
 
Migrating From Cpp To C Sharp
Migrating From Cpp To C SharpMigrating From Cpp To C Sharp
Migrating From Cpp To C Sharp
 
Java
JavaJava
Java
 
ewili13_submission_14
ewili13_submission_14ewili13_submission_14
ewili13_submission_14
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
miniproject.pptx
miniproject.pptxminiproject.pptx
miniproject.pptx
 
Difference between java and c#
Difference between java and c#Difference between java and c#
Difference between java and c#
 
20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx20210417-cppRelevancy-DataStructures.pptx
20210417-cppRelevancy-DataStructures.pptx
 
Java for C++ programers
Java for C++ programersJava for C++ programers
Java for C++ programers
 
C# and java comparing programming languages
C# and java  comparing programming languagesC# and java  comparing programming languages
C# and java comparing programming languages
 
Swift programming language
Swift programming languageSwift programming language
Swift programming language
 
c# usage,applications and advantages
c# usage,applications and advantages c# usage,applications and advantages
c# usage,applications and advantages
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?
 
Consider the following interrupting system. The active-edge inputs o.pdf
Consider the following interrupting system. The active-edge inputs o.pdfConsider the following interrupting system. The active-edge inputs o.pdf
Consider the following interrupting system. The active-edge inputs o.pdf
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189
 
C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.C++ Restrictions for Game Programming.
C++ Restrictions for Game Programming.
 
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)
 
The importance of C#
The importance of C#The importance of C#
The importance of C#
 
Programming Languages #devcon2013
Programming Languages #devcon2013Programming Languages #devcon2013
Programming Languages #devcon2013
 

More from Sireesh K (20)

Cn10
Cn10Cn10
Cn10
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
What is mvc
What is mvcWhat is mvc
What is mvc
 
31c
31c31c
31c
 
31cs
31cs31cs
31cs
 
45c
45c45c
45c
 
44c
44c44c
44c
 
43c
43c43c
43c
 
42c
42c42c
42c
 
41c
41c41c
41c
 
40c
40c40c
40c
 
39c
39c39c
39c
 
38c
38c38c
38c
 
37c
37c37c
37c
 
35c
35c35c
35c
 
34c
34c34c
34c
 
33c
33c33c
33c
 
30c
30c30c
30c
 
29c
29c29c
29c
 

Recently uploaded

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 

Recently uploaded (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

difference between c c++ c#

  • 1. Difference between C, C++ ,C# (CSharp).net Brought to you by www.SiryMedia.in
  • 2. • C - an older programming language that is described as Hands-on. As the programmer you must tell the program to do everything. Also this language will let you do almost anything. It does not support object oriented code. Thus no classes. • C++ - an extension language per se of C. In C code ++ means increment 1. Thus C++ is better than C. It allows for highly controlled object oriented code. Once again a very hands on language that goes into MUCH detail. • C# - Full object oriented code resembling the style of C/C++ code. This is really closer to JAVA. C# is the latest version of the C style languages and is very good for developing web applications.
  • 3. • Both C and C++ give you a lower level of abstraction that, with increased complexity, provides a breadth of access to underlying machine functionality that are not necessarily exposed with other languages. C++ adds the convenience (reduced development time) of a fully object oriented language which can, potentially, add an additional performance cost. In terms of real world applications, I see these languages applied in the following domains: • C is a Kernel level software for Hardware device drivers with Applications where access to old, stable code is required. • C,C++ is a Application or Server development where memory management needs to be fine tuned (and can't be left to generic garbage collection solutions). • Development environments that require access to libraries that do not interface well with more modern managed languages. • Although managed C++ can be used to access the .NET framework, it is not a seamless transition.
  • 4. • C# provides a managed memory model that adds a higher level of abstraction again. This level of abstraction adds convenience and improves development times, but complicates access to lower level APIs and makes specialized performance requirements problematic. • It is certainly possible to implement extremely high performance software in a managed memory environment, but awareness of the implications is essential. • The syntax of C# is certainly less demanding (and error prone) than C/C++ and has, for the initiated programmer, a shallower learning curve. • C# is a Rapid client application development. With High performance Server development (Stack Overflow for example) that benefits from the .NET framework. • Applications that require the benefits of the .NET framework in the language it was designed for. • Johannes Rössel makes the valid point that the use C# Pointers, Unsafe and Unchecked keywords break through the layer of abstraction upon which C# is built. I would emphasize that type of programming is the exception to most C# development scenarios and not a fundamental part of the language (as is the case with C/C++).
  • 5. Garbage Collection • Garbage Collection (GC) is the single most important factor in differentiating between these languages. • While C and C++ can be used with GC, it is a bolted-on afterthought and cannot be made to work as well (the best known is here) - it has to be "conservative" which means that it cannot collect all unused memory. • C# is designed from the ground up to work on a GC platform, with standard libraries also designed that way. It makes an absolutely fundamental difference to developer productivity that has to be experienced to be believed. • There is a belief widespread among C/C++ users that GC equates with "bad performance". But this is out-of- date folklore (even the Boehm collector on C/C++ performs much better than most people expect it to). The typical fear is of "long pauses" where the program stops so the GC can do some work. But in reality these long pauses happen with non-GC programs, because they run on top of a virtual memory system, which occasionally interrupts to move data between physical memory and disk. • There is also widespread belief that GC can be replaced with shared_ptr, but it can't; the irony is that in a multi-threaded program, shared_ptr is slower than a GC-based system. • There are environments that are so frugal that GC isn't practical - but these are increasingly rare. Cell phones typically have GC. The CLR's GC that C# typically runs on appears to be state-of-the-art.
  • 6. • Since adopting C# about 18 months ago I've gone through several phases of pure performance tuning with a profiler, and the GC is so efficient that it is practically invisible during the operation of the program. • GC is not a panacea, it doesn't solve all programming problems, it only really cleans up memory allocation, if you're allocating very large memory blocks then you will still need to take some care, and it is still possible to have what amounts to a memory leak in a sufficiently complex program - and yet, the effect of GC on productivity makes it a pretty close approximation to a panacea! • Undefined Behavior • C++ is founded on the notion of undefined behavior. That is, the language specification defines the outcome of certain narrowly defined usages of language features, and describes all other usages as causing undefined behavior, meaning in principle that the operation could have any outcome at all (in practice this means hard-to-diagnose bugs involving apparently non-deterministic corruption of data). • Almost everything about C++ touches on undefined behavior. Even very nice forthcoming features like lambda expressions can easily be used as convenient way to corrupt the stack (capture a local by reference, allow the lambda instance to outlive the local).
  • 7. Complexity • C# is founded on the principle that all possible operations should have defined behavior. The worst that can happen is an exception is thrown. This completely changes the experience of software construction. • (There's unsafe mode, which has pointers and therefore undefined behavior, but that is strongly discouraged for general use - think of it as analogous to embedded assembly language.) • In terms of complexity, C++ has to be singled out, especially if we consider the very-soon-to-be standardized new version. C++ does absolutely everything it can to make itself effective, short of assuming GC, and as a result it has an awesome learning curve. The language designers excuse much of this by saying "Those features are only for library authors, not ordinary users" - but to be truly effective in any language, you need to build your code as reusable libraries. So you can't escape. • On the positive side, C++ is so complex, it's like a playground for nerds! I can assure you that you would have a lot of fun learning how it all fits together. But I can't seriously recommend it as a basis for productive new work (oh, the wasted years...) on mainstream platforms.
  • 8. • C keeps the language simple (simple in the sense of "the compiler is easy to write"), but this makes the coding techniques more arcane. • Note that not all new language features equate with added complexity. Some language features are described as "syntactic sugar", because they are shorthand that the compiler expands for you. This is a good way to think of a great deal of the enhancements to C# over recent years. The language standard even specifies some features by giving the translation to longhand, e.g. using statement expands into try/finally. • At one point, it was possible to think of C++ templates in the same way. But they've since become so powerful that they are now form the basis of a whole separate dimension of the language, with its own enthusiastic user communities and idioms.
  • 9. Libraries • The strangest thing about C and C++ is that they don't have a standard interchangeable form of pre- compiled library. Integrating someone else's code into your project is always a little fiddly, with obscure decisions to be made about how you'll be linking to it. • Also, the standard library is extremely basic - C++ has a complete set of data structures and a way of representing strings (std::string), but that's still minimal. Is there a standard way of finding a list of files in a directory? Amazingly, no! Is there standard library support for parsing or generating XML? No. What about accessing databases? Be serious! Writing a web site back-end? Are you crazy? etc. • So you have to go hunting further afield. For XML, try Xerces. But does it use std::string to represent strings? Of course not! • And do all these third-party libraries have their own bizarre customs for naming classes and functions? The situation in C# couldn't be more different; the fundamentals were in place from the start, so everything inter-operates beautifully (and because the fundamentals are supplied by the CLR, there is cross-language support). • It's not all perfect; generics should have been in place from the start but wasn't, which does leave a visible scar on some older libraries; but it is usually trivial to fix this externally. Also a number of popular libraries are ported from Java, which isn't as good a fit as it first appears.
  • 10. Closures (Anonymous Methods with Local Variable Capture) • Java and C are practically the last remaining mainstream languages to lack closures, and libraries can be designed and used much more neatly with them than without (this is one reason why ported Java libraries sometimes seem clunky to a C# user). • The amusing thing about C++ is that its standard library was designed as if closures were available in the language (container types, <algorithm>, <functional>). Then ten years went by, and now they're finally being added! They will have a huge impact (although, as noted above, they leak undefined behavior). • C# and JavaScript are the most widely used languages in which closures are "idiomatically established". (The major difference between those languages being that C# is statically typed while JavaScript is dynamically typed).
  • 11. For more understanding visit our c# program example playlist in our channel SIRYMEDIA Or Click below links in description
  • 12. Thank You For more updates subscribe to our YouTube channel SiryMedia To watch more videos visit our website www.sirymedia.in