Language Bar

Wednesday, February 2, 2011

CS201 GDB SOLUTION


Total Marks 5
Starting Date Wednesday, February 02, 2011
Closing Date Thursday, February 03, 2011
Status Open
Question/Description

TOPIC: You have learnt all the important concepts related to programming in C++ in this course. C++ is used for System (Embedded Programming) at a large scale although there are other languages as well available for this purpose. Here you are required to give your 5 -7 strong arguments in the favor or against this statement that C++ is good for Embedded programming or not. A concise, coherent and to the point comment is preferred over lengthy comment having irrelevant details. Your comment must not be more than 5-7 lines. Comments, posted on regular Lesson's MDB or sent through email will NOT be considered. Any request about such an acceptance will not be catered. Best of Luck


------------------------------------------------------------------------------------------------------
Solution



Just an Idea
CS 201 GDB solution by orial

C++ is not perfect

* · It does not natively support concurrency
* · Little problem tuning time-critical code, such as interrupt handlers
* · It does not provide a mechanism to deal with to interrupts etc.
* · Lack of good standard library for embedded systems. As STL simply sucks.
* · Its handling of array boundaries is poor
* · Typical C++ code tends to be a bit larger and slower
* · It has no clear, non-implementation dependent mechanism for dealing with bit-mapped registers (I don't count masking and shifting as clear).
* · C++ over-flexibility, which makes the less experience shoot him in the foot.
* The added expense is rarely prohibitive (on the order of 10-15%).


---------------------------------------------------------------------------------------

By Sakina sabir
solution of GDB cs 201
Advantages
1. Can portably make native executables for a large amount of systems that don't have any dependencies on a runtime.

2. Can natively use libraries written in C/C++ without a language translation layer (important for a large class of problems that only have C libraries)

3. Code usually runs faster (lots of caveats here)

4. Can be used to implement system pieces (Kernels, etc.)

5. Complete control over how memory and other resources are allocated and released

Disadvantages
1.it does not natively support concurrency
2. it does not provide a mechanism to deal with to interrupts etc.
3. Very complex code can get bogged down doing things that other languages take care of


4. Need to implement how resources are allocated and released


5. it has no clear, non-implementation dependent mechanism for dealing with bit-mapped registers (I don't count masking and shifting as clear).



-----------------------------------------------------------------------------------------------

Strong arguments in the favor that C++ is notgood for Embedded programming

1)      it does not natively support concurrency
2) it does not provide a mechanism to deal with to interrupts etc.
3) its type safety is poor
4) its handling of array boundaries is poor
5) it has no clear, non-implementation dependent mechanism for dealing with bit-mapped registers


 -----------------------------------------------------------------------------------------------


C++ has certain characteristics over other programming languages. The most remarkable are:
Object-oriented programming
The possibility to orientate programming to objects allows the programmer to design applications from a point of view more like a communication between objects rather than on a structured sequence of code. In addition it allows a greater reusability of code in a more logical and productive way.
Portability
You can practically compile the same C++ code in almost any type of computer and operating system without making any changes. C++ is the most used and ported programming language in the world.
Brevity
Code written in C++ is very short in comparison with other languages, since the use of special characters is preferred to key words, saving some effort to the programmer (and prolonging the life of our keyboards!).
Modular programming
An application's body in C++ can be made up of several source code files that are compiled separately and then linked together. Saving time since it is not necessary to recompile the complete application when making a single change but only the file that contains it. In addition, this characteristic allows to link C++ code with code produced in other languages, such as Assembler or C.
C Compatibility
C++ is backwards compatible with the C language. Any code written in C can easily be included in a C++ program without making any change.
Speed

The resulting code from a C++ compilation is very efficient, due indeed to its duality as high-level and low-level language and to the reduced size of the language itself. 


     

No comments:

Post a Comment

CONTACT US FORM