5 ms·
I think one of the very good features of D is that it provides a lot of infrastructure that helps with lots of little generic things -- things that are not real
by grok2 10y ago
I think one of the very good features of D is that it provides a lot of infrastructure that helps with lots of little generic things -- things that are not really needed in the language, but help reduce the amount of code you write or simplify common actions you take. It seems like Walter (and all the other contributors) have distilled their experience writing programs into creating a language that helps a lot with some of these things.
Stuff that I particularly like.
Assert/Enforce: http://ddili.org/ders/d.en/assert.html http://ddili.org/ders/d.en/assert.html ,
Unit testing: http://ddili.org/ders/d.en/unit_testing.html http://ddili.org/ders/d.en/unit_testing.html ,
Contract programming help: http://ddili.org/ders/d.en/contracts.html http://ddili.org/ders/d.en/contracts.html, and http://ddili.org/ders/d.en/invariant.html http://ddili.org/ders/d.en/invariant.html ,
Scope (love this): http://ddili.org/ders/d.en/scope.html http://ddili.org/ders/d.en/scope.html
And the other usuals -- templates, mixins, etc....
BTW, I mostly use D as a better C than as a better C++...
- vram22 10y agoGood list. Another good feature: Interfacing to C is somewhat easy at least for the basics. (I haven't looked at advanced cases yet, but maybe someone else can comment on that.) https://dlang.org/spec/interfaceToC.html https://dlang.org/spec/interfaceToC.html This is a great feature IMO, because it allows you to (re)use the huge number of existing C libraries out there. Here is a simple example: Calling a simple C function from D - strcmp: https://jugad2.blogspot.in/2016/09/calling-simple-c-function-from-d-strcmp.html https://jugad2.blogspot.in/2016/09/calling-simple-c-function... There's a handful more small examples of a few things D can easily do, here on my blog: https://jugad2.blogspot.in/search/label/DLang https://jugad2.blogspot.in/search/label/DLang (And of course, there are many more at the DLang tour site - https://tour.dlang.org/ https://tour.dlang.org/ ) Also, there are a few good videos about D (alone) and being discussed along with other languages, at my blog's DLang posts link above. I'll just put some post titles here to give a quick idea: Simple parallel processing in D with std.parallelism Using std.datetime.StopWatch to time sections of D code Read from CSV with D, write to PDF with Python Command line D utility - find files matching a pattern under a directory min_fgrep: minimal fgrep command in D num_cores: find number of cores in your PC's processor Func-y D + Python pipeline to generate PDF file_sizes utility in D: print sizes of all files under a directory tree deltildefiles: D language utility to recursively delete vim backup files [DLang]: A simple file download utility in D Getting CPU info with D (the D language)
- vram22 10y agoJust added another D post to that list: Porting the text pager from Python to D (DLang) https://jugad2.blogspot.in/2017/04/porting-text-pager-from-python-to-d.html https://jugad2.blogspot.in/2017/04/porting-text-pager-from-p...