Site hosted by Angelfire.com: Build your free website today!

Chapter 4             DEVELOPMENT TOOLS

 

 

 

4.0       Introduction

 

4.1       Comparison of C, C++, and Java programming languages

 

4.2       Microsoft Visual C++ 6.0 (Microsoft Foundation Class)

 

4.3       Features and Advantages of C++

4.3.1 Object-Oriented Programming (OOP)

4.3.2 Benefits of Object-Oriented Programming

4.3.3 C++ Standard Libraries

4.3.4 Named Constants

4.3.5 Enumerated Constants

 

4.4       Summary

 

 

CHAPTER 4 – DEVELOPMENT TOOLS

 

4.0 Introduction

 

To develop this system, the author must select the most appropriate programming language that suits him. The author must have sufficient knowledge and able to create system by using that language. So, before the author makes his decision, he has selected a few programming language that might be used. The languages that were most likely to be used are C, Microsoft Visual C++ (MFC), and Java.

 

4.1 Comparison of C, C++ and Java programming languages

           

            (Please refer Table 1 in Appendix D1)

 

The table shows the comparison of three programming languages (C, C++, and Java). Those were the comparison the author is able to give to date when he done the research earlier.

 

Java cannot directly control hardware; Java programs must declare native methods and implement such operations in another language. C was not, and can easily be used to make impenetrable code. C (and hence C++ and Java) includes a great deal of terse notation, which reduces readability (e.g. the “for” loop notation, using “&&” instead of “and”, and operators such as “<<”). Object-oriented features in C++ are likely to improve maintainability (because they force interfaces to be defined and used). Java's document comments (//*) and standard documentation conventions aid in readability. Note that “readability” of a programming language is extremely subjective as well-structured programs can be read and maintained in any language by someone who knows the language, and no language can prevent all poor approaches. At issue in this requirement is how strongly the language encourages readable and maintainable code.

 

C++ implicit conversion operations may be activated in situations not easily recognizable by its users. C/C++ pointer arithmetic and aliasing prohibit some optimizations. Java's garbage collection raises questions about efficiency and guaranteed timing, especially in real-time systems. C/C++ pre-processor can be used to create some (obscure) syntactic forms. A pre-processor (such as .cpp or m4) can be used with any language, including Java, but neither includes a pre-processor in their definition. Note that C, C++, and Java identifiers are case-sensitive. In C, C++, and Java the exponentiation operator is pow(), not the usual infix operator, and the built-in operation only takes arguments of type double (not int). C provides an absolute value function for int but not double. C, C++, and Java don't support fixed-point numbers. C++ and Java classes could be used to build fixed-point functionality. C and C++ permit implicit truncation in integer computations.

 

C, C++, and Java array indexes may only start at zero and cannot use enumerations to define array subscripts. In C enumerations may be used to access array elements. In C++ enumerations can be cast into int's to access array values, while Java has no enumeration types. C, C++, and Java specifications do not require all literals to be evaluated at compile time, but compilers typically do so.

 

After doing so thorough research and going through many literatures, the author has made his decision to choose C++ by Microsoft to develop his system, using Microsoft Foundation Class (MFC Programming).

 

 

