O'Reilly logo

Learning D by Michael Parker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Generic Programming Made Easy

One of the benefits of generic programming is that it enables the implementation of type-independent code. A single function can be written once to support multiple types, rather than once for each supported type. Several languages allow for generic programming to one degree or another. Some implementations are easy to use, but not very powerful; others are powerful, but difficult to learn. Throughout my time in the D community, I have seen numerous remarks in the newsgroups, reddit threads, and elsewhere, praising the simplicity and power of D templates. Combined with the compile-time features covered in the previous chapter, even novice programmers can quickly learn to do things that might seem daunting ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required