Students need to learn multiple programming languages
Multiple languages encourage a solution choiceWhile all programming languages excel in solving problems for which they were specifically designed, they tend to provide less natural solutions for more diverse problem areas.
For example, languages lacking effective dynamic allocation / reclamation facilities will encourage programmers to represent lists by statically-sized arrays. Languages with good dynamic memory control allow these structures to be modeled in a more flexible way, using pointers and linked lists.
The language choice can thus influence whether the programmer views all lists as static objects that must have a fixed number of items or alternatively as dynamic objects that have no bounds. This representation choice may, or may not, be a natural solution for the problem.
For example, the “list” command has specific implementation ramifications. Static lists require that the maximum number of items be known beforehand. If the number of items is a static value, then this is the natural representation. The amount of storage needed and used will be static and reliably available.
If however the number of items is not statically known, or the number changes during program execution, then the programmer will need to select a maximum size that is perhaps much higher than the likely average number of items. Thus storage space may be unnecessarily wasted.
Dynamic lists are created at run time. If the total number of items to be stored is not statically known then this may be the ideal implementation. However, by their very nature, dynamic lists may grow at run-time and thus the resources they need are unknown and will cause an error condition should the available memory be exhausted. It might not be possible to prove, prior to execution, that enough space will be available, especially for embedded systems with limited memory capacity.
Dynamic lists rely on pointers to build and maintain the data structure. Depending on the language features, pointers introduce the possibility for hard-to-detect errors, such as dangling references (pointers to objects that no longer exist).
The above “list” example shows the benefits and detriments of both solutions to the simple task of maintaining a list. The key point is that either may be the best solution to the problem given the requirements, whether it is a static number of items to be stored, or not.
If the solution is selected based solely on a single programming language, then the optimum solution for the problem may not be selected, or even considered.

Conclusion
The programming languages discussed here and illustrated in Figure 1 should be considered analogous to a tool box. Each language is a tool to help solve a problem. By comparing the solution that each tool offers, a student can then select amongst these solutions and decide which one is best for the problem at hand. The hammer will be used for the nail and the screw driver for the screw.
This ideal of selecting the best solution to the problem is only available if a student has been exposed to multiple ways of looking at the problem and to multiple ways of programming software code. Students must be given an understanding of a wide variety of languages as well as the different problem area solutions and different methodologies for which they were designed, so that they have all the tools they need to succeed in life after college.
Greg Gicca is director of safety and security product marketing at Adacore. He has over 20 years’ experience in designing and implementing software development tools, and has participated in industry and government groups responsible for defining software quality evaluation standards.


Loading comments... Write a comment