Sunday, April 6, 2014

D Language: the language C++ could be

Where Is D now?


DMD logo
The history of D is quite rich by now. The language evolves for about 10 years, but the interesting thing is that the fully rethinked and redesigned D 2.0 is now in active development and still does not have its stable niches and mature practices / patterns / etc., like C++, Java, Python, and so on.

Also it worths mentioning that the development means the language itself, compilers (there are 3 for now: 
  1. dmd 2 - reference one from Digital Mars;
  2. gdc - based on gcc;
  3. ldc - llvm

), and standard library (called "phobos") often change. Also stable versions of ldc and gdc are a bit behind dmd, so it is better to use the latter in order to get access to the last features and changes of the language.

What I don't like in C++ (... after I've met D)

If you've ever tried to use C++, you can mention that the language is quite difficult itself (whatever it means). One of the evidences of that is that C++ applications can be written in dozens of coding styles, using dozens of practices and approaches. It can even seem, looking at two applications written in C++, that they are written in two different languages (consider two desktop applications, one written using bare Win32 API, and the other one using Qt).

Qt, for example, offers meta object compiler and objects tree system in order to simplify memory management and allow event-driven applications to be written in a convenient manner so that it seems you're using the very different language.

The existing of such monstrous tools for simple tasks (really, memory management mess in twenty first century?) is an indicator to me, that something is really wrong with the language.

The second thing is that no-one knows whole C++ :), (even Stroustrup o_O?). Really, you can spent years learning possibilities of the language, that was not been redesigned for decades, but dozens of new features are stably added every couple of years.

And the last thing is the absence of a comprehensive standard library (IMHO "over-templated" STL is not the best choice). Yeah, you can find hundreds of C++ json and xml parsing libraries, every framework also has those (remember Qt here :)). BUT you don't have the standard one! WTF? Everybody has!

D is Better! ... ?

Well, D does not have those disadvantages I've written about above, having the same and even more possibilities than C++. Also there's garbage collector sitting in your D application runtime. A lot of mature developers don't like GCs, but the nice thing is that you can disable or ignore it :)

Why D is better? Just try... Maybe it won't be better for you.
(c) me

SMTP Library for D

I've started learning D in practice by writing simple SMTP library that implements SMTP client low- and high- level APIs. It supports SSL/TLS encryption and PLAIN authentication for now.

Check it out at my github page. It is very far from using all tasty features of the language, but still shows how much convenient a system programming language can be still having comparable performance to C++.

To be continued ...

Have a nice D programming!

Saturday, March 1, 2014

My First Authorship Experience: "Building Your First Application with Go"

My Story of Go


Building Your First Application with Go Cover
Building Your First Application with Go Cover
I've started working with Go language far before the first official release of Go 1.0, and this language seemed, I think, beautiful for me from the first steps.

While Go language in its current state (version 1.2) still remains quite raw from some points, it is still finished enough to be successfully used in production for different goals. I personally use it for building web services, and the most magnificent is that you basically need only standard library to start doing web application development in Go.

My Story with PACKT Publishing


About a half years ago I've been contacted by guys from PACKT Publishing, about making a video course about building applications with Google Go. It was a very exciting offer which I've accepted even not thinking much about it. Having some experience teaching other people programming, and writing some tutorials inside my personal blog in Russian, I though I could do the job, even if working language is English which is not my native one.

How Was It, Doing the Job?


Making some educational product is interesting personally to me, it can not be that interesting to others. And that was, possibly, the most motivational thing for me. The working process of making video is a hard and sometimes monotonic job as any other job, unless it may seem different before you start working on it.

The most complex thing is to make a content which perfectly fits target audience, particularly to decide what to explain and what to consider to be left out of scope, especially if your target audience is non-expert environment: novices or junior developers.

What about the results


The result I've got is a published video course called "Building Your First Application with Go" and a lot of excitement when you see the job done. About the quality: it's up to viewers to decide if I did my job well or not.

Nevertheless, it was fascinating experience, and now I'm sure I'm not to stop at this point, and will try to work further on creating new educational products and materials. Doing the job you like is the best think that can happen with you, that is what I think.

Acknowledgements


I would like to say many thanks to my wife, that patiently supported me all this time, and a highly professional team from PACKT Publishing house, that led me through all the process starting from writing first texts till the moment the course was published.