Never miss a beat

Join my newsletter.

The Archives

Adapting Traits for Kotlin

Published: 4/10/2019

Traits are a pattern introduced in Scala (at least, this was my first introduction to them) that help avoid deep class hierarchies in favor of composition. If you don’t have Scala experience, but do have Java experience, you can treat this similarly to Java 8 Interfaces . However, I still prefer to call them Traits. Although Traits have first-class support in Scala, Kotlin does not directly have Traits. However, Kotlin does support default interface implementations , just like Java 8. It’s…

Developer Burnout: 9 Tips to Help

Published: 3/29/2019

Burnout happens — especially developer burnout. It’s unfortunate, but a fact of life. However, it seems to happen to developers (and maybe Doctors, but you’re not my target audience) far more often than other professions. It may manifest in the emotion of dread, knowing you have to go in to work tomorrow. Or it may manifest in sadness, just thinking about staring at code. Or it may possibly manifest as anger, thinking about the project that won’t seem to work. Unfortunately, we’ve found that…

Comparing Kotlin to Scala

Published: 3/5/2019

Kotlin to Scala. Scala to Kotlin. Two contenders for my heart. In the left corner, we have the new comer! Weighing in at just over 1.2MB — The Ambassador of Android: Kotlin! And in the right corner, we have the long-time favorite, weighing in at just over 5.3MB — The Archduke of Akka, The Sultan of Spark: Scala! If you’ve made it this far through my silliness, you’re likely comparing Kotlin to Scala for your next project. There’s definitely some key takeaways from the above paragraph that may…

What is Android's SurfaceFlinger

Published: 3/4/2019

Android’s SurfaceFlinger is a system service provided on the Android Operating System. Now that that is out of the way… What does it actually do? If you’ve worked with scrolling, you’ll know that “flinging” is an action that a user can do, but it’s not related to that. Actually, the SurfaceFlinger is a service that plays a critical part in determining what is rendered on the screen on any Android device. It’s important to note that the SurfaceFlinger doesn’t directly render anything to the…

The Complete Guide to Dimensions in Android

Published: 2/8/2019

Figuring out when to use dimensions in Android can be a tricky time. Should all values be a dimension? How about none of them? You could argue that both of these are valid, but I’d like to clear the air with the statement “sometimes you should use dimension values.” But how do you know when? If you’re not sure what a dimensions value is, it’s an XML value that lives in your project’s res/values folder, under dimens.xml. They’re intended to be used for styling dimensions (hence the name) such as…

PHP: Add to an Array

Published: 2/1/2019

It’s very common to find yourself working with Arrays in any language, and PHP is no exception. If you’re reading this, you probably want to find out how to add to an array in PHP but there’s one thing to cover first! Unlike most other languages, arrays in PHP are just an ordered map! Let’s declare an array to work with. Arrays can be declared similarly to map, but you can freely omit the keys. Now that we have an array, we can see how easy it is to add to an array like so: Adding to an array in…