Balance Programming

  • Missing operator

    A couple of weeks ago I was talking about error handling and one option using. short-circuit logic. It had lines that looked like this: But why couldn’t they look like this: While you might understand what that means C++ doesn’t, very few languages do. Short-circuit logic The normal logic operators we deal with are and,…

  • The Law of Demeter

    I’ve been doing some more reading and came across the Law of Demeter and train wrecks again. The last time while while reading Clean Code. I’ve one book that tells me this is bad practice: And that I should do this instead: My feeling was to prefer the first as more compact here and it…

  • Error handling

    I’ve used a few different error handling techniques since university. Over the last few years a couple of other options have appeared. Lets take a simple problem and see how it works with all of them. A simple problem Let’s say we want to read a text file containing a list of dates and return…

  • Choosing Wren?

    One of my friends was thinking about Wren earlier in the year to run scripts in a game engine. It was created by Bob Nystrom who wrote Game Programming Patterns which I reviewed earlier. I thought Wren looked interesting so it went on my list of topics to explore. The language It describes itself: Think…

  • Calling functions

    I was recently talking about clang-tidy. One of the performance checks it can run is unnecessary-value-param. This makes sense, accidentally passing a big array by value rather than by reference can invisibly ruin the code performance. The rule was pretty easy though, pass simple types by value and everything else by reference. Then along came…

  • The Checklist Manifesto

    The Checklist Manifesto is a book from 2010 by author Atual Gawande, an American surgeon and public health researcher. I read it a while ago and it reinforces my belief that we all make mistakes. Unsurprisingly the book is all about checklists. It may not sound like much it can be a great help in…

  • Saving pennies

    Imagine your shopping at a different supermarket from normal. You notice that baked beans are 3p per tin cheaper than you’re use to. The news had a story about supermarket price wars on basic goods recently. It’s a bit out of your way but if you switch supermarkets you could save money on beans each…

  • API lock-in

    When C# first came out it didn’t have generics, that didn’t come out until version 2.0. That meant that, say, the user interface APIs either had to deal with collections of unknown objects or be use custom written collections. If they did one you don’t know what object you have; if you do the other…

  • Retrospective 27-52

    I managed to get 26 posts in 3 months but 52 posts has taken me more than 8 months. I’ve slowed down but that’s okay. My schedule has been regular which is probably better in the long run. I’ve never managed to get hugely ahead of schedule though. I think I’ve written a one or…

  • PowerPoint misfit

    I’m not a PowerPoint expert. I occasionally have to do presentation to colleagues but it’s not a regular part of my job. The discovery of a markdown to PowerPoint converters I’m probably going to use the PowerPoint editor even less. I normally most interested in the information, a bit of text and a few bullet…