Code::Blocks IDE D Primer Tutorial

Code::Blocks IDE D Primer Tutorial

Code::Blocks IDE D Primer Tutorial

The tutorial today is about a programming IDE called Code::Blocks, and it builds on yesterday’s D Primer Tutorial as shown below.

Programming IDEs take a lot of the hard work out of tasks such as compiling and linking in languages such as D, Matlab, Fortran (Code::Blocks) or Java, C, C++, VB.Net and C# (NetBeans) … and please know that there are many other languages and many other IDEs. In the case of Code::Blocks IDE, which this blog introduces to you today (it’s customary to shake hands, and no Klingon is necessary), it can create a D code project environment. To cut a long story short, there aint nothin’ wrong with a good ol’ IDE, but beware of IDEs in March.

In saying that about IDEs, and how they make programming easier, often with Open Source programming, it is advantageous to know what goes on “under the hood” (or even “in the ‘hood” … chortle, chortle). So if you ever get an opportunity to get helped creating your own makefile (or make it yourself, even with the Sweet Green Icing … knew it could be worked in!) for something, take the opportunity to learn how to do this, as the Open Source world will become a little easier to navigate with such types of knowledge. You’ve got to admire those early designers of computer languages, and those days when all you had was this tiny bit of memory (64k or “into the heliosphere on 8,000 bytes of memory”) to play with to create your program.

In today’s tutorial we write a simple D program based on idea.d of yesterday, to do with a MovingAverage program, with some simple struct and class bits added on, all under the supervision of Code::Blocks IDE.

Code::Blocks can be an IDE for much more than D … it can supervise Matlab, Fortran, ARM, AVR, Direct/X, FLTK, GLFW, GLUT, GTK+, Irrlicht, Lightfeather, MCS51, Ogre, OpenGL, PowerPC, QT4, SDL, SFML, STL port, SmartWin, TriCore and wxWidgets projects. In coming days and weeks we’ll look at more.

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, and show a rudimentary struct and class usage. By the way, if this had been written in C as hello.c and put into the right place, the compilation of this into a Digital Mars C program would have been as simple as … dmc hello.c … (and then … hello … to run … cute (and easy), huh?)

Link to Code::Blocks “spiritual home” download page at Code::Blocks.

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 hello.d


Previous D Primer Tutorial is shown below.

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.


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

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

17 Responses to Code::Blocks IDE D Primer Tutorial

  1. I enjoy brain-stimulating content like this. I’ve no issue with any with the data here. I agree with a great deal of the points mentioned in this outstanding article.

  2. Hey there I am so grateful I found your webpage, I really found you by mistake, while I was researching on Google for something else, Anyways I am here now and would just like to say cheers for a marvelous post and a all round exciting blog (I also love the theme/design), I donÒ€ℒt have time to go through it all at the minute but I have saved it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the great b.|

  3. fashion says:

    I concur, this site is actually insightful and also we got an idea of this certain subject. I never ever assumed that I might find this web site. I want to apply this in my life. Many thanks for this and hope you will create more similar to this one.

  4. WEB DESIGN says:

    Perfect piece of function you’ve got done, this site is truly cool with superb info.

  5. VidPro says:

    Your website is awesome dude. i love to check out it daily. pretty good layout and content β€œ

  6. Thank you for your very good info and respond to you. san jose car dealers

  7. with thanks with regard towards the certain post i’ve been on the lookout with regard to this kind of advice on the net for sum time these days and so with thanks

  8. My wife and i ended up being so ecstatic Louis could deal with his analysis through your precious recommendations he received through the site. It’s not at all simplistic to simply continually be giving freely strategies which some others have been trying to sell. And we all grasp we have the writer to give thanks to because of that. The specific illustrations you have made, the straightforward website menu, the friendships you can help to instill – it is many excellent, and it’s really aiding our son and the family recognize that the topic is brilliant, and that is really indispensable. Many thanks for everything!

  9. Just desire to say your article is as surprising. The clarity in your post is simply spectacular and i can assume you are an expert on this subject. Well with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please continue the enjoyable work.

  10. spend says:

    It‘¦s actually a cool and useful piece of information. I am happy that you just shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

  11. feel says:

    Hello.This article was extremely motivating, particularly because I was looking for thoughts on this subject last Thursday.

  12. enjoy says:

    Wonderful goods from you, man. I’ve understand your stuff previous to and you’re just too excellent. I actually like what you’ve acquired here, certainly like what you’re saying and the way in which you say it. You make it entertaining and you still care for to keep it sensible. I can’t wait to read far more from you. This is actually a wonderful web site.

  13. Quiet says:

    Take pleasure in the post you provided.. Supporting the weblog.. cheers Great ideas you possess here.. So happy to have found this submit..

  14. I really enjoy reading on this site, it has got fantastic content. “And all the winds go sighing, For sweet things dying.” by Christina Georgina Rossetti.

  15. Watch Parks says:

    I really wanted to post a brief remark so as to thank you for these wonderful advice you are placing here. My rather long internet search has now been compensated with really good insight to write about with my friends. I would assume that most of us website visitors are very much fortunate to exist in a fabulous community with many perfect people with helpful strategies. I feel quite lucky to have encountered your entire website page and look forward to tons of more brilliant times reading here. Thanks once again for a lot of things.

  16. Rosenbaum says:

    Thanks for sharing your info. I truly appreciate your efforts and I am waiting for your further write ups thanks once again.|

Leave a Reply to VidPro Cancel reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>