Title: Programming Language Evaluation
1Programming Language Evaluation
- C Programming
- Saleena V.E.O Abdul Kader
- WGA 040013
2Introduction
- Who designed it?
- Bjarne Stroustrup at Bell Labs( 1983)
- Originally known as C with Classes
- Adopt C, taken from the origin of C and ,
from the operator used in language. - Cfront was a traditional compiler that did
complete syntax and semantic checking of the C
source - Why?
- Sole purpose of making the process or writing
good programs easier and pleasant for individual
programmer
3Programming Paradigm
- The style that affects the way the programmers
may design and organize the programs written in
C. - C offers multiparadigm programming.
- Procedural Programming
- Object-Oriented Programming
- Free Form
- Generic Programming
- Statically Typed
4Features
- Operators Preprocessor Directives
- include as the preprocessor directives
- .h files as the header files used in the
program, serves to simplify the functions called
within the program. - Templates
- functions that can be used and called several
times. - Polymorphism
5Features
- Abstractions
- Encapsulation
- allowing all members of a class to be declared as
either public, private, or protected. - A public member of the class will be accessible
to any function. - A private member will only be accessible to
functions that are members of that class and to
functions and classes explicitly granted access
permission by the class ("friends"). - A protected member will be accessible to members
of classes that inherit from the class in
addition to the class itself and any friends. - Inheritance
- Inheritance from a base class may be declared as
public, protected, or private
6Major Application Area Implementing C
- iPod user interface ( using Pixo application
framework written in C) - AT T largest US telecommunications provider
1800 service, provisioning systems and systems
for rapid network recovery after failure - Adobe Systems
- Visual Studios
- Google
- IBM OS/400,K42.
- Bloomberg assist investors with real-time
financial information - Intel Vtune performance analysis software,
compilers optimizers
7Claims Made Supporting the Language
- Security
- Allow unsafe code
- To access hardware directly
- To achieve optimal run-time space performance
- To be compatible with C
- Using the standard library
- for example, using stdvector or stdstring
instead of a C-style array--can help lead to
safer and more scalable software. - Portability
- defines many new keywords,
- such as new and class, that may be used as
identifiers (e.g. variable names) in a C program. - Even though the latest C standard does not
require a "return 0" in main, some older
compilers such as Microsoft Visual C 6 give
warnings or errors for a main without a return
statement and may not generate correct object
code. - designed to be as compatible with C as possible,
therefore providing a smooth transition from C - avoids features that are platform specific or not
general purpose - designed to function without a sophisticated
programming environment
8- Efficiency
- reduced programming errors through abstraction
and simplification of interfaces, while
maintaining the levels of efficiency that C
programmers have come to expect both from the
language and its libraries. - Use of standard library / specific library
functions, access of library through the headers,
compared to C, C have only 69 standard header,
where 19 are depreciated. - In terms of memory, C can allocate arbitrary
blocks of memory - Extensibility/Maintainability
- Use of modularity properties enable ease of
maintaining the program, such as classes, files
etc. - Enables information sharing through FRIENDS of
classes
9Compiler Model
10Description of Language ( as used in the
prototype)
// the declaration of variable type used in
getStudentDetails function string fName
string Lname int ID int noOfCourses char
paid bool isFeePaid string cName string
cNo int credits int count int i
courseType courses6 char cGrades6
11- Structured Objects use of arrays records
courseType courses6 char cGrades6
for(count0countltnumberOfStudentscount)
infilegtgtfNamegtgtlNamegtgtIDgtgtisPaid
if(isPaid"Y") isFeesPaidtrue else isFeesPai
dfalse infilegtgtnoOfCourses for(
i0iltnoOfCoursesi) infilegtgtcNamegtgtCnogtgt
creditsgtcgradesi coursesi.setCourseInfo(c
Name,cNo,credits) studentList(count.setIn
fo(fName,LName,ID,noOfCourse,isFeesPaid, cour
ses,cGrades)
12- A string data type was composed from series of
character. - Main purpose is to do the following-
- - Concatenation, the operation of joining two
character strings to make one long string - - Relational operations on string
- - Substring selection using positioning
subscripts - - Input-output formatting
- - Substring selection using pattern matching
- - Dynamic string
13 Abstract Data Types
- allowing the user to encapsulate both data and
actions into a single object - Inheritance is an important feature of classes
14 Active Objects
- Its a special method, called as the body, most
of the time would be defined in the similar way
as the constructor/destructor that runs on a
thread attach to the object. - This body can decide when a method may be called
(by means of an accept statement) by the main,
processes or the other object bodies. - However, the active objects are not being used in
the prototype due to the reason that the
simplicity of the prototype does not require one.
15Design Mistakes and Problems
- Implementation-specific Issues
- The C standard does not cover implementation of
name decoration, exception handling, and other
implementation-specific features, making object
code produced by different compilers incompatible
beta compiler of Borland C Builder X was also
released with export function. - Portability Issues
- Static constructors
- Do not use C Standard Library features,
including the iostream. - Do not use namespace facility.
16Suggestions
- To learn C better, you will need
- a good book
- a good compiler and
- a development environment.
- Visual Basic which is very much improved as the
Visual Net version and can match C and other
languages by now. - Often compared to single-paradigm object-oriented
languages such as Java, on the basis that it
allows programmers to "mix and match"
object-oriented and procedural programming,
rather than strictly enforcing a single paradigm
17References
- Pra01 Pratt, T. W. and M. V. Zelkowitz (2001).
Programming Languages Design and Implementation,
Prentice Hall. - Gar05 Gardos, A. (2005). "New functions
GetShapeFill, ChangeShapeFill, ChangeProperties."
- from http//avax.invisionzone.com/index.ph
p?showtopic30. - Han01 Handford, F. J. (2001). "C tutorial
chapter 2, variables." from http//www.eastcoastga
mes.com/cpp/chapter2.html. - http//en.wikipedia.org/wiki/Visual_C_Plus_Plus
- http//en.wikipedia.org/wiki/The_Design_and_Evolut
ion_of_C2B2B
18Evaluation Results
- The evaluations are made based on my experience (
not that experienced though) and also by
comparison to other languages such as C and Java. - do you have any basis to agree or disagree with
any claims made of its security, portability,
efficiency, extensibility/maintainability? - In terms of security, even though C provide
flexible declarations compared to C , C may
need to be improved in the use of export
functions. For some compiler, export functions
may not work, and hence, even MS Visual C also
do not support this. - C are not quite portable in the sense that, it
depends mostly on WHICH COMPILER being used.
Compared to the older version of C, the header
files are accompanied by .h, but the newer
versions do not require one. - It is efficient in terms of memory management and
it is also easier to maintain since it practice
modularity in the program. - what aspect of this language did you find most
difficult to learn/understand? - The coding in which some conventions may not
comply to the standards given. - The compilation process especially when it comes
to using different compiler. - how would you rate the programming environment?
compiler/interpreter messages? - Each different compiler represents different
style of accepting the preprocessor directives,
and therefore, with C, regardless of Visual C
or Turbo C( or any C program type),
highlighted the error and pinpoint respective
message with definition of which error occurring.
Therefore, I find this to be beneficial, instead
of trying to figure out what went wrong with the
codes.
19Evaluation Results
- would you use this language again and if so what
for? if not, what would you choose to use instead
and why? - I would choose this language in the future but
for the purpose as the background to learn and
understand other C compiler implementation. - However, I would not limits myself to learn new
language implementation when the need arises,
especially the languages that provides the ease
of use with GUI properties. - design mistakes (in your opinion or the opinion
of others)? Have they been corrected in other
languages that were a follow-on. What if anything
is missing in your opinion? - Newer languages are created so that it may
complement the characteristics that are not quite
adequate in the older version. Therefore, from my
opinion, any features that are not readily
available in the current C programming
languages used may be corrected in other
languages. Even though some might not be as
powerful as C, however, it serves as the basics
to implement the object-oriented properties.
20The end.