Wednesday, March 23, 2016

The end of the mouse era

Doug Englebart invented the computer mouse nearly 50 years ago. Before HD, before GPU, before UX, the mouse let people interact with an information rich virtual space with ease.

The generation whose work productivity preceded the mouse are retiring. Today's work force learned young or grew up with computer mice. We are comfortable with them. But the plunging cost of touch screen, the integration of draw-capable technologies in underlying OS, and the rise of hand-held form factor computing all spell the end of the mouse age.

Our generation may find it difficult to imagine a world without mice. But consider, if price were not an object, would you rather have a mouse or a touch screen?

Fundamentally, a mouse is the wrong tool for the job. If you want to select, move, shrink or otherwise manipulate windows, keyboard chords provide the necessary precision and do not change your locus of attention. If you want to scroll, page and cursor keys provide two resolutions of movement. If you want to draw a freehand shape, a touch screen or a digitizing tablet offers measurably better precision.

In the future, we'll see a world without mice. A world with keyboards and touch screens. When economic factors allow cheap, ubiquitous touch input, mice commodity will become a novelty. Good riddance I say.


Addendum
I was just asked how I navigate web pages without a mouse. The answer: vimium. Since I use vi, this is a natural move more me. Props to mjmccull for introducing this extension to me years ago. Read up on vimium in this quick guide.

Bonus
Did you know that Windows+B+Enter opens the Windows system tray? Here's a running list of Windows 10 keyboard shortcuts to help you cut your mouse cord.
Shortcut Key CombinationAction or Effect
Windows+B+EnterRaise the Windows system tray. Use your cursor keys to navigate the tray icons
Windows+Shift+RightMove the active window right. Try also with the left cursor key.

Thursday, March 3, 2016

Evoking all possible test failure modes in PHPUnit

When you're writing your own PHPUnit test listener, you need a test case that evokes all the different PHPUnit test states. Here's you go:
<?php
class EvokesTest extends \PHPUnit_Framework_TestCase
{
    public function test_pass()
    {
    }

    public function test_fail()
    {
        $this->fail(__FUNCTION__);
    }

    public function test_error()
    {
        throw new \RuntimeException(__FUNCTION__);
    }

    public function test_skipped()
    {
        $this->markTestSkipped(__FUNCTION__);
    }

    public function test_incomplete()
    {
        $this->markTestIncomplete(__FUNCTION__);
    }

    public function test_risky()
    {
        throw new \PHPUnit_Framework_RiskyTestError;
    }
}