Trial by Code Review

Today wasn’t the day, but I remember it like it was. My first big project that I submitted at a big company working with engineers that I respected and looked up to. I pushed my code to our code review tool and anxiously awaited their feedback. Some of it was the most non-constructive feedback that I’ve ever seen in a code review and since then I’ve thought of some standards that might (or might not) be worth adhering to in code reviews. Perhaps a better title for this post is actually A brief guide to writing code reviews. A brief...

Overriding Button Styles in Android

Android comes with a ton of widgets, gizmos, and gadgets (maybe just widgets) out of the box, but it can be difficult to find one that works exactly how you would expect it to. My advice is this – find one that functions the way you want it to and override the styles to make it look the way you’d like. If that doesn’t work, you can always create a custom view, too! For now, let’s assume that will work, and I’ll show you a recent example where I decided to use Android’s ToggleButton, a widget notoriously known for looking...

A brief summary on Automated Testing

I recently read this amazing article by Josh Mock and felt the need to share it. In fact, the tools he uses in his examples – JavaScript, Mocha+Chai, and Phantom are the tools I use daily to do the same thing. I can’t stress enough how great his article is, especially if you’ve written some tests before but you’re not sure how to write a good test. That being said, there’s a few more things I’d like to cover and add to it. In summary, Josh covers the following things: Keep Business and Display Logic Separate Run async code in...

Mighty Morphing Multimethods

Type systems are a tricky thing. A lot of languages have very flexible type systems, such as F# with its inferred (and extremely well inferred at that) type system, or JavaScript with it’s untyped nature. Clojure hits a happy middle ground (for me, at least) – It’s dynamically typed (or “gradually typed”, if that’s your cup of tea). Why is the typing important? Polymorphism. Most of you probably learned polymorphism from your introduction to object-oriented programming course/book which was probably in C++ or Java. While it’s true, polymorphism is blatantly obvious in OOP, it’s still a thing in functional languages,...

JavaScript – Generators

One thing I’ve learned recently from Clojure (don’t worry, this post is about JavaScript) is that laziness is great. Lazy code is powerful code, allowing you to model things like infinite sequences or complex computations over a range of data. Without this laziness, an infinite sequence would cause a stack overflow or complex computations would bog down your performance when you may not even need to perform all those computations to begin with! Enter Generators With the latest rendition of JavaScript, developers now have access to tools to help them be lazy! Iterables and Generators. This post will cover generators,...

Understanding Clojure’s Map & PMap

Let’s be honest – Part of the reason you’re using Clojure is the higher order functions like map. They’re great, composable, and describe what you’re trying to do instead of defining what to do – this keeps code simple. Maybe you’ve been playing with map for a while now and have even tried using pmap. If you did, you probably noticed that pmap is often slower than map, and if you want to know why – read on. What is map? Before we get into pmap lets go ahead and clarify our understanding of map. There’s actually several neat use...

Why I Switched from Python to Clojure

First – a bit of background. When I first started learning programming, I started with a course in high school that focused on Java. From there, I decided I wanted to work for a start-up and I had to learn python (I was naive). I started playing with Python and it just felt right – at first. I spent some more time with it and started to realize that I needed something more. Here’s a brief list of the reasons why I switched. Interpreted Language Python is a dynamic language. There’s a massive list of Pros and Cons for this,...