Monday, 24 February 2014

New Book: Becoming a Better Programmer

After many years of gestation my latest book is available for purchase as an early-access pre-release.

Called Becoming a Better Programmer, it is a handbook for people who are about code.

This early access edition already contains 14 chapters, and there are many more coming. There is a free "sample" version available so you get a taster of what you'll be purchasing.

As a pre-release, it's available at an introductory price. The price will go steadily upwards as the book nears completion. Buy now to enjoy the best value! (That's the sales pitch - I suck at that kind of thing.)

Get it from gum.co/becomingbetter. Join the book discussion here: moot.it/becomingbetter.

It would genuinely love to hear any feedback, praise or criticism that will help improve the book. Suggestions for topics to cover are also of real interest.

My honest hope is that this book does just what it says on the cover: helps many developers improve their skills, to become more productive programmers.

Buy it now!

Monday, 3 February 2014

Speaking: Words in Code (ACCU 2014)

I'll be speaking at this year's excellent ACCU Conference 2014.

This year my talk is: Words in Code, a technical (and not so technical) appraisal of how developers write. It's a practical distillation of my fourteen years as a magazine columnist, multiple book projects, and more.

Come and enjoy it on Thursday 10th April at 10am. The conference's earlybird booking deadline is February the 14th. ACCU is one of the highlights of my developer year - it's a truly excellent conference. If you've not considered going, check it out!

The full synopsis is available on the session page:
As software developers we do not just write code. We write many, many words too.
We write documentation, comments, manuals, specifications, technical articles, wiki documentation, and more. Maybe even magazine articles and books.
This talk discusses some practicalities of writing well, both stylistically and practically. We'll talk about prose, but also about the right "geek" way of writing, the storage formats, toolchains, and the storage of our words.
We'll cover:
  • writing style
  • what's appropriate: what to write what not to write
  • keeping track: "source control" for words
  • toolchains: what toolsets to use to write and prepare output
  • markup languages vs "wysiwyg" tools
  • sharing your words with non-geeks
At the end of this talk, you'll have a good idea how to put together an example "document toolchain" taking source-controlled words in a humane markup style, and creating high-quality HTML, PDF (fully styled, print-ready) ePub and Kindle output, as well as Word-friendly versions.

Thursday, 12 December 2013

Writing: The Ethical Programmer (Part 2)

My latest Becoming a Better Programmer column was published in the November CVu (25.5). It's the second part of my mini-series on The Ethical Programmer.

This instalment deals with our attitudes towards other people, and finally formulates our own Hippocodic Oath; the programmer's equivalent of the Hippocratic Oath.

Wednesday, 11 September 2013

Writing: The Ethical Programmer

The latest C Vu magazine from ACCU is out now. It contains my latest Becoming a Better Programer column. This month it's called The Ethical Programmer; the first instalment of a two-part series on ethics and the modern programmer. Gripping stuff.

This month, I look at our attitudes, at legal issues, and discuss software licenses.

To make the world a better place, you can enjoy a picture of some old rope, and a chicken. I also throw in some bad puns.

Monday, 24 June 2013

Speaking: Running Effective Rehearsals

I'll be speaking at The Worship Collective conference in Cambridge, UK on June 29th. This is an awesome event for musicians and worship leaders.

I'm leading a seminar entitled Running Effective Rehearsals. Obviously, this is a really practical subject, but I promise it'll be fun too. Hopefully there will be some practical wisdom to apply, and some encouraging advice to take away.

Monday, 13 May 2013

Writing: Bug Hunting

The latest  C Vu magazine from ACCU is out now. It contains my latest Becoming a Better Programer column. This month it's called Bug Hunting and, as you might guess, is about the art of debugging code.

This was inspired by conversations with Greg Law in the lead up to the 2013 ACCU conference.

Sunday, 12 May 2013

C++11: Iterating range-based for backwards


A few weeks ago we upgraded our toolchain with spangly new C++ compilers. Then we flipped the magical switch unleashing C++11 code features. This is a joyful apocalypse.

It's been fun transitioning to some of the new neater C++11 idioms.

Range-based for is one of the first things we adopted, largely due to the clear readability improvements it brings over tedious iterator type juggling.

Soon we stumbled on a shortcoming of range-based for. It allows you to iterate forwards with little syntax fluff, but not backwards. (We have many collections we "apply" by iterating forwards, and then "revert" by iterating backwards).

It's not too hard to iterate backwards in a reasonably readable way, by writing code like this:
for (const auto &i : backwards(collection))
{
    // ... use i ...
}
The simplest implementation of this is shown below:
template <typename T>
class iterate_backwards
{
public:
    explicit 
iterate_backwards(const T &t) : t(t) {}
    typename T::const_reverse_iterator begin() const { return t.rbegin(); }
    typename T::const_reverse_iterator end()   const { return t.rend(); }
private:
    const T &t;
};
template 
<typename T>
iterate_backwards backwards(const T &t)
{
    return 
iterate_backwards(t);
}
Of course, this is simplistic. It can be enhanced by making the class support C++11's move semantics, and allowing the wrapper function to return forwarded iterate_backwards. However, this wonderful new C++11 machinery serves to hide the simple intent somewhat, and doesn't win us much since this code optimises away neatly.

Perhaps there's a better way to do this? I've seen a few other solutions to this problem, but they don't read anywhere near as neatly, nor are they as straightforward to understand. I'm enjoying this new learning journey.

More iterator fun is to come...