Thursday, August 28, 2014

Why is it Called Coding?

This piece is a response to this morning's Facebook and scripting.com post, What "coder" means and why it's bad by Dave Winer. I originally wrote this as a Facebook comment and then posted it here on Mea Vita: Carpe Diem.


Dave, I read your Facebook post and scripting.com piece, What ‘coder’ means and why it's bad. I think you and I are seeing eye-to-eye.

Some might say we’re splitting hairs, but this distinction is important since good definitions make for clear ideas.

The terms coder is too generic to describe what we do. The problem is similar to a painter. The guy who paints my living room is a painter; and so is Frida Kahlo and Pablo Picasso. The former has to paint inside the box, the latter outside. While we also describe the latter as artists, that term also has problems since it's too broad.

What's the Difference?

Coding is what we do when we write code and it's what a writer does when s/he writes prose. But we are not coding when we design a database, develop an API, or architect a server farm. These tasks are more than coding, they’re engineering since we’re synergistically engineering software. The sum is greater than its parts.

I think all software engineers are coders, but all codes are not software engineers. Perhaps programmer and coder are closer synonyms. The problem with the term programmer is it's not specific enough. Programmers can also be DJs who strategize radio station formats. In an archaic sense, programmers used to also be people who set up manual programs to sell large amounts of stock (this is different than computer guided program trading).

Some companies put programmers in restrictive boxes by only allowing them to code to spec. It’s an assembly line that lacks innovation and squelches initiative. It's much like the painter I hire to paint my house who has no say in the color or pattern.

Coding just happens to be the most visible part of software engineering. It’s dynamic, mostly linear, and more tangible than an API or database schema, so that’s how the layperson describes it. Plus, it's a single word. It's much catchier to say, "I'm coding," vice "I'm software engineering."

PS – I noticed that I have a coding category on my blog, but I don't have a software engineering category. That's changing with this piece.

Thursday, August 14, 2014

Monitoring How Things Fail

As our world becomes more complex, things fail in ways we never expected. In the military, we trained for different scenarios so we had documented responses. I see much less of this scenario based training in high tech simply because it's too complex to cover critical, unimagined, failures. Grace Hopper captured this sentiment best when she said, "Life was simple before World War II. After that, we had systems."

This week I started reading a book I heard about on NPR, The Checklist Manifesto. The author, Atul Gawande, is an accomplished surgeon. He noticed that seemingly small, yet critical, bits of information were overlooked in the operating room. Borrowing from the experiences of airplane pilots, Dr. Gawande began using checklists before operating on patients resulting in fewer mistakes in the OR.

When I originally launched Adjix I encountered different ways that servers could fail. A few incidents stick out in my mind.

Don't Backup Onto Your Only Backup

Always have a working backup. This seems obvious. I noticed one of my Adjix servers had slow disk I/O – in other words it seemed that the hard drive was failing so I backed it up onto a backup drive. Unfortunately, the backup never completed. I was left with a failed server and an unstable, corrupted, backup copy. The important lesson I learned here was to rotate backups. Nowadays, this should be less of a problem with services like AWS.

A couple years later I saw a similar issue when I was consulting to a startup that maintained two database servers in a master/slave cluster. The hard drive on the master server was full causing their website to go down. Their lead developer logged into the master server and started freeing up space by deleting files and folders. In his haste, he deleted the live database. When he logged into the slave database he discovered that his delete command had replicated which deleted his slave database. Their last offline backup was a week old. He was fired as the rest of the team took spreadsheets from the operations and sales departments and did their best to rebuild the live database.

How Do You Define Failure?

Apple uses WebObjects which is the web app server that has powered the iTunes store and the online store since they were created. WebObjects included one of my favorite RDMS, OpenBase. The beauty of OpenBase was that it could handle up to 100 servers in a cluster and there was no concept of a master/slave. Any SQL written to one server would be replicated to the others within five seconds. This is very handy for load balancing.

OpenBase's process for clustering was elegantly simple. Each database server in the cluster was numbered, 1, 2, 3, etc. Each database would generate its own primary key, 1, 2, 3, etc. These two numbers were combined so that the number of the server was the least significant digit. For example, database server #8 would generate primary keys like 18, 28, 38, 48, etc. This ensured that each database server's primary keys were unique. The SQL was then shared with all the other databases in the cluster.

Here's where something looked better on paper than in the real world. If one of the servers failed, it would be removed from the cluster. The problem was, how do you define failure?

