Book description
Leverage the modern convenience and modelling power of the D programming language to develop software with native efficiency
About This Book
- Acquire the skills to understand the fundamentals of D through its support for imperative and object-oriented programming
- Take advantage of D's powerful compile-time features, templates and ranges to apply generative, generic, and functional style
- A systematic guide that will help you become familiar with the concepts in D with the help of simple and easy-to-understand examples
Who This Book Is For
This book is intended for those with some background in a C-family language who want to learn how to apply their knowledge and experience to D. Perhaps you're a college student looking to use D for hobby projects, or a career programmer interested in expanding your skillset. This book will help you get up to speed with the language and avoid common pitfalls that arise when translating C-family experience to D.
What You Will Learn
- Compile programs with DMD and manage projects with DUB
- Work efficiently by binding your D programs with new and existing C libraries
- Generate code at compile-time to enhance runtime performance
- Implement complex templates for more powerful generic code
- Write idiomatic D with range-based functional pipelines
- Use the DUB repository to find a link with a variety of D libraries
- Implement a web-app in D from the ground up
In Detail
D is a modern programming language that is both powerful and efficient. It combines multiple paradigms in a way that opens up a whole new world of software design. It is used to develop both desktop and web applications, with future targets including mobile, and is available on multiple platforms. It is familiar to anyone with some experience in one or more of the C-family languages. However, hidden in the similarities are several differences that can be surprising when trying to apply common idioms from other languages. When learning D on your own, this can make it more time-consuming to master. In order to make the most of the language and become an idiomatic D programmer, it's necessary to learn how to think in D.
This book familiarizes you with D from the ground up, with a heavy focus on helping you to avoid surprises so that you can take your D knowledge to the next level more quickly and painlessly.
Your journey begins with a taste of the language and the basics of compiling D programs with DMD, the reference D compiler developed by Digital Mars, and DUB, a community-developed build utility and package manager. You then set out on an exploration of major language features. This begins with the fundamentals of D, including built-in types, conditionals, loops and all of the basic building-blocks of a D program, followed by an examination of D's object-oriented programming support. You'll learn how these features differ from languages you may already be familiar with. Next up are D's compile-time features, such as Compile-Time Function Evaluation and conditional compilation, then generic programming with templates. After that, you'll learn the more advanced features of ranges and functional pipeline programming. To enhance your D experience, you are next taken on a tour of the D ecosystem and learn how to make D interact with C. Finally, you get a look at D web development using the vibe.d project and the book closes with some handy advice on where to go next.
Style and approach
A friendly guide to the D programming language and its ecosystem that walks programmers through all they need to know for a painless experience in learning D.
Table of contents
-
Learning D
- Table of Contents
- Learning D
- Credits
- Foreword
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. How to Get a D in Programming
- 2. Building a Foundation with D Fundamentals
- 3. Programming Objects the D Way
- 4. Running Code at Compile Time
- 5. Generic Programming Made Easy
- 6. Understanding Ranges
- 7. Composing Functional Pipelines with Algorithms and Ranges
- 8. Exploring the Wide World of D
- 9. Connecting D with C
- 10. Taking D Online
- 11. Taking D to the Next Level
- Index
Product information
- Title: Learning D
- Author(s):
- Release date: November 2015
- Publisher(s): Packt Publishing
- ISBN: 9781783552481
You might also like
book
Beginning F# 4.0
This book is a great foundation for exploring functional-first programming and its role in the future …
article
Reinventing the Organization for GenAI and LLMs
Previous technology breakthroughs did not upend organizational structure, but generative AI and LLMs will. We now …
book
F# Deep Dives
F# Deep Dives presents a collection of real-world F# techniques, each written by expert practitioners. Each …
book
A Guide to Algorithm Design
Presenting a complementary perspective to standard books on algorithms, A Guide to Algorithm Design provides a …