Books -> Digital -> Subscriptions

As a 10 year old I read 100 books in a single summer. I’d read on the bus, at lunch, and waiting for soccer games to start. Ended up with a healthy bookshelf. When I switched to programming in the 90s I swept the bookstores at least once a week picking up books on Perl, Javascript, CGI, HTML.

Eventually I filled up several bookshelves with my technical library. When I picked up a first generation iPad I decided it was time to go all digital. I had experimented with Safari online, but it was never a replacement for my library. I went cold turkey with buying paper books. At this point I was mostly purchasing a lot of pragprog titles and transferring them to iBooks. And beta books don’t ship in paper.

A few weeks ago I realized I had moved to a subscription model. Now I just download my books from pragprog when I need them. No need to keep a bunch of titles in my library when I can pull down the up to date versions. I can also read them on my laptop, iPad, or iPhone anytime I want with a nice retina screen.

Debugging SSH on Mac OS X

As a developer SSH is something I have to think about maybe once every few months when I’m setting up a connection for someone pairing in tmux for example. Cutting and pasting public keys can cost real time when a line feed gets inserted inadvertently or something gets clipped.

So assuming ssh isn’t working and you can’t connect it turns out there’s a pretty helpful debug mode on the client and the server. For the client you simply add the -v mode and get a pretty good idea about what’s going on:

ssh -v tmux@10.0.1.4 -i ~/.ssh/tmux_ssh

If that isn’t enough then you can just launch another ssh service on another port in debug mode.

sudo /usr/sbin/sshd -d -p 4444

Then you can just connect your client to the debugging server with a port specification:

ssh -v -p 4444 tmux@10.0.1.4 -i ~/.ssh/tmux_ssh

From that you should be able to get enough information to quickly debug the problem.

(My first experience with SSH was way back in 2000 when our 16 year old Unix sysadmin switched all the developers to SSH from raw telnet overnight because he could. All of us were on Windows or Classic Mac OS back then without any default SSH client software, and it cost us at least a day of pain to get everyone back to work.)

Ternary Operator Guidelines

Short conversation at the office today. I declared that I wasn’t a big fan of ternaries and that I typically used them only for simple one line statements and almost never in returns and never nested. One of the developers challenged me on why the ternary operator is frowned on and I admitted I didn’t have much in the way of data. After some digging on the interwebs.

Github’s style guide has the most common approach to the ternary:

“Avoid the ternary operator (?:) except in cases where all expressions are extremely trivial.”

Github style guide

Support for using ternary’s in return statements is generally supported as well. There is general agreement that nesting ternaries is a bad practice. Static analyzers like Rubocop and Checkstyle include checks for nested ternary operators.

Historically ternary operators bothered me because I missed them sometimes when scanning through code. If and else are hard to miss on a quick scan. I’ve adjusted to using them for one simple one liners as the terseness is nice. Nesting them strikes me as abuse, much like single letter variables or predicates methods that have side effects.

Lucky Rubber Duck

I’ve had a pretty good run of luck grabbing a colleague to look at my code. The last four or five times it’s been a classic rubber duck case.

Me: So here I’m stubbing out the partials in this view spec since I only want to test this conditional logic.

Colleague: OK.

Me: So it keeps failing when I stub the partials and pulling the in anyway even though it works in similar cases. See I’m just pulling in ‘/users’.

Me: Oh, I probably don’t need that forward slash in users.

Me: Thanks again.

If you don’t regularly grab someone to look over your shoulder on a frustrating problem, you might want to start the practice. You can even use a real rubber duck and explain it to them, but for me it seems to work better with a real person.

Enterprise Architecture in An Agile World

In fact, your own ability to keep up with the latest trends have suffered because only you know how to keep things working. To help manage time, you have implemented universal standards and tried to funnel requests to architecture review boards or other planned meetings. Developers routinely work around the system, complaining that process holds them back, but you know that these things are there for the good of the company so you reinforce the policy to try to keep control.

Kevin Hickey

This is a good general description of several EA groups I’ve worked with in past companies. The EA is often far away from the day to day of development and looks to keep control by implementing layers of controls. Not much different then change control boards that attempt to stop change by adding a meeting/paperwork tax to any request. This is where so many EAs fail to add any value and end up becoming another impediment to producing working software. I hope this is changing as Agile has moved to the mainstream, but I fear it is not the case.