Friday, May 21, 2010

Is 'C' language a high level language or Middle level language ??

'C' is a middle level language. This does not mean that 'C' is less powerful, harder to use or less developed than high level languages like BASIC or Pascal nor its like that 'C' has the cumbersome nature of assembly language and its associated troubles. Rather, it is considered middle level language because it combines the best elements of high-level languages with the control and flexibility of assembly language.





As a middle level language, some features of 'C':


'C' allows manipulation of bits, bytes and addresses.


'C' is portable.


'C' supports some basic data-types like int, char, float, double,etc


'C' permits type-conversions.


'C' performs almost no run-time errors.


'C' does not demand strict compatibility between a parameter and an argument.


'C' has only a set of 32 keywords.

Is 'C' language a high level language or Middle level language ??
Middle level, the "Height" of a language represents how abstracted the language is from what the computer actually does. For example, a high level language might say something like:





SELECT * FROM PEOPLE WHERE AGE %26gt; 50





These (SQL) instructions cause a massive host of different things to happen on the computer, it essentially does a search through a database and builds a set of results for whatever program exectuted the SQL. The point is that the language doesn't show any of that, you just say "Get me this" and leave it up to the system to figure out how to do it.





In a lower level language an equivalent might be:





for (int i=0; i%26lt;numPeople; i++)


{


Person *p=%26amp;people[i];


if (p-%26gt;Age%26gt;50)


{


AddToResultSet(p);


}


}





As you can (hopefully ;) ) see, the psuedo C above goes through an array of data structures checking the age field in the structures and adding the data from those structures that meet the given condition (age is over 50) to a result set somehow. This code, when executed, represents fairly literally what the computer will be doing and how it does it, there is very little abstraction.





I hope that makes sense, it turned out to be harder to explain than I thought it would...
Reply:It's actually both. C has many elements of a fully functioning high level programming language, but it can be scaled down to run on a middle or even embedded level.
Reply:the C language is the most powerful programming language, u can write an assembly code within a C program, u can access any hardware component with C, so C is considered a high level-low level language.
Reply:its a middle level language


No comments:

Post a Comment