New Book: Becoming a Better Programmer

Pete Goodliffe from Pete Goodliffe

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!

Mutable structs in C#

Frances Buontempo from BuontempoConsulting

We know what this does, right?

    struct Pricer
    {
        public double Price;
        public long Size;

        public void AddExecution(long lastSize, double lastPrice)
        {
            Price = (Price * Size + lastSize * lastPrice) / (Size + lastSize);
            Size += lastSize;
        }
    }

    class PriceData
    {
        public Pricer pricer;
    }

    class Program
    {
        static void Main(string[] args)
        {
            Pricer price = new Pricer{Price = 0.0, Size = 0};
            for (int i = 0; i < 5; ++i)
            {
                Console.WriteLine("{0} {1}", price.Price, price.Size);
                price.AddExecution(1, 2.5 * (i + 1));
            }

            for (int i = 0; i < 5; ++i)
            {
                Console.WriteLine("{0} {1}", price.Price, price.Size);
                price.Price= 2.5 * (i + 1);
            }

            PriceData priceData = new PriceData();
            priceData.pricer = price;
            for (int i = 0; i < 5; ++i)
            {
                Console.WriteLine("{0} {1}", price.Price, price.Size);
                priceData.pricer.AddExecution(1, 2.5 * (i + 1));
            }
       }
    }

Eric Lippert tells us about mutating *readonly* structs: http://blogs.msdn.com/b/ericlippert/archive/2008/05/14/mutating-readonly-structs.aspx but even non-readonly structs can get us in a mess.

Speaking: Words in Code (ACCU 2014)

Pete Goodliffe from Pete Goodliffe

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.