D, the Best Programming Language, for Former Python Developers
- Length: 333 pages
- Edition: 1
- Language: English
- Publisher: Independently published
- Publication Date: 2020-11-01
- ISBN-10: B08M83X6N8
- ISBN-13: 9798556871304
- Sales Rank: #10209473 (See Top 100 Books)
D programming language or DLang for Python programmers: rapid software development of high performance software and a reliable software technology. “There is no best programming language”, they say. There is, for most applications it is D.The book starts from a comparison of D to Python. Then it explains D starting from simple features (types, variables, functions, expressions, statements) up to advanced ones (object oriented programming, templates, mixins, contract programming, overloading of operators, etc.) Then follows an advice for good programs and introduction to several libraries: the standard library Phobos (ranges, arrays, functional programming, tuples, the variant types, files, etc.) and several other important libraries including some libraries written by the author. Through these libraries D supports asynchronous programming, multithreaded programming, dependency injection (one particular “ideologically correct” flavor of which is introduced in details), etc. This book doesn’t just teach you D syntax, it gives you some principles to program in D in the right way. It is also considered how to create an object oriented wrapper over a C library. The book contains the articles “How to Make Your Programs Run Hundreds to Thousands Times Faster Without Giving up Reliability and Ease of Programming” and “What would be my choice of programming language if I was ordered to write a nuclear weapon control system?” D is the second choice for such kinds of projects after Rust (and no, it is not Ada). The book ends with an advice on which D compiler to use.This book makes you a D programmer. D is a very unusually good programming language for startups, academics, programming hobbyists, open source developers, big and small companies who decided to improve their efficiency and effectivity, electronics companies, game developers, system programmers, military, industry, supercomputers and mainframes. D can be used for desktop, Web development, electronics, smartphones, servers, mathematics, robots, games, GPU and AI, and even for writing an OS. If you are a programming teacher, your service would be greatly improved by starting to teach D. If you belong to any of these categories (and probably many more), don’t miss this great opportunity to learn D! And D is fast and low electricity consuming (green).
D, the Best Programming Language, for Former Python Developers Abstract About the author Introduction A comparison of Python and D Advantages and disadvantages of D Advantages Disadvantages Static vs dynamic typing Introduction Dynamic typing explained Setup D Environment Hello world In Python In D Tokenization Keywords and Identifiers Comments Functions and Variables Variables Immutable variables References Constant variables Static variables More about variables Functions Function arguments Function modifiers Pure functions Ref functions Auto functions Function calls Function overloading scope and return ref function argument modifiers Default arguments More function attributes Variadic functions Imports and Aliases Aliases Introduction to Types Basic types Arithmetic conversions Enum types Arrays By-value and by-reference types Associative arrays Type qualifiers Expressions Assignment operator Arithmetic operators Increment/decrement operators Index and slice expressions Cat expressions Function call expressions Boolean and bitwise expressions Compare expressions In expressions Comma expression Cast expression Typeid expressions Assignment operator expressions Conditional expression Precedence and associativity Import expressions Vector operations Other expressions Properties Literals Boolean literals Null literal Integer literals Floating point literals Array literals Associative array literals String literals Character literals Other literals Statements Declaration statement Expression statement Block statement Statement if Statement switch Final switch Statement while Statement do … while Statement for Statement foreach with statement break and continue statements goto statement Functional Programming Function pointers and delegate variables Function literals Structs and Classes Structs Member functions this Visibility Constructors Copy constructors Disabling constructors Constructor Attributes Destructors Properties alias this with with scopes Structs misc Classes Inheritance Virtual functions Other class features. Memory management Abstract functions and classes Interfaces Anonymous nested classes Using a class as an associative array index Associative Array Properties Unions Cast Operations Casting between classes Numeric casts Struct casts Casting type qualifiers Casting to void Void arrays Other notes Pointers Exceptions and Scope Guard Statement Exceptions Scope guard statement nothrow functions Array bounds and memory checking Templates Template parameters Template Constraints Template Specialization Kind of templates. Eponymous templates Eponymous templates Metaprogramming Template recursion Metaprogramming with template specialization Mixins Mixin statement Template mixins Using mixin statement and template mixins together Documentation Comments Unit Testing Attributed Unittests Best practices Documented Unittests Contract Programming assert in and out conditions in, out and inheritance Invariants The order of function execution Static Compilation Control static if version and debug static assert static foreach Double braces in static constructs Pragmas Special keywords Overloading Operators Postincrement e++ and Postdecrement e-- Operators Cast Operator Overloading Boolean Operations Overloading == and != Overloading <, <=, >, and >= Function Call Operator Overloading f() Static opCall Assignment Operator Overloading Op Assignment Operator Overloading Index Operator Overloading Overloading foreach and foreach_reverse Forwarding Compile-Time Sequences Compile-time loops Modules Modules Public import Packages static this User-Defined Attributes BetterC Advice for Good Programs The D Style Whitespace Naming Conventions Declaration Style Operator Overloading Hungarian Notation Properties Documentation Unit Tests Programming patterns Introduction to the Standard Library Ranges Random access ranges Output ranges Range operations More functional programming std.array std.file std.typecons Value tuples Flags Nullable std.variant std.stdio struct File Bit fields Concurrency async/await dawait future Shared variables Synchronized code sections Threads std.parallelism Fibers Generators Memoizing that is caching function result in D language std.functional.memoize from the standard library Memoization in the D Programming Language, part 2 memoize functions memoizeMember Passing parameters through structs with nullable fields The problem Variants of solutions Example of definition and combination Calling functions Last considerations Modify tuple modifiers The problem The implementation Possible usage Pure Dependency Injection in D Dependency injection Taxonomy Advantages Disadvantages Types of dependency injection Pure dependency injection Python Dependency Injector My D dependency injector Providers Classes Why I can’t call new from a template Writing thick (object oriented) D binding of a C library Other programming languages Introduction Packages structure My mixins About finalization and related stuff Dealing with callbacks More little things Static if Comparisons How to Make Your Programs Run Hundreds to Thousands Times Faster Without Giving up Reliability and Ease of Programming Introduction Frequently Asked Questions What would be my choice of programming language if I was ordered to write a nuclear weapon control system? Which compiler should I use? Comparison Package and/or binary availability, by platform and compiler Experimental compilers and forks Bibliography
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.