D编程语言入门

需积分: 10 3 下载量 19 浏览量 更新于2024-07-18 收藏 3.94MB PDF 举报
"Programming_in_D" 本书“Programming in D”由Ali Çehreli撰写,主要关注D编程语言的使用和理解。此书的第一版在2017年进行了修订,内容可能涵盖了D语言的基本概念、语法特性、高级特性和实际应用。这本书遵循创作共用 Attribution-NonCommercial-ShareAlike 4.0 国际许可协议,允许读者自由阅读、分享,但不能用于商业目的。 D语言是一种现代的系统编程语言,设计时兼顾了性能、效率和可读性。它拥有C和C++的许多特性,并且在内存管理和错误处理方面有所改进。2017年的标签表明,这个版本的书籍可能涵盖了D语言的最新发展和特性,包括D2版本的一些更新。 书中的部分内容并未给出详细信息,但通常一本关于编程语言的书籍会包含以下章节: 1. **入门**:介绍D语言的历史、安装编译器(如GDC, LDC或DMD)以及编写第一个“Hello, World!”程序。 2. **基本语法**:涵盖变量声明、数据类型(包括基本类型、结构体、类等)、控制流(条件语句、循环)、函数定义与调用。 3. **面向对象编程**:讲解类、继承、多态和接口的概念。 4. **模板**:D语言的模板功能强大,可用于泛型编程,包括类模板、函数模板和模板元编程。 5. **内存管理**:讨论自动垃圾回收、智能指针、RAII原则以及手动内存管理。 6. **异常处理**:解释如何使用try-catch-finally语句进行异常处理。 7. **并行与并发**:可能包括线程、同步原语、原子操作以及协程(coroutines)。 8. **标准库**:介绍D标准库(Phobos)中的常用模块和函数。 9. **高级特性**:如闭包、范围(scope)和属性(property)。 10. **程序调试与优化**:讲解如何使用调试工具,以及代码优化技巧。 此外,本书还提及了编辑者Luís Marques和封面设计师İzgi Yapıcı以及插图师Sarah Reece的工作。电子版可以在特定网址找到,而实体书则有多种版本,包括硬皮本、平装本和电子版,每种都有不同的ISBN号。 “Programming in D”是一本全面介绍D语言的教程,适合初学者和有一定经验的开发者,帮助他们掌握D语言的各个方面,利用其强大的特性和现代编程理念来构建高效、可靠的软件。
2015-12-23 上传
The main aim of this book is to teach D to readers who are new to computer programming. Although having experience in other programming languages is certainly helpful, this book starts from the basics. D is a multi-paradigm system programming language that combines a wide range of powerful programming concepts from the lowest to the highest levels. It has C-like syntax and static typing. It pragmatically combines efficiency, control, and modeling power, with safety and programmer productivity in mind. Each chapter is based on the contents of the previous ones, introducing as few new concepts as possible. It is recommended that the book is read in linear fashion, without skipping chapters if possible. Although this book was written with beginners in mind, it covers almost all features of D. More experienced programmers can use the book as a D language reference by starting from the index section. Blurbs from the back cover: “D is pristine, clean, immensely powerful, and arguably the actual state-of-the-art programming language. Ali's book is a gem. Clear, concise, and complete.” – Olivier Henley “I have been using Ali’s online D book to teach D at the university level. It is up-to-date, complete, and most importantly, extremely readable. Having a print version is even better! This is now the 'go-to’ book for learning D programming.” – Chuck Allison, Professor and Chair, Computer Science Department, Utah Valley University “Ali's explanations are succinct and on target. I like that he provides rationale for why D was designed in a particular way and how I can use it most effectively. This is the best computer language book I've read.” – Robbin Carlson, Luthier and Enterprise Architect “I taught a CS2 Data Structures class in D with more success and student appreciation than when using either C++ or Java as it's an ideal language to express the relevant concepts at all scales, from detailed to big picture, without needless complexity.Ali Çehreli's tutorial played a central role supporting students especially during the first half of the course — without it the course simply would not have worked, so "many thanks Ali" — and an important part of that is its linearity — it can be read with only backward dependencies. This meant that with hard work even students of little experience and only moderate current abilities could get up to speed, and we saw just that. It is hard to overstate this factor. I unreservedly recommend this book to all.” – Dr. Carl Sturtivant, University of Minnesota Department of Computer Science & Engineering “This book is one of the best guides through the language that I've seen.” – Andrew Wray, D Enthusiast “I encourage anyone considering D to read this book. Not exactly 'D for Dummies' but it's easy to follow even if you don't have much experience with compiled languages.” – bachmeier, Reddit user “Having worked through the book, I have to say this is one of the easiest to follow and distraction free read there is and the fact that it made learning a new language a total breeze really impressed me.” – Imran Khan, Student