What is the difference between c and c++ and advantages and disadvantages of c and c++
The C programming language is a general-purpose, high-level language (generally denoted as structured language). C programming language was at first developed by Dennis M. Ritchie at At&T Bell Labs.
C is one of the most commonly used programming languages. It is simple and efficient therefore it become best among all. It is used in all extents of application, mainly in the software development.
Many software's & applications as well as the compilers for other programming languages are written in C also Operating Systems like Unix, DOS and Windows are written in C.
C has many powers, it is simple, stretchy and portable, and it can control System Hardware easily. It is also one of the few languages to have an international standard, ANSI C.
Advantages of C:-
- Fast, Powerful & efficient
- Easy to learn.
- It is portable
- ''Mid-level'' Language
- Widely accepted language
- Supports modular programming style
- Useful for all applications
- C is the native language of UNIX
- Easy to connect with system devices/assembly routines
Intro to c++:-
C++ is a general-purpose, case-sensitive, free-form programming language that supports procedural, object-oriented, and generic programming.
C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features.
C++ was developed by Bjarne Stroustrup of AT&T Bell Laboratories in the early 1980's, and is based on the C language. The "++" is a syntactic construct used in C (to increment a variable), and C++ is intended as an incremental improvement of C. Most of C is a subset of C++, so that most C programs can be compiled (i.e. converted into a series of low-level instructions that the computer can execute directly) using a C++ compiler.
C++ is a superset of C, and that virtually any legal C program is a legal C++ program.
Object-Oriented Programming
C++ fully supports object-oriented programming, including the four pillars of object-oriented development:
- Encapsulation
- Data hiding
- Inheritance
- Polymorphism
Use of C++
- C++ is used by hundreds of thousands of programmers in essentially every application domain.
- In Adobe Systems All major applications are developed in C++: Photoshop & ImageReady, Illustrator, Acrobat, InDesign, GoLive
- C++ is widely used for teaching and research because it is clean enough for successful teaching of basic concepts.
- Anyone who has used either an Apple Macintosh or a PC running Windows has indirectly used C++ because the primary user interfaces of these systems are written in C++.
- Amazon.com, Facebook, Google, HP, IBM, Microsoft, Mozilla, Nokia & many more companies uses C++ language.
Advantages & Disadvantages
Advantages
1. vendor-neutral: the C++ standard is the same in any platform or compiler
2. industrial (as opposed to academic): evolved to satisfy the needs of software engineers, not computer scientists
3. efficient. Compiles into highly optimized CPU-specific machine code with little or no runtime overhead.
4. multi-paradigm: allows the use and penalty-free mixing of procedural, OOP, generic programming, functional programming, etc
5. strictly statically typed (unlike Python for example): a large amount of logic (and sometimes even calculations) can be proved and performed at compile time, by the type checking/inferring system.
6. has deterministic memory management (as opposed to Java, C#, and other languages with garbage collectors): the life time of every object is known with absolute precision, which makes destructors useful and RAII possible.
Disadvantages
1. very complex! The learning curve is steep and takes a long time to climb, especially for those who know C or C# or other superficially similar languages
2. has the concept of "undefined behavior" (just like C) -- a large class of errors that neither compiler nor the runtime system is required to diagnose.
3. has some design flaws, although they are largely fixed by boost libraries and the new language standard.
4. lacks network and async I/O, graphics, concurrency, serialization, and many other facilities expected of modern languages, although that is also largely fixed by boost libraries and (as far as concurrency is concerned) the new language standard.
Comments
Post a Comment