D Primer Tutorial

D Primer Tutorial

D Primer Tutorial

Yes, there is a D … D comes after C … and that pans out to be true … but what if we find life on Mars … you heard it here.

Have been a fan of what Digital Mars do for a while, because if you are interested in programming languages you don’t want to interfere with various IDE programming language compilation arrangements, and the GCC/Xcode relationship, for example, is quite complex, and you probably don’t want to push its functionality in wrong directions, or you could break your environment … and we all know breaking up is hard to do.

Digital Mars C is like an independent voice (but in saying that, tomorrow’s tutorial shows it integrated into Code::Blocks IDE) and have been using it successfully on Windows for quite some time, especially for quick one off programs that need doing … though the “toast at breakfast even if you don’t want it” algorithm still needs work.

Am selling Digital Mars short to just stop at that. Take a look at the language D (it comes after C), and yes, with Digital Mars arrangements, please first install C (didn’t show you this with install, but “just do the Nike” on it).

Let’s look at Wikipedia view of D … will make it that it comes after C

The D programming language is an object-oriented, imperative, multi-paradigm system programming language created by Walter Bright of Digital Mars. Though it originated as a re-engineering of C++, D is a distinct language, having redesigned some core C++ features while also taking inspiration from other languages, notably Java, Python, Ruby, C#, and Eiffel.

D’s design goals attempt to combine the performance of compiled languages with the safety and expressive power of modern dynamic languages. Idiomatic D code is commonly as fast as equivalent C++ code, while being shorter and memory-safe. [7]

Type inference, automatic memory management and syntactic sugar for common types allow faster development, while bounds checking, design by contract features and a concurrency-aware type system help reduce the occurrence of bugs.[8]

… chortle … chortle

So with the tutorial today we don’t do Hello World exactly, but it is pretty simple code to give a moving average of record (lengths) entered at the keyboard interactively. By the way, if this had been written in C as idea.c and put into the right place , the compilation of this into a Digital Mars C program would have been as simple as … dmc idea.c … (and then … idea … to run … cute (and easy), huh?)

Link to D information … from Wikipedia … source of quote above.
Link to Digital Mars D download page … here.
Link to some downloadable D code … rename to idea.d

If this was interesting you may be interested in this too.

This entry was posted in eLearning, OOP, Software, Tutorials and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *