How to suck at programming #D – Build a terrible web experience

You have a home grown site devoted to delivering information. Maybe this information is news-like containing important product updates or company statuses and decisions. Maybe the information is more comical like attire articles bashing celebrities. Whatever the case, your site is rather important to people on the other side of the internet. These other-side people wish to download your content using the typical web browser. Hi, I’m Cliff. You’re here because you suck at programming. I’m here because I’m not much better. Together we can all learn how to build a decent web experience by example of what not to do. That’s the general idea. Now, back to our story.

Your site begins to trickle in visitors. First there are a few in your immediate LinkedIn or Google plus circle that know you. Then there are more stragglers arriving by word of mouth. You eventually reach what you deem to be critical mass of 75 unique visitors a day! Time to beautify and monetize! You investigate and research various JavaScript magic files that offer everything from Twitter integration to animated puppies that trample paw prints across the page content as they walk. You find things that feel plug and play giving you incoming traffic analysis and other files that embed ads from 3rd party vendors. You add two to a few then sprinkle four then more. Eventually you arrive at what you decide is the perfect pages. It demonstrates your site building prowess by integrating daily polls, half-screen popup ads that engage visitors with mini games because people get bored just reading the news don’t they? The occasional spider will lower itself from the top of the screen during Halloween covering 45% of the top article and scare the bejeezus out of people who are unexacting!

Your design was originated around the now defunct Opera core engine but you have since tweaked it to sort of work with WebKit and Safari. Still you spend most of your time using FireFox and you don’t even own a Mac so what’s the point? Mobile responsive design is out the window because nobody can enjoy your interactive mini-game popups on a smaller screen! Meanwhile your site continues to pickup traction as it gets Tweeted, re-Tweeted, and shared all across social media. Your visitors continue to increase as do the number of JavaScript widgets. More visitors must mean more interactive content is necessary, shouldn’t it?

The occasional visitor that arrives from a Facebook share on mobile is stuck as your main content, the article which was linked in the share appears beneath the fold which is primarily occupied by the awesome interactive Tide commercial which is bringing in a whopping $.05 per view and making the site un-scrollable as an unnoticed side effect. It takes over 1.5 minutes to load your top banner over mobile and half of your visitors close the page since they never even see the content they visit for rendering your stat counter pointless.

If you want suck at programming, ignore the principles of minimalistic and mobile responsive design and dazzle your visitors with interactive sorcery. You’ll accumulate page hits but nobody will ever know what your site has…

Evidence of TDD in the Bible (Eph 1:4 NLT)

I read a scripture this morning which shows clear evidence that God practices some form of Test Driven Design. Bear with me as it may sound non-obvious or one huge stretch. Just read Ephesians 1:4 NLT where it says:

Even before he made the world, God loved us and chose us in Christ to be holy and without fault in his eyes.

The key phrase is Before he made the world… That is before he wrote the code of humanity he chose us. Again, this may be counter-intuitive, but think about it. He chose us… he designed who we were to be before we existed. That is, he designed our outer interface or the blueprint for who we were to be in advance of implementing us. Y’all probably think I’m playing but I don’t kid around when it comes to scripture. This particular passage strikes me in a certain way as it’s the first I’ve read that clearly paints a connection from my faith to my coding practices. I’ve always known there was a pattern between what I study at church and the how I practice development but I couldn’t put my finger it. Then this passage jumps right out of the good book and describes the connection.

No long winded rant is necessary for tonight’s post, I believe the word says enough as it is written. Think about it.

How to suck at programming #FEFE23 donate your day to a bug

It’s a holiday, everyone is partying but you got better things to do. Up early in the morning, you power on your vehicle and head to the office like the model employee you know you are. The wife queries, “Isn’t it a holiday?” to which you mumble, “I gotz deadlinez!” The looming release date of the project you’ve been working on for the past couple of months is beginning to weigh on you like last Thanksgiving’s turkey and yams. Hi, I’m Cliff. You’re here because you suck at time management. On with our story… The air around your shoulders now feels like lead and you can almost make out the text of the actual delivery date as you watch its molecules adhere to one another with each passing hour. Today will be different! You have the entire office to yourself and you will be Mr. Super Productive Programmer Guy ready to close out the 12 top Jira items in 1 heroic effort!

