Tinobox - tinobox.com
General Information:
Latest News:
Test-driven development: structuring workflow 20 Jan 2013 | 10:17 pm
Test driven development (TDD) is perceived as being much more difficult than writing programs without tests. It’s true that it is more difficult. It’s not true that it’s much more difficult. It is, ho...
Vending machines Vegas style 19 Jan 2013 | 10:24 pm
I’m skimming Hoare’s Communicating Sequential Processes, a rather technical book on concurrency. One of the examples discusses a vending machine providing a food sample first, before payment. The vend...
Constructors should set state, nothing more 4 Jan 2013 | 04:25 am
If a constructor has to do a lot of processing to set its initial state, that’s a code smell. When a constructor is used for the main processing part of a class, such the code requires an instance of ...
Design rule of thumb: 1 loop per method 20 Oct 2012 | 08:03 am
Here’s a great little guideline for writing testable code: limit the number of loops in any function or method to 1 at each level of nesting. Consider the following function with two “top level” loops...
The is pattern for queries 27 Jul 2012 | 09:42 am
One way to partition functionality within classes is to separate command (mutate) actions from query (inspect) actions. Query actions have a number of well-established naming conventions. Let’s exami...
Naming functions and methods 15 May 2012 | 02:13 am
Function and method naming is not terribly difficult if the following two guidelines are observed: Query functions return stuff. For example, new, create, get are all functions which ask for somethin...
Good reason to learn Java, C/C++ 27 Apr 2012 | 03:07 am
C, C++ and Java may seem simply annoyances to programmers weened on scripting languages. But learning one or more of these languages is worthwhile, for many reasons. One reason is this: Vast amounts ...
Learning to test-first 11 Apr 2012 | 09:13 am
If you didn’t learn it that way, test-first isn’t the easiest way to program. But it can be learned. Write the code you’re going to write anyway. Test your just-written code thoroughly. Keep your ...
Testing: clients will pay now or pay later 8 Apr 2012 | 11:46 pm
A former freelancer sends a message to a programming email list, explaining his full time job doesn’t give him enough time to update his former client’s website. And it’s on an obsolete and soon-to-be...
How to finish a project 7 Apr 2012 | 07:45 am
Finishing a project is not hard. Finishing might be really boring, but it’s in no way difficult. Here’s how to finish those projects: Do all the work. Publish what you did, like write a blog post ...