If one of the database servers was completely offline then that was clearly a failure. But, what if the hard drive was beginning to fail – to the point that a read or write operation might take 20 or 30 seconds to successfully complete? Technically, it hasn't failed, but the user experience on the web site would be horrible. One solution would be to set a timeout for the longest you'd expect an operation to take, say five seconds, and then alert a system admin when your timeout is exceeded.

Who Watches Who?

When I launched Epics3, I had to monitor an e-mail account for photo attachments. I used a Java library that implemented IMAP IDLE which is basically an e-mail push notification standard. Perhaps there was a limitation in the Java library I was using, but IDLE simply wasn't reliable in production. It would hang and my code had no way to detect the problem. My solution was to simply check the mail server for new e-mail every ten seconds. This was a luxury I had since my bandwidth wasn't metered and Gmail didn't mind my code frequently checking for new e-mail.

Like Adjix, Epics3 was a WebObjects Java app. WebObjects uses a daemon, wotaskd, that checks for lifebeats from my app. If the app stops responding, wotaskd kills it and restarts it. The problem I had is that my Java thread would sometimes hang when checking for new e-mail. The app was alive and well, but the e-mail check thread was hanging. The solution to this problem was to have the e-mail check thread update a timestamp in the application each time it checked for new e-mail. A separate thread would then check the timestamp in the app every few minutes. If it found that the timestamp was more than a few minutes old, the app would simply kill itself and wotaskd automatically restarted the app. This process worked perfectly, which was a relief.

Things don't always fail as we imagined so it's important to avoid a failure of imagination.

Wednesday, August 13, 2014

Welcome to Walgreens:
30 minutes here, 30 hours there.

Thanks for your patience.
I've been patronizing my local Walgreens (Store #: 6656) for the better part of a year. It's the people that work there who really make a difference. From the cashiers that always greet me when I walk in to the photo processing employees who provide stellar service with my photos, books, greeting cards, and canvas prints. I've been to a couple other Walgreens in the San Diego area and they seem on par with my local store.

Yesterday, I discovered that customer service is a different story on Long Island.

Tomorrow is my mother's birthday. I decided to print a custom card for her and have my sister pick it up. Instead of a 30 minute process it took 30 hours.

Yesterday, I uploaded the card and immediately received an order confirmation e-mail with an estimated completion time of about 45 minutes. A couple hours later I knew there was a problem when I hadn't received the confirmation e-mail that the greeting card had been printed. I called the Walgreens on Long Island and, after getting bounced between a couple departments, I finally spoke with an employee in the photo processing department. He told me, "We're printing them now." Ok, thanks, I told him – let me add that each person I spoke to had zero enthusiasm. But I still had a feeling things weren't going to work out well. This hunch comes from growing up on Long Island.

Two hours later I called back when I still hadn't received a confirmation that my greeting card had been printed. Once again I was bounced between a couple departments before getting a women in the photo processing department.

"Hi, I'm calling to check on the status of my photo order," I said.

"Our photo machine is down," replied the woman.

"Actually, it's not a photo. It's a greeting card," I said.

"Hold on," she said.

I was back on hold for a few minutes.

"This is Carl. How can I help you?" asked the manager.

"Hi Carl. I'm calling to check on the status of a greeting card that's being printed at your store," I said.

"We're out of paper. If we find any paper we'll call you back," said Carl.

I called my sister to tell her not to stop by Walgreens just yet.

About an hour later my sister texted me that she had received a call from the manager. Carl left a voicemail explaining that they couldn't process our order since they couldn't find any paper. End of message.

I called the Walgreens corporate customer service number and explained that my original Walgreens of choice was out of paper – I asked if the order could be changed to another Walgreens.

"Sure, no problem," said Rick at Walgreens's corporate call center.

Less than an hour later I received a print confirmation e-mail from the new Walgreens. One thing I've learned about Walgreens is that these confirmation e-mails are automatically generated when the order is printed. I've submitted orders while standing in the store and received my confirmation e-mail at the exact moment it was printed. It's a great system. In this case, a confirmation e-mail was also sent to my sister since I listed her as the person picking up my order:
Joe Moreno sent you a photo order that is ready for pickup at the Walgreens location shown below.
They are FREE of charge to you and are available for pickup under your name. Joe Moreno will be charged when you pick them up.
Please print and bring this email to this store. It will help us locate your order faster.
The final, unfolded, product, delivered.

Fast forward to today when my sister stopped by the new Walgreens to pickup our order. She texted me, "At Walgreens and they can't find them. They're looking."

Relax. Inhale. Hold it. Exhale.

I called my sister while she waited. She told me that she showed the confirmation e-mail to the employee but they still couldn't find the order. "I'll let you know what happens. Stay by the phone," she said as we hung up.

