Your Logs Should Be Considered Features, Too

Sometimes, printing things out is the simplest debugging technique we can use. And then, when we forget to take the print statements out, we call the output our logs.

That’s a mistake. Logging shouldn’t be an afterthought. It’s a core piece of diagnostic tooling. Logs are so cheap to integrate that they are almost always an extremely high return-on-investment feature. Your logs should be treated as first-class features warranting all of the attention to detail that you give to your more user-visible features.
Read more on Your Logs Should Be Considered Features, Too…

Functions and the Single Responsibility Principle

You’re most likely familiar with the Single Responsibility Principle (SRP)-it’s the S in the SOLID acronym and a cornerstone of many folks’ object-oriented software design guidelines.

If you’re like me though, you’ve pretty much always heard SRP discussed in relation to modules or classes. I had started thinking in an SRP way when writing Clojure functions, but I hadn’t made the mental connection until I read Bob Martin’s recommendation in his Clean Code book.
Read more on Functions and the Single Responsibility Principle…

How to Remove Extra Separator Lines in a UITableView

When your UITableView does not have enough data to fill out the length of the screen, it will show empty cells with separators to fill out the screen. I have run into several situations where the extra separator lines are not wanted. If you have run into this yourself, then here is an easy trick to get rid of them that does not require any code. Read more on How to Remove Extra Separator Lines in a UITableView…

Bringing Rails-Like Migrations to JavaScript with Knex.js

The one thing you can count on with any software project is that requirements are going to change. The severity of these changes varies, but a change in requirements can necessitate major changes to the overall application structure and potentially alter the database schema.

Have no fear! This is what database migrations are for, aren’t they? If you’re working in a Rails app, you can quickly generate a migration file, specifying the columns that you want to create/drop and the way the data that is currently in the database should change to adapt to the new schema.
Read more on Bringing Rails-Like Migrations to JavaScript with Knex.js…

You Should Use Static Dates For Your Unit Tests

When writing unit tests for time-sensitive features, there are two ways you can define dates: dynamically or statically. When I say “dynamically defining dates,” I mean basing dates off of the current system time, as opposed to statically defined dates, which are hard-coded strings in the unit test.

Over the past few months, I’ve found that dates become much less of a pain to test when you use statically defined sample dates. They also lead to generally stronger test suites as a whole. Here are a few reasons why I think you should use static dates for your unit tests.
Read more on You Should Use Static Dates For Your Unit Tests…

Tired of Your Shell? Try Zsh!

I’ve been a Zsh user for several years now, and I figured that I would share my experience. For those who haven’t heard of it, Zsh is a command line shell, similar to Bash, but with many more built-in features. Many features of Zsh are available with Bash or other shells; however, Zsh does such a great job out of the box. Read more on Tired of Your Shell? Try Zsh!…