Sei sulla pagina 1di 9

Introduction:

In the early days of computers, the only programming languages available to programmers were two low level languages: machine and assembly language. Programming in these languages was tedious and time-consuming because the programmer had manage the hardware itself (memory, stack, interrupts, etc).. When computers became increasingly available, many high level languages such as Fortran, Pascal, and Basic developed in order to make the underlying hardware invisible to the programmer and to make syntax easier; therefore making computers easier and faster to program. In 1972, the Unix Operating system was being developed. During this time, the concept of a system programming language having attributes of both low level and high level languages also developed. System

programming languages have advantages of a high level language but allow the programmer to take control of the underlying hardware if desired. Brian W. Kernigahn and Dennis M. Ritchie developed C at Bell Laboratories as a system programming language. Their underlying goal was to develop a language that was simple and flexible enough to be used in a variety of different processors. (Two early versions were named A and B.) In 1983, the American National Standards Institute formed a committee to produce a C programming language standard. This "ANSI C" was completed in 1988. Throughout its history, C has been closely associated with the UNIX operating system, with system programming in general, and with the challenge of writing "portable" code that can be easily transferred to anyone of many target computers.

Disadvantages & Overcome in C Language:


1. There is no Run Time Checking.
Meaning: Runtime checking is a mechanism of a programming language to check for errors at runtime, e.g. arithmetic overflows or invalid type casts. Most times an exception is thrown and/or the program is terminated, instead of ignoring this failure as it is done in C, C++ etc. Overcome: There is no Run-Time Checking , here a suggestion to overcome this the compiler should have the following characters 1) Error detection & recovery Mechanism 2) Trace Mode Passing and For Parser debugging mechanisms

2. There is no Strict Type Checking.


Overcome: To enable STRICT type checking, define the symbol name "STRICT." Open the Project Settings dialog box, select the C/C++ tab, select General in the Categories box, and type STRICT in the Preprocessor Definitions box. You can also specify this definition on the command line or in a make file by giving /DSTRICT as a compiler option. To define STRICT on a file-by-file basis (supported by C but not C++, as explained in the note that follows), insert a #define statement before including WINDOWS.H in files where you want to enable STRICT.

3. Its main drawback is that it has Poor Error Detection


Over come: Para soft Insure++ is an automated runtime application testing tool that detects elusive errors such as memory corruption, memory leaks, memory allocation errors, variable initialization errors, variable definition conflicts, pointer errors, library errors, I/O errors, and logic errors E g. Memory Corruption This is one of the most unpleasant errors that can occur, especially if it is well disguised. As an example of what can happen, consider the program shown below. This program concatenates the arguments given on the command line and prints the resulting string.

4. If sufficient memory is not available during runtime for the


storage of pointers the program may crash .
Overcome: Memory allocation is a problem for Pointer in C , to avoid this we can use a Bank Switched mechanism to enlarge the physical memory space.

Bank switching

is a technique to increase the amount of

usable memory beyond the amount directly addressable by the processor. It can be used to configure a system differently at different times; for example, a ROM required to start a system from diskette could be switched out when no longer needed. Many modern microcontrollers and microprocessors use bank switching to manage random-access memory, non-volatile memory, input-

output devices and system management registers in small embedded systems. The technique was common in 8-bit microcomputer systems. Bank-switching may also be used to work around limitations in address bus width, where some hardware constraint prevents straight forward addition of more address lines.

5. C compilers are not able to check variable types on memory pointed


to by pointers, so erroneous pointer math can point to invalid values that the compiler cannot check. It can lead to access violation in protected OS.
Overcome: The program is compiled and linked as usual, but instead of executing it directly on the hardware, it is run in a virtual machine, which emulates the program and monitors it.

6. In C, the global version of a variable cannot be accessed with a


inner block.
A Global

variable is a variable that is accessible in every

scope ( is an enclosing context where values and expressions are associated). The use of global variables makes software harder to read and understand. Since any code anywhere in the program can change the value of the variable at any time, understanding the use of the variable may entail understanding a large portion of the program. Overcome: The global variable can be accessed by using a . Square resolution operator.

Meaning:

Scope resolution operator allows a program to reference an


identifier in the global scope that is hidden by another identifier with the same name in the local scope.

7. It didnt have the Feature Renaming Facility, like Eiffel and


Ruby. Meaning: Feature renaming is the ability for a class or object to rename one
of its features (a term we'll use to collectively refer to attributes and methods) that it inherited from a super class. There are two important ways in which this can be put to use:
y y

Provide a feature with a more natural name for its new context Resolve naming ambiguities when a name is inherited from multiple inheritance paths

As an example of the first use, consider again a stack implemented by inheriting from an array. The array might provide an operation called remove_last to remove the last element of the array. In the stack, this operation is more appropriately named pop. E g. Eiffel and Ruby both provide support for feature renaming. Ruby provides an alias method that allows you to alias any arbitrary method. Eiffel also provides support for feature renaming, although it is slightly more limited than in Ruby because you can only rename a feature in an inheritance clause.

8. It doesnt have the concept of Constructors and Destructors.


Meanings: A constructor looks like a special method having no return type and its name is same with the class name. If we do not declare constructor explicitly for a class, compiler will create a default constructor at run time.

Destructors are used to destruct instances of classes. Following are features of


destructor:
y y y y

A class can have one destructor only. Destructors cannot be inherited or overloaded. Destructors are invoked automatically. Destructor cannot have modifiers or parameters.

9. The main thing in c++ is data hiding which can't be done in C.


Meaning: Data hiding is a characteristic of object-oriented programming. Because an object can only be associated with data in predefined classes or templates, the object can only "know" about the data it needs to know about. There is no possibility that someone maintaining the code may inadvertently point to or otherwise access the wrong data unintentionally. Thus, all data not required by an object can be said to be "hidden."

10. It does not have OOPS feature thats why C++ developed.
Object-oriented programming (OOP) is a programming
paradigm using "objects" data structures consisting of data fields and methods together with their interactions to design applications and computer programs. Programming techniques may include features such

as data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance.

11. There is no operation and function overloading in C.


Operator overloading is a specific case of polymorphism ,where different operators have different implementations depending on their arguments. Operator overloading is generally defined by the language, the programmer, or both. Operator overloading is claimed to be useful because it allows the developer to program using notation "closer to the target domain" and allows userdefined types a similar level of syntactic support as types built into the language. It can easily be emulated using function calls; For an example, consider the integers a, b, c: a+b*c In a language that supports operator overloading, and assuming the '*' operator has higher precedence than '+', this is effectively a more concise way of writing: add (a, multiply (b, c)).

12. Higher Order Function facility not available in C, like Python


and Pearl

13. Consistency and intrinsic quality make C somewhat unsuitable


for programming mission-critical applications, especially those in which user safety is an issue.

14. The Pointers in C are highly insecure, makes it vulnerable.

15. It doesnt support inheritance, makes it more complex to use


because everything has to be written from scratch

16. C doesnt provide efficient means for Garbage Collection.


Garbage collection (GC) is a form of automatic memory management.

17. C compiler cannot handle floating point and fixed-point values


properly when compared to C++ compiler.

18. The only drawback of pointer in C maybe that if used carelessly,


you can access and overwrite some critical memory.

Potrebbero piacerti anche