{"id":4586,"date":"2013-10-04T05:17:38","date_gmt":"2013-10-03T19:17:38","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4586"},"modified":"2016-02-08T19:45:15","modified_gmt":"2016-02-08T09:45:15","slug":"d-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/d-primer-tutorial\/","title":{"rendered":"D Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/C\/D\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"D Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/C\/D\/D_DigitalMars_CodeBlocks_Primer-9of.jpg\" title=\"D Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">D Primer Tutorial<\/p><\/div>\n<p>Yes, there is a D &#8230; D comes after C &#8230; and that pans out to be true &#8230; but what if we find life on Mars &#8230; you heard it here.<\/p>\n<p>Have been a fan of what Digital Mars do for a while, because if you are interested in programming languages you don&#8217;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&#8217;t want to push its functionality in wrong directions, or you could break your environment &#8230; and we all know <a target=_blank title='breaking up' href='http:\/\/www.youtube.com\/watch?v=tbad22CKlB4'><i>breaking up is hard to do<\/i><\/a>.<\/p>\n<p>Digital Mars C is like an independent voice (but in saying that, tomorrow&#8217;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 &#8230; though the &#8220;toast at breakfast even if you don&#8217;t want it&#8221; algorithm still needs work.<\/p>\n<p>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&#8217;t show you this with install, but &#8220;just do the Nike&#8221; on it).<\/p>\n<p>Let&#8217;s look at Wikipedia view of D &#8230; will make it that it comes after C<\/p>\n<blockquote><p>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.<\/p>\n<p>D&#8217;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]<\/p>\n<p>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]<\/p><\/blockquote>\n<p> &#8230; chortle &#8230; chortle<\/p>\n<p>So with the <a target=_blank title='D' href=\"http:\/\/www.rjmprogramming.com.au\/C\/D\/\">tutorial<\/a> today we don&#8217;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 &#8230; dmc idea.c &#8230; (and then &#8230; idea &#8230; to run &#8230; cute (and easy), huh?)<\/p>\n<p>Link to D information &#8230; <a target=_blank title='D' href=\"http:\/\/en.wikipedia.org\/wiki\/D_(programming_language)\u200e\">from Wikipedia<\/a> &#8230; source of quote above.<br \/>\nLink to Digital Mars D download page &#8230; <a target=_blank title='Digital Mars' href='http:\/\/dlang.org\/download.html'>here<\/a>.<br \/>\nLink to some downloadable D code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/C\/D\/idea.d_GETME' title='idea.d'>idea.d<\/a>\n<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d4586' onclick='var dv=document.getElementById(\"d4586\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=Digital+Mars\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d4586' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yes, there is a D &#8230; D comes after C &#8230; and that pans out to be true &#8230; but what if we find life on Mars &#8230; you heard it here. Have been a fan of what Digital Mars &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/d-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,28,33,37],"tags":[176,242,287,331,558,875,997,1319],"class_list":["post-4586","post","type-post","status-publish","format-standard","hentry","category-elearning","category-oop","category-software","category-tutorials","tag-c","tag-compiler","tag-d","tag-digital-mars","tag-hello-world","tag-oop","tag-programming","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4586"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=4586"}],"version-history":[{"count":1,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4586\/revisions"}],"predecessor-version":[{"id":20060,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4586\/revisions\/20060"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=4586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=4586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=4586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}