The Fairway Technologies Blog

blog

Recent Posts

May 8, 2018 | Ray Mitchell

My Top 5 Tools for Software Consultants

Doing software consulting day in and day out involves many tasks including client communication and software development. Like many people, I’ve found a set of tools that are indispensable in keeping me organized and productive. I thought I’d share these in the hopes that they might help someone else. Here they are in no particular order:

September 20, 2012 | Ray Mitchell

Thinking Recursively

At Fairway we have a weekly lunch get-together called Code Club where we discuss interesting computing problems and share solutions in whatever language we choose.  The majority of the problems we’ve been solving come from Project Euler (http://projecteuler.net/) and the S-99 (http://aperiodic.net/phil/scala/s-99/).

Tower of Hanoi

Our most recent problem was to solve the Tower of Hanoi (http://en.wikipedia.org/wiki/Tower_of_Hanoi).  The Tower of Hanoi is a puzzle in which there are 4 disks of decreasing size.  These disks start stacked on the leftmost of three rods.  The goal is to move all of the disks to the rightmost rod by moving one disk at a time and obeying the only rule of the game – no disk may be placed on top of a smaller disk.

Here is the starting point of the game:

 

Here is the completed puzzle:

The following link contains a nice animation showing how to solve the puzzle: http://www.mathsisfun.com/games/towerofhanoi.html.

April 20, 2012 | Ray Mitchell

The Little Schemer

I recently finished reading a great book called The Little Schemer.

March 23, 2012 | Ray Mitchell

Prefix vs. Postfix Increment and Decrement Operators in C++

Here is how most programmers new to C-based languages are taught to write for a loop:

for (int i = 0; i < someValue; i++) {
// Do something
}

Unfortunately this starts programmers off on the wrong foot by teaching them the bad habit of using i++ (postfix increment) as the default way to increment a value.  Using ++i (prefix increment) would work just as well since the result of the increment expression is not used by the containing expression (the for loop).  Here is the equivalent code using ++i1:

for (int i = 0; i < someValue; ++i) {
// Do something
}

It's preferable to use prefix increment when the result of the increment is not used by the containing expression.  To see why, let's first take a look at what the compiler generates when it encounters i++ and ++i.

March 2, 2012 | Ray Mitchell

Reference vs. pointer parameters in C++

Reference and Pointer Parameters

A question that often arises when working with C++ is whether it's better to use references or pointers for function parameters.  Both types of parameters provide the ability for a function to indirectly access an object in the calling environment.  This indirect access provides several benefits:

  1. The object referred/pointed to by the argument does not need to be copied in order for the function to have access to that object's value
  2. The function can directly modify the object referred/pointed to by the argument
  3. The function can take parameters of types that do not allow copying

January 13, 2012 | Ray Mitchell

Generating Software Diagrams

Introduction

In this post I'm going to describe how to automatically generate diagrams from source code.  I've found that diagrams provide the quickest path to understanding how a piece of software works.  Diagrams also provide a great means to discuss software at a high level.  They've proven invaluable in the software development and software consulting work I've done.

Often diagrams are created by hand.  Unfortunately hand-crafted diagrams are prone to manual mistakes and falling out-of-sync as the source code changes.  Many IDE's can automatically generate diagrams from source code on the fly, but sometimes your IDE doesn't provide the diagrams or options you want.  Being able to generate your own diagrams will give you the ability to create exactly what you need when you need it.

New Call-to-action

Sign Up For Our Monthly Newsletter

New Call-to-action