Monday, 10 March 2014

Welcome to The Deep Blue C++

Waves at Getaria/Gu├ęthary, Aquitaine, France

During my thirteen years as a software engineer, I have learnt quite a lot of things - and I keep learning every day. I learn from practice, from discussions with workmates and from reading good books. I especially learn from mistakes: code that doesn't do what I expect, code that doesn't do anything at all, code that does it but with some occasional crash or two... If you're a programmer, you know what I'm talking about.

The region of my brain which stores this kind of knowledge is starting to be a bit crowded, but it still needs free space to learn new things. And my memory doesn't grow. What if I forget some useful bit of knowledge which I should apply tomorrow?

What I've learnt has substantially changed the way I write code. In my first years as a programmer I tried to avoid mistakes, but I hadn't made enough of them yet to discover the best ways to prevent them. Now I know better. I know there are some things that bring you into trouble very quickly. Other things will silently wait for the worst moment - maybe months or years later, to come to the surface in the form of even more original problems. Disorganized code, uninitialized variables, pointer arithmetics, implicit casts, syntactic overloading, inheritance in which functions hide other functions, too complex expressions, unclear function or class semantics... the list of things which you'd better avoid in the first place has become rather long during the years.

I decided to start a blog where I'll organize and share my experiences and ideas, so that I won't forget them. As a plus, you'll be able to read them and give me your feedback. I will appreciate any comments you leave in this place, and I'm sure I can learn a lot from them!

There are already many C++ blogs, often written by people who know much more about software and C++ than I'll ever do. But I think something is gained from my addition – those great blogs are still there anyway (I link to a few of them in my blog list), and my contribution may add some practical aspects which I feel may be useful and accessible, especially for novice programmers.

We are all beginners, in a way - when we start new projects, we are beginners in that specific new project, and we have the chance to make it good from the start. By following some guidelines, I think we notably increase our chances to do so. There are many things that can be done well from the very first time, and which are not so easy to fix later. The first name of this blog came naturally after this reasoning: "C++ from the start". However, I soon realized I didn’t love it. I was looking for something more expressive.

Software programs have two kinds of audience. They are written for a computer to execute them, but also for people to read and hopefully understand them in the future. The best programs are those which work well in both ways – the machine does its job well, and humans can make that work evolve into something which suits new needs.

We write software to change the world, because programs are run to change something. Their lines will be spelled tomorrow with effects that we cannot fully foresee. We rise waves which will go a long way until they reach a far away shore - one which our eyes may never see.

Let’s take a dive. Welcome to The Deep Blue C++!


  1. Thank you for your two cents worth! (or your "Little grain of sand") :P
    I'm sure you can help Indian Politicians, too! See this link below:



    1. Thank you Oriol for the very first comment in The Deep Blue C++! It all began in Carrer de Figueres, you know :-) Every politician should be able to compare two strings in C++, that's the bare minimum! :P

  2. Hi Daniel! Looking at your blog, I was wondering if you can help me in writing code for Text Clipping in Computer Graphics in c++? I don't know how to start and I can't seem to google anything on writing its logic.
    P. S. I need it ASAP. Can you help?

    1. Hi varun, sorry, actually I can't help you because I don't have any experience in the subject you mention. I'm sure there must be somewhere (libraries, book shops) where you can find good learning material. Good luck!