A few minutes later she texted me, "Got them!" She also sent me a couple photos of the card followed by, "Then they wanted me to pay." She had to explain that I, not her, should be charged. My sister sent me one final text message, "The guy told me it should have been folded, that's why he he couldn't find them."

Mission accomplished!

That wasn't so hard, was it?

What's the Point?

I belong to a business book club that brings in the authors for our monthly meeting. This gives us, the readers, some hidden insight including the story behind the story. Earlier this year, our book choice was Service Failure. This book highlights a key concept that I love which is to simply take a customer to complete satisfaction without passing the buck. The key, much like Apple or Nordstrom, is that leadership starts at the top. Outstanding customer service has to be in the DNA of the organization.

Monday, August 11, 2014

The Hidden Gems of San Diego

I've lived in San Diego, on and off, for close to 20 years and I'm always on the lookout for new places to explore. This past weekend I uncovered several gems.

Friday: Latino Film Festival


Instructions Not Included
Friday night's showing of Instructions Not Included at the Jacobs Center was a pleasant surprise, especially since I don't speak Spanish.

I highly recommend this English subtitled movie. It's the highest-grossing Spanish-language film released in the United States. This movie is an unpredictable comedy that will tug at your heartstrings so keep a tissue handy.

The Jacobs Center for Innovation community center is a hidden gem I'd never been to. I can see myself attending more events at this venue.




Saturday: Kate Sessions Park


Kate Sessions Park
Last week's celebration of coworking culminated with a BBQ at Kate Sessions Park. I've never been here before. It has panoramic views of downtown San Diego, including the Coronado Bay Bridge and Mission Bay. This would be the perfect place to watch Fourth of July fireworks or simply seek solitude and inspiration.





Sunday Morning: Black's Beach


The way to Black's Beach
In the mid-1990s I had a running mentor, Harry Hunt, at the Orange County Track Club. He talked me into my first ultra-marathon in 1996 – the 50K Mule Run in Bishop, California. On the roadtrip to Bishop, Harry told me about his experiences frolicking in waters of the Pacific at Black's Beach. For nearly 20 years this item was on my bucket list.

Getting to Black's Beach is not a casual walk in the park. It's a secluded beach requiring a hike down the cliffs beneath the Torrey Pines Glider Port. After all, one does need privacy in these matters. It seemed that nearly everyone at the beach was a content provider, but it is optional.

Swimming in the Pacific under these conditions is quite liberating. A few things stood out. First, the regulars are well groomed and have very even tans, especially compared to my farmer's tan. Second, there's simply no way to casually stand in knee-deep water without looking awkward. I was surprised how unnatural we look in our natural state. And, finally, I made no eye contact with my fellow frolickers – this takes some getting used to.

Sunday Afternoon: In the Heights


In the Heights
This musical, performed at the San Diego Junior Theatre in Balboa Park, was remarkable. At first I thought the performers were college students. After the intermission I learned that they were in high school or younger – one of the leads was only 13 years old. With beards and gray hair they looked like full grown adults. It was only after the play was over, when I met the cast, that I fully appreciated they were simply kids in makeup and costume.

Sunday Evening: Ice Cream Social


Beer floats made with Guinness
There's no better way to end a summer weekend than with my fellow co-workers from 3rd Space at an ice cream social where I tried my first beer float. To be honest, it was meh. It tasted like beer and ice cream mixed together. Imagine if a pancake tasted like flower, baking powder, milk, etc, instead of an actual pancake. But we were just winging it. I hear that my neighborhood chocolatier, Eclipse Chocolate, does justice to a beer float.

Finally, I have to thank Junvi, not only for photobombing my beer float picture, but also for the great Q&A write up she gave me last week.


Monday, August 4, 2014

Unable to Decode Playground Data

I've been coding in Xcode's Playground using Swift for the past two months. It seemed that my code was touching on an Xcode edge case causing it to stop evaluating with an error message: "Error running playground. Unable to decode playground data." I can tell where the problem is since the playground sidebar stops displaying output at the line of code that's choking. But I can't tell what the problem is.

The line of code having the problem is a function call at the end of a do..while loop. I initially thought my string manipulation was causing the issue since Swift strings are a little different than the Java NSString that I'm used to in WebObjects.

Narrating One's Work

I figured it might help if I wrote about my issue. Perhaps someone else is having the same problem. A quick Google search shows that a few people are encountering the same issue. But too few are having this problem to find a definitive solution other than chalking it up to an ongoing Xcode bug.

Almost There

