Posts in Development
Putting Down the Golden Hammer: Part I, Whose Hammer Is This?

The Golden Hammer, a.k.a Law of the Instrument, a.k.a. Maslow's Hammer is "a cognitive bias that involves an over-reliance on a familiar tool." (Wikipedia)

You might be familiar with it phrased by Abraham Maslow in this way (hence the name "Maslow's Hammer"):

I suppose it is tempting, if the only tool you have is a hammer to treat everything as if it were a nail.

After three years of developing with Kotlin, I know a couple of things for sure. That I still love Kotlin and that I am still figuring out what idiomatic and "good" Kotlin is.

Looking for an answer to "what is idiomatic Kotlin?" I first tried to learn as much as I could about as many Kotlin features as I could. I wrote a talk called "Dissecting the stdlib," where I (super quickly) went through many of the Kotlin features and stdlib tools that I loved. Moreover, these were features that felt pretty Kotlin-y to me.

Learning syntax and getting exposure to features is always a great place to start. In my effort to be Kotlin-y and idiomatic by using as much Kotlin as I could, I sometimes wrote code that made me mentally jump through hoops. I sometimes wrote code that I didn't understand six months later, either in a literal "what am I doing here?" way but also in an "I don't know/remember why I did things this way." way. I often fell in love with Kotlin features and became biased towards using them to the point of over-using them, because I had a hammer and I was going to use it on all my Kotlin nails.

Read More
Getting Git: Stash Some the Things

I am a consummate git stash addict and use it daily.

I am also decidedly not a git expert by any measure.

Often (too often) I have wondered how I could stash only some of the changes in my working directory. Recently, I actually RTFM and discovered a couple of ways. Woohoo!

  1. git stash --keep-index
  2. git stash --patch

As usual, you are now free to go, dear reader. For a little more discussion, please continue.

Read More
Things You May Not Know: Tools Attributes

You may have seen an extra namespace, xmlns:tools="http://schemas.android.com.tools", in layout files generated by Android Studio. Adding this namespace to your layout provides you access to attributes, the Tools Attributes, that add metadata to resource files, that facilitate manipulating, rendering, and testing layouts in Design view, and (while I do not condone excess of this kind of behavior) that suppress certain Lint warnings (but only if you have a good reason for ignoring them, she nags). 

Read More