You arrive bright and early, and only dabble on Social media for an hour because, “hey, it’s the holiday and you gotta have some enjoyment!” Finally dismissing further distractions you power up your IDE and go to work! You finally restore the memories tucked away in the soft tissue inside your skull which originated last Friday when you came up with the terrific idea to finish your work over the holiday. “Yes, this is the issue I needed to resolve!”, you verbalize audibly knowing that nobody is in the office to witness your late morning schizophrenia.20 minutes into your effort you hit a snag which sends you off in a whirlwind of meta-problem resolution, also known as yak-shaving. Undeterred you press on, confident because you weird the most powerful IDE on the planet and no amount of yak hair will keep you from making your deadline.

Finally it bites you. The one bug that makes absolutely no sense because the source code was working entirely different just prior to your recent changes. The changes you introduced are the absolute logical equivalent of the original version of the source code. There is no way in the world the behavior should be altered. You have made what is the textbook definition of a safe refactoring yet things have dramatically stopped working! You refuse to use your debugger because everything is TDD on this project. Unit test failure after unit test failure eventually causes you to break down and add log statements, then finally use the debugger. The debugging session leaves you even more puzzled as you Google random log output and red-herring type error codes. You glance briefly out the window and the sun has grown several shades darker and you start to feel your heroic day slip into night. Hour after hour leaves you more stranded, frustrated, and confused as you throw different possible solutions into your IDE, practically reauthorizing the entire project along the way. The emulator that your app runs on mocks you with scorn, the internet feels like its laughing at your pain, you have no other recourse but to throw in the towel but you refuse to give up.

Finally you begin a round of rubber-duck (or teddy bear) debugging speaking aloud each line of source code as you step through your logic mentally. Three minutes into the ducky-debugging it becomes painfully obvious where the problem is originating! The most obvious oversight of a relative URL which should have been absolute! How could you be so blind? Why did you go through all the chaos of rewriting your entire project??? 7 extra characters is all it takes to make the original version of your modifications green bar!

Alas, the day is old and the curtain call has begun on your life as the credits begin to roll announcing the tail end of your holiday. You look at your progress and realize that you have fixed one minor insignificant bug in an area of the app that only you and the night time janitor know exists. (The janitor only know because you spend nights discussing your problems and have been stuck on this issue for months.) Hooray for you! You have devoted your entire holiday towards fixing the only feature in the entire app that does’t actually get used anymore. So if you wanna suck at programming, skip a holiday, go to work, and obsess over that one unused feature. You’ll learn more about the edge cases of the web browser in your emulator and never live to appreciate those precious 24 hours again in your life.

Where are my assets?

I have a quick post today while I work during my holiday. (I don’t want to forget this tip!) If you have an Android app that uses files from the assets folder and you want to inspect whats in the assets folder during runtime use something like the following:


This will get you a list of everything directly under the assets folder bundled with your app. Do NOT do something like this:


…as this will get you a list of everything bundled outside the assets folder and confuse you. I did this earlier and saw the actual “assets” folder in this list so I thought I could do this:


…or this:


Neither which gave me what I wanted. Again, the magic method call is this:


Getting stabbed by Dagger on Android

Did you read the title?It saysI got stabbed, by Dagger, on Android. The non-technical reader would assume something serious occurred followed by hospitalization. Those who know me are already wondering what the dependency injection framework I’ve come to love and how it could have any pointy edges. While I actually have physically been stabbed in the not too distant past (long embarrassing story and I don’t wanna get into it) I can assure you today’s situation does not involve anything breaking my skin. Hi, I’m Cliff. You’re here because you’ve been stabbed by Dagger. You may not need bandages or medical care but it hurts kinda bad. I’m here because I was bleeding a little while ago and I want to share my experience.

