SOILD: new object oriented design principles.

Is your object oriented design soiled?


S = Slippery. The class should be so abstract that’s its responsibility – or even better responsibilities (plural) – should be hard to pin down.
O = Open. The class should be open…to everything! Public. Free as in beer. You get the idea.
I = Interface. Integrate your interface. Turn those fa├žades upside-down.
L = LISP. All braces in your code should be replaceable by parenthesis.
D = Dependency. See poem below.

No class is an Island, entire of itself; every class is a piece of the Code, a part of the main(); if a clod be washed away by the sea, The Bay Area is the less, as well as if Oakland were, as well as if an old warehouse of thy startup or the Apple Spaceship Campus were; any freed object diminishes the app, because the app is involved in the Framework; And therefore never send to know for whom the compiler warns; It warns for thee.


OS X display preferences and melatonin suppression from cool/blue/white light.

If you search around you will find enough scientific articles explaining how light with cool color temperatures (lots of blue wavelength) suppresses the human brain's production of melatonin. Melatonin, of course, is a hormone needed for a good night of sleep. This fact impacts those of us who may be in front of LCD screens just before or well after midnight.

One way to help with this is to switch your monitor's settings to a warm color temperature. I noticed that some folks are selling apps for OS X so that you can make this adjustment. Well, there is no reason to download or buy an app.

Go to System Preferences : Displays and select the Color tab. Then tap the Calibrate button to create a new profile. When it comes time to "Select a target white point" choose D50 Warm yellowish white. Save the profile with a memorable name, and then when you are coding after sunset, switch to the warm color temperature profile.


Cocoa documentation has an image that tickles me.

It is from the Cocoa Core Competencies document, in the section "Object Creation". I like explaining things by analogy, perhaps too much because my analogies do not always work. I think this one gets the point across. It is understandable across all modern computer-using Earth cultures. I like it. It is effective and well done.

However, I would display the resource picture as bills of currency and the allocation as the individual ingredients, and I would remove the dough mixer. The resource is the computer's memory, not your code pieces and data parts (ingredients). Allocation is when you claim some memory and fill it with your code and data (convert your currency into flour, salt, yeast, and water). The way the analogy is now, it doesn't emphasize enough the conversion of a homogenous limited resource (memory/money) into a useful item. In fact, it shows that your methods and instance variables (flour and yeast) are the resource, and they aren't.

I don't think my imagined changes would help a beginner understand OOD/OOP better. I just think it would make the analogy more accurate. Are computer engineering basics taught to computer programmers these days? If yes then perhaps a more accurate analogy would help after all.

Has anyone written a class that has an initWithTemperature: method?


Stop using icons.

I am writing this in the month of July in the year two thousand fourteen of Anno Domini / Common Era.

I was using Google Chrome 35.0.1916.153 and Mac OS X 10.9.4.

I clicked a link in Chrome pointing to a PDF file. The file displayed in a Chrome tab. I just wanted to save it locally. This floating toolbar was in the bottom right corner of the screen.

I recall the era of the 3½ inch floppy disk. As a teenager, I used 5¼ inch floppy disks to load programs into my Atari 800. In the 90s, we used Zip drives and later Jazz drives.

But come on! I had to hesitate far too long hovering over that button (with no tooltip) wondering if it meant what I hoped it meant. I was also anxious it would do something destructive and annoying to reverse.

I think my pause was due to two factors: I had not seen a floppy disk in so long that I was not sure if the silhouette matched one, and I was in disbelief that a modern UI designer would use this image to represent "save".

The only icons I recognize on that toolbar are zoom out and zoom in. I've got a crazy solution. Look at my Gmail message-level toolbar.


My image editor for Mac OS X is now Acorn.

I moved from Linux to OS X years ago, but I still kept going to GIMP for image editing. Keep in mind that only in the last year or so has GIMP become Cocoa-native. Prior to that it required an X11 runtime that was available as an installable extra from Apple.

Running GIMP inside X11 on OS X looked poor with the antiquated GTK+ widget set. The runtime situation made it impossible to directly Alt+Tab to GIMP; the X11 process would gain focus instead. The GIMP shortcut keys used Control instead of Command. There we other quirks I cannot remember now.

When GIMP become Cocoa-native, I was relieved. But a keyboard focus bug caused text entered into text fields to be interpreted as Alt+Key strokes, which are shortcut keys for menu items. Fine, so I disabled all shortcut keys in the app and did everything solely from touchpad clicks. In the next version, that bug got fixed but not the bug that fails to order files by name properly.

Yesterday, in GIMP, I was trying to figure out why I could not select a layer in the Layer dialog. I had already converted my floating selection to a new layer, so what could be the problem? GIMP hung as I poked around, and I had to force quit it. At that point, I decided to buy an image editor.

I had previously researched other image editors for Mac OS X, but the different choices were daunting. The review articles I had found were either outdated or incomplete (missing a prominent application). Finally, in a bogus article which I will not link to, several comments to that article recommended Acorn. I took a look at the feature list of Acorn, and I was impressed. It only cost $30, and I trust the crowd more than a self-appointed authority on those user-generated content repositories, so I bought it.

What a huge difference! I am still in the process of kicking myself for being so foolish as to not leave GIMP earlier. I rate GIMP's ease-of-use at 3 (out of 10). I rate Acorn's at 9 (because nothing is perfect). Exploring Acorn to figure out how to do something is fast, simple, and straightforward. I had to look up how to add to a selection, and the Acorn documentation is up-to-date and complete with good search results.

And that brings me to what really struck me about the difference. In GIMP I had seen the different selection method (add, subtract, union) mini-buttons before, but until Acorn it was all just so much clutter in my face that I never thought about what to do with those buttons. So suddenly, because of Acorn's superior UI design and full documentation, my skills as an editor of images have increased.

For those of you thinking I should use Photoshop, Photoshop Lightroom, or Photoshop Elements: just no, guys. I think I tried out Lightroom, and what a convoluted mess. The install was odd somehow. The look and feel was that wannabe nouveau Adobe Flex. It tried to take over my Mac by asking me about all my images and whatnot. And the UI was like advanced GIMP. I went running back to GIMP very quickly. The next time I tried to give Lightroom another chance my trail period had expired, and I decided it was not worth it to pursue again.

To those who might think this product review was unfair: I did not set out to write a product review when I started using PS Lightroom, Acorn, or GIMP. I'm just a guy who used GIMP on OS X for far too long, and I used the immense power of an inference engine that I keep stored in my skull, and the output I got from the input provided lead me to spend $30 on Acorn, and I'm very happy with that decision. In fact, I'm so pleased that I wrote this blog entry about it.


My iPad app is available: Veronica's Garden Tracker.

Please tell every gardener you know about Veronica's Garden Tracker for iPad. Thanks!

I aimed to create a simple, visual journal for home vegetable gardens. I got the idea when I asked my wife a few years back, "Sweetie, what is this sprouting here?" and she had forgotten and her labels were missing, so we had to wait a few weeks until the plants got bigger to find the answer.

Google AdWords redeem coupon code screen has moved.

It took me a bit to find the new location to redeem those promotional codes that Google hands out to lure in folks like me into using AdWords. All the blogs out there talk about the old, easier-to-find location. Even the email that contains the promo code itself is wrong.
  1. Starting from AdWords home.
  2. Click gear icon in upper right.
  3. Click Billing from drop down menu.
  4. Click Transaction history.
  5. Click More Actions button.
  6. Click Apply a promotional code from the drop down menu.
  7. And there you are!