To quote the refactoring pioneer, Martin Fowler:
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Improving the readability of your code will enhance its usability for your future self and for other developers. In this post I’ll teach you a technique I use when programming that will make your code read more like English. When your code reads more like English, you will need fewer comments to document your methods. Instead of explicitly writing comment blocks that describe what a method does, you will express those comments in the way you name your methods and in the way you compose your method calls.
iCloud Drive is available as a folder in the Finder on Mac OS X Yosemite (10.10) and later. However, iCloud Drive doesn’t act like a normal Finder folder, which is problematic when you want to work with iCloud Drive in the Terminal app:
- iCloud Drive is not listed as a folder in your home folder
- You can’t drag the iCloud Drive icon at the top of a Finder window onto the Terminal to copy and paste its path
All developers know the frustration of finding out that once functioning code no longer works. This can happen when your previously working Twitter API application no longer connects to the Twitter API because of an authentication failure. In this post I’ll show you how to solve a common cause of Twitter API application authentication failures.
This post describes a double-ended bar chart that compactly visualizes two numeric values in a single table cell. Visualizing a column of values with double-ended bar charts makes it easy to see trends and outliers in the data.
This post describes a method for identifying whether a data set is composed of categorical values. Automatically identifying whether a data set contains categorical values enables applications to make use of such data without requiring users to supply this information.
This post introduces a plugin I developed to embed responsive YouTube videos in Jekyll websites. Jekyll is a static website generator that is extended with plugins written in Ruby. Responsive videos automatically adjust their dimensions to fit the HTML element in which they are embedded, even when the size of that element changes. Furthermore, the dimensions of responsive videos always maintain the aspect ratio.
Designing a user interface for capturing credit card expiry dates is an interesting, multifaceted problem. To work though this problem, we need to ask three questions:
- What default values should be used for the expiry date?
- What are the opportunities for users to make errors when transcribing the expiry date from the card to the user interface?
- How can we support data entry by reducing the cognitive load on users to help prevent errors?
This posts explains how to use transparency to visualise information density. When visualising geocoded data points on a map, for example, it’s common to plot each location with a marker. When many data points are located in the same geographical area, the markers drawn later will overlay the markers drawn earlier. When the markers are opaque, it’s difficult to tell at a glance how many data points are located in each region. The following example shows geocoded tweets authored about the Boston marathon.
This post explains why you should use animation to help users notice changes in your user interface. When interacting with software, users focus on the task they want to perform, not on the software itself. As a result, some users just don’t notice UI changes that occur in one descrete step, even if they caused those changes. For example, I’ve been at usability tests where users didn’t realise that a sidebar pane was opening or closing even when those users repeatedly clicked on the toggle button to open and close the pane.
It’s always nice to discover new functionality in interactive systems, especially when watching people use such systems in the wild. When travelling in an elevator, I recently saw a nice solution to the main problem with elevator user interfaces: how to deselect a mistakenly pressed floor button.