**2.3.1.3 Language issues**

Modern languages for real-time imaging must provide an easy interface to hardware devices and provide a framework for maintainability, portability and reliability, among many other features. Many programming languages are commonly used to implement Real-Time Colour Imaging Systems, including C, C++, C#, Java, Visual Basic, Fortran, assembly language, and even BASIC. Poor coding style is frequently the source of performance deterioration in real-time imaging systems. In many cases, the negative effects are due to performance penalties associated with object composition, inheritance, and polymorphism in object-oriented languages. But object-oriented languages are rapidly displacing the lower-level languages like C and assembly language in real-time colour imaging systems, and it is probably a good thing because of the accompanying benefits.

Understanding the performance impact of various language features, particularly as they relate to image storage and manipulation, is essential to using the most appropriate construct for a particular situation. There is no clear answer, and experimentation with the language compiler in conjunction with performance measurement tools can be helpful in obtaining the most efficient implementations.

The following list summarizes key issues when implementing real-time imaging systems in a high-level language:


Finally, be wary of code that evolved from non-object-oriented languages such as C into object-oriented version in C++ or Java. Frequently, these conversions are made hastily and incorporate the worst of both the object-oriented and non-object-oriented paradigms simultaneously.

Java is an object-oriented language, with a syntax that is similar to C++ and C#, and to a lesser extent, C. Besides, modern object-oriented languages such as C++ and C# have quite a lot in common with Java (Lukac & Plataniotis, 2007).