4.2     Microsoft Visual C++ 6.0 (Microsoft Foundation Class)

                (Adapted from http://www.s-direktnet.de/homepages/neumann/langcomp.en.html)

 

C++ is a highly structured, object-oriented computer programming language. It allows programs to be built out of small, easy to understand pieces of code. It incorporates all the best aspects of structured programming. Besides, C++ also includes concepts such as structures and classes. This is called object-oriented programming, classes create the objects. An object gathers information that belongs together, and functions that work on those items of information. Many of the programmers preferred using object oriented programming because of it is more structured and thus provide easy maintainability.

 

Microsoft introduced Microsoft Foundation Class (MFC) library. The MFC is an extraordinary package of prewritten, ready-to-use code. Besides, Visual C++ also introduced many programming tools such as the menu editor for designing the menus, the dialog editor for designing the dialog boxes, etc. Files that are needed by a windows program will be organized into projects. The author will use this software to design and code the interface. By default the MFC will provide resource file for all the dialog boxes, string tables, icon, toolbars and other interface which required in a system.

 

(Please refer to a table of new and updated MFC Classes in Appendix D2).

 

 

 

 

 

 

 

 

 

4.3     Features and Advantages of C++

 

 

4.3.1      Object-Oriented Programming (OOP)

 

The primary goal of OOP is to make working software objects as easy and productive as an engineer working with physical components.

 

C++ fully supports OOP, including the four pillars of OO development, they are: encapsulation, data hiding, inheritance, and polymorphism.

 

·        Encapsulation means the property of being a self-contained unit. By using the encapsulation, it will make the class more reliable, self-reliant, and reusable. Software developer can accomplish data hiding with encapsulation.

 

·        Data hiding is a highly-valued characteristic that an object can be used without the user knowing or caring how it works internally. C++ supports the idea of reuse through inheritance.

 

·        A new type, which is an extension of an existing type, can be declared. This new subclass is said to derive from the existing and is sometimes called a derived type. By using the inheritance to create families of classes, it can exploit the advantages offered by polymorphism. “Is a” relationship is allowed by the inheritance which will make the families of classes possible.

 

·        C++ supports the idea that different objects do “the right thing” through what is called function polymorphism and class polymorphism. Poly means many, and morph means form. Polymorphism refers to the same name taking many forms.

 

Data and procedures are attached to an object within the OOP language. For example, the class data type is used to create objects.

 

 

 

 

 

 

 

 

 

 

 

 

4.3.2      Benefits and drawbacks of Object-Oriented Programming

 

There are a lot of benefit can be gained from the object-oriented programming.  The author listed three main benefits below.

 

(a)         Reusability

 

By applying OOP concept, one can easily create an object for the first time and later reused it in other class or different program.  This will save a lot of time of redundant work.

 

(b)        Reliability

 

OOP applications are far more reliable because they incorporate standard tested components.  One can use it without many worries. Developer just has to write less new codes for each application.  Besides, the standard libraries also provide the routines that are used extensively.

 

(c)         Continuity

 

OOP software applications written in C++ are compatible with existing C programs. As a result, an experienced C programmer just needed to take a short period of time to learn the object-oriented principles of C++.

 

However, there are some drawbacks to OOP, however. If a class is modified, all code depending on that class must be retested and potentially modified to support the changes. Also, if documentation is not diligently maintained, it can be difficult to determine what code uses a parent class (code that is inherited). If one discovers a bug late in development, it could potentially affect a large portion of the application.

 

4.3.3      C++ Standard Libraries

 

Another feature of the C++ is the standard libraries. The C++ standard libraries have numerous classes and functions. The author not only need to know how to use the language syntax to develop C++ program but also need to know how to incorporate the best features of the libraries into the programs. By using inheritance, developers can customize and expand existing libraries for their programs.

 

 

 

 

 

4.3.4      Named Constants

 

C++ used the const qualifier to define a name constant. The constant may appear anywhere that a compiler time integer constant expression is required. Unlike in C programming language, it needed to use the #define. In general, it’s best to use const rather than #define in C++. This is because the developer can limit the scope of a const-qualified object. However, the #define can’t help to limit the scope. Qualifying an object’s declaration with const is a promise that its value will not be altered during the program’s execution. The purpose of this is to encourage the compiler to use storage format, which is more suited to constants.

 

 

4.3.5      Enumerated Constants

 

Enumerated constants are widely used in C++. This is because they provide straightforward documentation and implicit range checking on constants. If the programmer consistently uses the constant names, he or she can declare them without a tag. If the programmer wishes to create an enumerated type, the programmer needs to declare them with a tag name.

 

(Please refer to Appendix G3 article for more feature of C++ over C language).

 

 

4.4           Summary

 

After compared the three languages, the author noticed that C++ is really powerful language to support this type of multimedia application as it provides hardware control. Even though Java also support in playing wave file, one needs to download java sound bank or java media framework in order to create such system. In recent version of Java (probably jdk1.4.1), it supports playing more media files than only able to play .au file in earlier time. On the other hand, one needs not worried that c++ need to download any plugin to support such application development. C++ can retrieve information from the soundcard and transform the data from it.

Home   Chapter 1 Chapter 2 Chapter 3   Chapter 4