This is the second of the things requested by Jesper. To me, the software engineering term encapsulation is part of the bigger term modularisation. Modularisation is chopping a big lump of code into smaller parts or modules. It’s important to get the boundaries between parts in the right place. Once there are modules, they can … Continue reading Encapsulation
Category: Computer theory
Modularisation – cohesion at many levels
This article builds on the previous article, so if you are new to the terms coupling and cohesion as they apply to software, please look at that first. In this article I’m going to look at cohesion as it applies to methods (or functions, if that’s what you call such things). Specifically, I’m going to … Continue reading Modularisation – cohesion at many levels
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
Comparing regular expressions and finite state machines
This is the last in a series about regular expressions and finite state machines Regular expressionsFinite state machinesComparing regular expressions and finite state machines In this article I won’t be introduce any big new things, but instead I’ll be showing how two things I’ve already discussed in the previous two articles relate to each other. … Continue reading Comparing regular expressions and finite state machines
Finite state machines
This is the second article in a series about some classic computer science: Regular expressionsFinite state machinesComparing regular expressions and finite state machines Finite state machines are a way of checking that a series of inputs is valid, potentially doing some actions while you’re doing this checking. They’re not something I use all that often, … Continue reading Finite state machines
Regular expressions
This is the first article in a short series on some classic bits of computer science, which are occasionally useful in professional programming: Regular expressionsFinite state machinesComparing regular expressions and finite state machines A useful tool with a bad reputation Regular expressions are a way to define a set of 0 or more text strings … Continue reading Regular expressions