• Category Archives
  • Instruction
  • 14 Posts

Interesting ways of using Go channels

I’ve created this post to document slides accompanying a talk on Go channels given by John Graham-Cumming during GopherCon 2014. The presentation was entitled ‘A Channel Compendium‘ and is available to view on youtub.com.

During the talk, he presents interesting ways of using Go channels and makes you aware of the possibilities and advantages of concurrent programming. For me personally, this opened my eyes to several new ways of structuring programs and novel techniques for synchronising work done across multiple processor cores.

Working with files in the D programming language

The inspiration for this article was one written a few weeks ago entitled Working with Files in Go. In that article the author details numerous ways of interacting with files highlighting the capabilities of Go. I thought I would write a companion piece, this time detailing how to interact with files using the D programming language. Interacting with files is a fundamental task of any programming language and while such tasks are commonplace, it’s not entirely obvious how to achieve certain file related tasks using D. Hopefully this article will change that and show the simplicity and power of the D language when working with files.

More hidden treasure in the D standard library

After the success of the last article detailing hidden treasures in the D standard library, I thought I would write another highlighting why the D programming language coupled with its great standard library is surprisingly useful. The library itself is a vast beast and has been written by some exceptional programmers, so occasionally you stumble across some truly useful and well designed nuggets of code. This article shows a few more of these hidden treasures and provides examples of where they could be useful when used in your projects.

Hidden treasure in the D standard library

I’ve been using D for a number of years and i am constantly surprised by the hidden treasure i find in the standard library. I guess the reason for my surprise is that i’ve never exhaustively read the entire library documentation, i only skim it for what’s needed at any given time. I’ve promised myself i will read it thoroughly one day but until then i’ll enjoy these little discoveries. This article highlights a few of these hidden treasures which i hope you’ll enjoy learning about and will be useful for your future D projects.

Stop abusing arrays in PHP

This is an issue i’ve wanted to get of my chest for a long time. It’s been latently brewing inside me for a considerable amount of time and it’s starting to come to a head. The issue is with PHP and the total abuse of arrays. Whether this issue is an artifact of the language’s historical baggage or because PHP just attracts a lot of inexperienced developers is up for debate. My problem here is that arrays are nearly always used where objects should be!

Alternative function syntax in D explained

This is an extension article to Templates in D explained where i introduce the alternative function syntax and how it complements template usage. This article will expand a little more on that syntax and make clear what is available in D and why.

An alternative syntax has not been included by accident but by design and as a result can potentially make code more complicated to understand and add more friction to first learning the language. This particular trade off, i believe is worth it, enabling particular features when using different paradigms.

Templates in D explained

Let’s get one thing straight from the outset, template metaprogramming scares the hell out of most developers! I have no idea why, probably because it simply sounds scary? Whatever the reason, many developers shy away from even learning about such techniques, let alone use them. This is such a shame because templates offer a superb tool for programming at a higher level of abstraction which is something that can aid in better program design.

Even though many programming languages support template metaprogramming this article is about using templates in D. D is one of the best languages i have ever used and the more i use it the more i realise it’s getting everything just right. Hopefully this article will remove the above fear and educate developers on what can be achieved.