The catalyst for today’s post revolves around the suspicious error messages I was seeing from Dagger from time to time. I sort of know how to use it pretty well but when I’m in a rush I tend to make subtle mistakes that lead to even more subtle but hard to decipher error messages. These errors don’t always steer me to the source of the problem, rather they leave me with a feeling of, “that doesn’t make sense!” As Dr. House says, “When something doesn’t make sense, one of your assumptions is flawed.” (I love House!) All rambling aside, let’s get to the important part. Below I’ll list a few error messages along with what they might be trying to tell you. Remember, the best way to debug a program is to force an error early on and get used to the random messages it generates. I’m saving you a bit of time by doing some of this rework for you in Dagger.

java.lang.IllegalArgumentException: No inject registered for members/com.your.package.YourInjectedClass. You must explicitly add it to the 'injects' option in one of your modules.

at dagger.ObjectGraph$DaggerObjectGraph.getInjectableTypeBinding(
at dagger.ObjectGraph$DaggerObjectGraph.inject(
at com.your.package.YourInjectedClass.init(YourInjectedClass:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(

You may have tried to inject a class that is not declared in the Module you’re using to do injection. For eg., if you call ObjectGraph.create(MyModule.class).inject(this); and this object does not appear in MyModule then you probably should add it to the @Module annotation like so:
@Module(library = true, injects = YourInjectedClass.class)

Compilation completed with 1 error and 0 warnings in 2s 455ms
Error:Error:line (37)java: your.package.someInjectedDependency could not be bound with key your.package.someInjectedDependency required by YourInjectedClass for YourInjectedClassModule

You may be missing a providing method in our module or more likely you’ve forgotten the @Provides annotation. If YourInjectedClass decades an injected variable of type your.package.someInjectedDependency, check that your.package.someInjectedDependency is returned from some providing method and that the method includes the @Provides annotation like so:

public someInjectedDependency providesSomeInjectedDependency() {
return new someInjectedDependency();

java.lang.UnsupportedOperationException: No no-args constructor on at com.your.package.YourInjectedClass$YourInjectedClassModule$$ModuleAdapter

at dagger.internal.ModuleAdapter.newModule(
at dagger.internal.Modules.loadModules(
at dagger.ObjectGraph$DaggerObjectGraph.makeGraph(
at dagger.ObjectGraph$DaggerObjectGraph.access$000(
at dagger.ObjectGraph.create(
at com.your.package.YourInjectedClass.setUp(

I got this error by doing something really strange/non-standard. It just means that it cannot instantiate your Module class. In my case I had defined my module class in the same file as the class that was asking for injection but outside the class definition. (This is outside the last curly brace enclosing the contents of the class’ methods.) I then moved inside the class definition but forgot to make it a static. This caused Dagger to not be able invoke the constructor because that only works for static inner classes… if none of this makes any sense to you don’t think about. Just know that the error above means that you should check the visibility of your module class (eg. is it a private class or a public class? Does it have a public no-arg constructor? Is it in the classpath?)

There’s other weird errors I’m trying to get used to and I’ll either post here or write a new article as I discover them.

Year 1 at the worlds oldest company, GE

Earlier I tried to log into the task board at work. Y’know that board thingy that has the cards that represent the work you could’a should’a would’a done but you’re still in the middle of that other task thing that is no where on the board. Anyway, as soon as I opened the page I was greeted by an awful terrible thing… something so rotten it will keep you up in cold sweats… you’ll never look at a computer screen the same way after seeing this thing… It was the password reset screen! Hi, I’m Cliff. You’re here because your password just expired and I’m here to remind you not to use the same one over with just two characters transposed.

It’s that time of year when stock options start to vest and you begin to lose access to critical systems while mis-keying your new uncommitted to memory nonsense word that most include at least two digits, one capital letter, begin and end with a letter, and rhyme with “silver”. You must also compliment this nonsense word with random answers to common questions like, “other than pink, fuscha, green, red and yellow what is your favorite color?” and, “what is your first car which everybody remembers you driving from high school because you crashed it into a tree?” These hard to guess combinations will guarantee that everyone but you can access your sensitive accounts as you struggle to remember the proper casing for the name of the city you grew up in. (was it “Mt Holly” or “Mount Holly” or did you get totally lazy and key in “mount holly”?) A few dozen call to IT and a couple hours later and you’re right back to trying to recall your first pet’s name while setting a new gobble-gook phrase that you’re sure to remember since this time it reminds you of the lady at the grocery store that hooks you up with extra paper bags without charge the $.10 fee.

So what have I done this past year? I’ve managed to write an Android app which my team is hoping to finish and publish as part of our mobile platform. I’ve picked up the Kotlin language. (…and put it back down once I realized how over-committed my schedule became.) I learned nodeJS/TypeScript/Electron by fire. I helped to organize a mobile workshop. I helped a developer’s hangout. I’ve done several product demos. I’ve basically been Mr. Mobile Phone-pants around the office. I would say that I’ proud of my accomplishments but I don’t really feel like I’ve accomplished anything.

Overall I really love working at this company… it’s not something I thought I’d every get used to. I mean, let’s be honest… this place is not known for anything fancy like social networking or streaming video, or fancy cartoony game characters or anything. AS a matter of fact, the first thing that comes to mind when hearing or thinking of the GE brand is some sort of chore I used to try to avoid when I was younger. That said, I am blown away with how much fun I’ve had over the last 12 months. Here’s hoping the next twelve are just as exciting!

Hello World Part C

It’s my 10 year blog-o-versary and I’m fashionably late with an update. Here go my first post way back in 2006 before I knew what I was doing. Not much has changed since 2006. Hi, I’m still Cliff. I’m still the lucky husband of one spectacular woman, though if I told you m story you probably wouldn’t believe me. My site still only consists of 2 regular visitors. Over the last 10 years I’ve consistently posted articles that chronicle my discoveries and experience with various tech. My jokes have slightly improved from corny to I can just skip passed the stoopid parts. I’ve worked at some fascinating companies on some high profile projects over the years, mostly mobile. and peanut butter has been a regular part of my daily balanced meals. I always thought I would be blog famous by now… someone like Joel Spolsky. I’m not mad though… I got John Blazed articles and all… most people just don’t understand. Still I’m cool with being humble. I don’t need too many people reading through my typos, grammatical errors, and terribly embarrassing attempts to be funny. You know how when you write a joke that you think is so funny but then come back and read it years later and feel like, “why did I think that was my Kevin Hart moment?” There’s a few posts here that read like that. You may have read one or two. If so, don’t clown… just keep it moving. I ain’t trying to change the embarrassing stuff I posted way back. It’s been here far too long and is now part of my makeup. (It’s not like I actually wear makeup, it’s just that the dumb stuff… along with the somewhat presentable stuff is sort of what makes me up. If you were gonna tease me about wearing makeup then you’re part of what’s wrong with society because I should feel free to wear makeup if I please.. not that I want to… but if I did… where was I??? Oh, yeah, outside the parenthesis…)

So over the years I’ve talked about how to suck at programming, Linux hacks, Siri, J2ME & Blackberry, video games, and of course unit testing. By far one of my most favorite gems is the TDD example I wrote which counts how many emcees must get dissed. I had a bit of fun with that post though I think it has errors that I should probably correct. There were a few other classics as well like the post where I learned how to REALLY use SSH or the one where I figured out how to use ALSA on Linux to play pleasant cues/blips from Apple encoded files pulled of of my Macbook. I’ve also posted some low level discussion on how NSViews work on OS X even though I never wrote an OS X app at all in my entire life. I get a thrill out of posting random things I’ve learned/discovered over the years.

In all I have to say I’m both surprised and thrilled with how long I’ve kept this blog up. There have been some dry spells over the years but I eventually find time to post stuff as I learn it. Here’s celebrating my 10 years of foolish but technical gibberish!