I initially thought I had discovered the cause, earlier today, when I changed the half-open range operator to a closed range operator (i.e. I changed ...  to ..<). Once I made that change my playground compiled all the way to the end. But this was a short-lived victory when I restarted Xcode and the playground error returned. Toggling between the half-open and closed range operators at least gets my code to compile and run in the playground. So, perhaps I'm getting closer.


Saturday, August 2, 2014

Mariner 7 Foldable Electric Bicycle

Prodeco Mariner 7
Two years ago, I checked out my first foldable electric bike in Greenwich Village. I knew it was a matter of time before I bought one. That time arrived two weeks ago as I drove past the San Diego Electric Bike Company in Solana Beach. I made a U-turn, parked, and spent some time speaking with the company founder. Thirty minutes later I purchased a Prodeco Mariner 7 which began my love affair with e-bikes.

The Mariner 7 is a regular, foldable bike, with 20" tires that incorporate a front-wheel drive motor and battery. It easily folds up and fits in the trunk of my Honda Accord. The Florida based manufacturer advertises that the Mariner 7 will go 18 mph with a range of 25 – 35 miles. Of course, range and speed depend on my weight, terrain, and how much pedaling I do.

As the name implies, the Mariner 7 is intended for boat owners – it also works well for those who own planes and RVs. I can pedal it like any other eight-speed bike or use the throttle for some extra zip; or use both at the same time. Obviously, the less I use the motor, the further it'll go.

What I like about my e-bike is that I can ride it around San Diego without breaking a sweat while going up hills on warm days – and San Diego has its share of hills. My bike also draws a lot of attention. Two weeks ago I rode through Balboa Park and snapped some photos. Each time I stopped, people asked me questions about the bike.

Click to enlarge
The most interesting person to ask me about my bike was Rhonda. She seemed to know a bit about e-bikes when she asked me how I liked my Mariner 7. It turns out she and her husband have owned nine e-bikes and she knew all the San Diego e-bike companies and owners.

It's Rhonda's personal story that fascinated me. She used to weigh 457 pounds and lost more than 270 pounds over the past two and a half years. An impressive, transformational achievement.

Friday, August 1, 2014

Must Have Better TV

I spent today dog sitting at a buddy's house while he took his family to Universal Studios. He has AT&T U-verse with many, many channels. I haven't channel surfed TV in over a year.

In 2002 I hooked up a new TV to cable and let it automatically block out any channels that weren't broadcasting between channels 2 and 72. A decade later, more than ten of those channels were no longer broadcasting. The cable company kept moving channels above 72 to encourage their customers to forgo analog cable for digital TV.

On weekend mornings, more than a dozen of the remaining channels were broadcasting infomercials for weight loss and get rich quick products.

Why was I paying to see infomercials?

Unbundle Cable TV

Without a doubt, consumers would love to unbundle TV channels much like music albums. I'd really like to pay for, say, CNBC, CNN, KUSI, Spike, etc, without having to pay for QVC or channels broadcasting in languages I don't understand.

Ari Emanuel is a Hollywood talent agent who is is strongly against unbundling cable TV channels. In other words he doesn't want to give consumers the ability to pick, à la carte, which channels they want to pay for. Ari Emanuel spoke about this at D10:
Overall, from subscriptions to advertising, the market is about $100 billion now, while moving to à la carte pricing might only get $40 billion, which would be a major inhibitor [of developing premium content].
Basically, Ari Emanuel reasons that if the market shrinks so will the quality of the content like Hollywood movies and TV shows. Maybe. Maybe not. But Ari is one of those guys who you might say is a tad arrogant (see the end of my digression video below).

Companies like Netflix, Amazon, and Apple have been trying to unbundle channels but it has been a uphill battle. Unbundled content like House of Cards or Comedians in Cars Getting Coffee is rare. Eddy Cue once told us at a meeting that getting content from the music and TV industries onto iTunes was "simple" compared to the film industry. He said that the film industry was the most business savvy of them all since movies were sold to theaters, TV, cable, DVD, airlines, military, etc, for a very long time.

Perhaps, one day, we'll be able to pick the channels we want to pay for.

Digression...

Ari Emanuel is the brother of President Obama's former chief of staff, Rahm Emanuel, who is now the mayor of Chicago. A fictionalization of Ari Emanuel is played by the character Ari Gold (Jeremy Piven), in the HBO series Entourage. It's funny to watch Ari Gold bash others, like his assistant Lloyd, on the TV show. But, it's a bit uncomfortable to watch the real life Ari Emanuel tell people to shut up and sit down like he does in this Q&A panel.