In this article I'll go into some fuzziness that we often encounter in the everyday world, that's often missing in the world of computers. Unfortunately we're used to this fuzziness, and so its lack can make computers hard to use. Star Trek shields I remember watching episodes of Star Trek where the Enterprise was in … Continue reading ‘Roughly’ and ‘better’ can help usability
Category: Coding
Modularisation – coupling and cohesion
This is related to the second of the things requested by Jesper, which was encapsulation. Encapsulation is a tool to use when designing software. It’s a bit abstract, and I don’t think people always agree on what it means. To me, encapsulation is part of the bigger term modularisation, which doesn’t immediately help because it’s … Continue reading Modularisation – coupling and cohesion
Exceptions 4: Finishing up
This is the last article in a series about exceptions: BasicsTypes and filteringWhere to put catch blocks and handle exceptionsFinishing up Exceptions are an example of the Chain of Responsibility pattern.Image credit Finally If the code in the try block needs tidying up (e.g. it opens files, that will need closing at some point), then … Continue reading Exceptions 4: Finishing up
Exceptions 3: Where to put catch blocks and handle exceptions
This is the third article in a series about exceptions: BasicsTypes and filteringWhere to put catch blocks and handle exceptionsFinishing up Where your catch blocks are and where exceptions are dealt with matters - probably best to avoid sticking a pin into your code randomly to choose the spot.Image credit The location of catch blocks … Continue reading Exceptions 3: Where to put catch blocks and handle exceptions
Exceptions 2: Types and filtering
This is the second article in a series about exceptions: BasicsTypes and filteringWhere to put catch blocks and handle exceptionsFinishing up You can filter which exceptions a given catch block deals with.Image credit. Type hierarchy for exceptions As I said in the previous article, an exception is an object with a particular type. Often, in … Continue reading Exceptions 2: Types and filtering
Exceptions 1: Basics
This is the first of two things requested by Jesper. Please visit his blog for wisdom about testing, business strategy and things like that. I’m not always available for weddings and bar mitzvahs, but if anyone else has requests or suggestions for the blog, please let me know via the Contact page. This started off … Continue reading Exceptions 1: Basics
Recursion and iteration – loop unrolling
This article is part of a series on recursion and iteration: Introduction to iterationIntroduction to recursionMutual recursion and tail recursionBlurring the linesLoop unrolling In this article I will talk about loop unrolling, and the wonder / horror that is Duff's device. Image credit Loop unrolling Loop unrolling is something to do only when you're very … Continue reading Recursion and iteration – loop unrolling
Recursion and iteration – blurring the lines
This article is part of a series on recursion and iteration Introduction to iterationIntroduction to recursionMutual recursion and tail recursionBlurring the linesLoop unrolling In this article I will look at how the lines between iteration and recursion can get a bit blurry. This breaks down into three areas: Iteration = fast, recursion = slow isn't … Continue reading Recursion and iteration – blurring the lines
Recursion and iteration – mutual recursion and tail recursion
This is part of a series of articles about iteration and recursion. Introduction to iterationIntroduction to recursionMutual recursion and tail recursionBlurring the linesLoop unrolling I have covered the basics of recursion in a previous article. In this article I will go onto two more advanced, rare and obscure versions of recursion - mutual recursion and … Continue reading Recursion and iteration – mutual recursion and tail recursion
Recursion and iteration – an introduction to recursion
This is the second article in a series about recursion and iteration. Introduction to iterationIntroduction to recursionMutual recursion and tail recursionBlurring the linesLoop unrolling I will assume that you have already read the article on iteration, and this article will focus on recursion. Like iteration, recursion is a way of repeatedly doing the same or … Continue reading Recursion and iteration – an introduction to recursion