Abstract
Generics (also known as templates) have become a standard feature of modern programming languages, offering parameterization by data types and possibly other entities. Generics support efficient type-safe container data structures, general-purpose algorithms, and other reusable components. However, the approaches in different languages vary widely in syntax, semantics, and usage. This paper summarizes the design of generics in Ada, C++, C#, and Java and compares them with respect to expressiveness, implementation model / run-time efficiency, and interaction with object-oriented programming and other features.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Liskov, B., et al.: CLU Reference Manual. Springer, Heidelberg (1983)
Wulf, W.A., London, R.L., Shaw, M.: Abstraction and verification in Alphard: Introduction to language and methodology. USC Information Sciences Institute (1976)
ISO/IEC JTC1/SC 22/WG 9. Ada Reference Manual – ISO/IEC 8652:2007(E) with Technical Corrigendum 1 and Amendment 1 – Language and Standard Libraries (2007)
International Organization for Standardization. ISO/IEC 14882:2003, The C++ Standard Incorporating Technical Corrigendum 1 (2003)
Ecma International. C# Language Specification – ECMA-334, 4th edn. (June 2006)
Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. Addison-Wesley, Reading (2005)
Brosgol, B.M.: Companion Examples: A Comparison of Generic Template Support (November 2009), http://www1.adacore.com/~brosgol/ae2010/examples.html
Garcia, R., et al.: A comparative study of language support for generic programming. In: Proc. OOPSLA 2003. ACM, New York (2003)
Khalifa, A.A.: Generics: Ada 95 vs C++ vs Java 1.5. Master’s thesis, Univ. of Jyväskylä, Finland (2005), https://jyx.jyu.fi/dspace/handle/123456789/12351?show=full
Ichbiah, J.D., Barnes, J.G.P., Firth, R.J., Woodger, M.: Rationale for the Design of the Ada Programming Language (1983)
Bray, G.: Implementation implications of Ada generics. ACM SIGAda Ada Letters III(2) (1983)
Stroustrup, B.: The Design and Evolution of C++. Addison-Wesley, Reading (1995)
Vandevoorde, D., Josuttis, N.M.: C++ Templates: The Complete Guide. Addison-Wesley, Reading (2007)
Naftalin, M., Wadler, P.: Java Generics and Collections. O’Reilly, Sebastopol (2007)
Flanagan, D.: Java in a Nutshell, 5th edn. O’Reilly, Sebastopol (2005)
Arnold, K., Gosling, J., Holmes, D.: The Java Programming Language, 4th edn. Addison-Wesley, Reading (2006)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Brosgol, B.M. (2010). A Comparison of Generic Template Support: Ada, C++, C#, and JavaTM . In: Real, J., Vardanega, T. (eds) Reliable Software Technologiey – Ada-Europe 2010. Ada-Europe 2010. Lecture Notes in Computer Science, vol 6106. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-13550-7_16
Download citation
DOI: https://doi.org/10.1007/978-3-642-13550-7_16
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-13549-1
Online ISBN: 978-3-642-13550-7
eBook Packages: Computer ScienceComputer Science (R0)