D is designed with lessons learned from practical C++ usage rather than from a theoretical perspective. Even though it uses many C/C++ concepts it also discards some, and as such is not compatible with C/C++ source code. D has however been constrained in its design by the rule that any code that is legal in both C and D should behave the same. It adds to the functionality of C++ by also implementing design by contract, unit testing, true modules, garbage collection, first class arrays, associative arrays, dynamic arrays, array slicing, nested functions, inner classes, closures, anonymous functions, compile time function execution, lazy evaluation and has a reengineered template syntax. D retains C++'s ability to do low-level coding, and adds to it with support for an integrated inline assembler. C++ multiple inheritance is replaced by Java style single inheritance with interfaces and mixins. D's declaration, statement and expression syntax closely matches that of C++.
The inline assembler typifies the differences between D and application languages like Java and C#. An inline assembler lets programmers enter machine-specific assembly code within standard D code, a method often used by system programmers to access the low-level features of the processor needed to run programs that interface directly with the underlying hardware, such as operating systems and device drivers.
D has built-in support for documentation comments, allowing automatic documentation generation.
D ถูกออกแบบด้วยบทเรียนจากการปฏิบัติ C + + การใช้งาน มากกว่า จากมุมมองของทฤษฎี แม้ว่าหลายใช้ C / C + + แนวคิด มันยังทิ้งบางส่วนและเป็นเช่นจะไม่เข้ากันได้กับ C / C + + รหัสต้นฉบับ งได้ แต่ข้อ จำกัด ในการออกแบบ โดยกฎของรหัสใด ๆที่เป็นกฎหมายในทั้ง C และ D จะทำตัวเหมือนเดิม มันจะเพิ่มฟังก์ชันของ C + + โดยยังใช้ออกแบบโดยสัญญา การทดสอบหน่วยโมดูลจริงเก็บขยะชั้นอาร์เรย์ , เชื่อมโยงอาร์เรย์แบบไดนามิก , อาร์เรย์ , เรย์หั่น , ซ้อนฟังก์ชันภายในชั้นเรียน , ปิด , ฟังก์ชันที่ไม่ระบุชื่อ , รวบรวมการดำเนินการฟังก์ชันเวลาขี้เกียจประเมิน และมีภาพที่ประกอบร่างแล้วแม่แบบวากยสัมพันธ์ D จะมี C + + สามารถทำรหัสระดับต่ำ และช่วยเพิ่มการสนับสนุนสำหรับการรวมกับไลน์ประกอบ C + + หลายมรดกจะถูกแทนที่ด้วยรูปแบบเดียวเป็นมรดกกับการเชื่อมต่อและ mixins . D ประกาศ , คำสั่ง และการแสดงออกไวยากรณ์ตรงกับของ C + +แบบอินไลน์การประกอบ typifies ความแตกต่างระหว่าง D และภาษาโปรแกรม เช่น Java และ C # . อินไลน์ประกอบที่ช่วยให้โปรแกรมเมอร์ป้อนรหัสประกอบเฉพาะเครื่องภายในมาตรฐานรหัส วิธีการมักจะใช้โดยโปรแกรมเมอร์ระบบเพื่อเข้าถึงคุณสมบัติระดับของการประมวลผลที่จำเป็นในการเรียกใช้โปรแกรมที่ติดต่อโดยตรงกับฮาร์ดแวร์พื้นฐาน เช่น ระบบปฏิบัติการและไดรเวอร์อุปกรณ์งได้ในตัวสนับสนุนสำหรับเอกสารแสดงความคิดเห็น , ให้เอกสารอัตโนมัติรุ่น
การแปล กรุณารอสักครู่..
