Why Go's structs are superior to class-based inheritance

Go is unique from a lot of object-oriented languages in that it doesn’t have classes. Instead, Go has two awesome features that make its model of polymorphism way more powerful than classical inheritance: interfaces and struct embedding.

Should you test private methods?

At the last place I worked, I was told not to test private methods since it was an “implementation detail”. Some of these methods involved complex math or tons of branching.

Using Underscore.js templates within ERB

You don’t always have React to create a new feature on a website. Recently, I used Underscore and jQuery within a Rails application to create a dynamic page.

The secret to getting good at anything with minimal effort

I never intended to go into software during high school. I thought I was going to be a doctor, yet on the side, I managed to amass a good amount of experience in all sorts of technologies. While learning all of these things, I never really tried. How is this possible?

Ruby WTF? Escaping single quotes in Ruby using gsub

I’m currently working on a project which requires me to escape JavaScript (don’t ask why). To get it working, I had to escape single quotes. I was encountering weird behavior in my code, so I ran the following in IRB.

The benefit of destructuring function arguments in ES6

ES6 brings a lot of great features to JavaScript to make it a much more modern and powerful language to work with. The days of “JavaScript sucks because it was only built in a week” have passed. One really great feature in ES6 is destructuring.

Doing homework assignments in Markdown using Pandoc and LaTeX

Markdown is a really awesome format for text and prose. It’s really easy to manage in any text editor, and it’s quick to write. It has a lot of features, including bolding, italicizing, lists, quotes, embedded code, and more. It’s so easy to write that it’s the “language” of choice for many major websites such as StackOverflow and Reddit, it being much easier to implement and looking nicer than a WYSIWYG text editor. I’m even writing this blog post using Markdown. However, you can’t really send someone a Markdown document. It’s meant to be processed into a more readable format, most usually HTML.

Using form-horizontal with simple_form in Rails 4

simple_form is a really great gem for generating bootstrap forms. However, you have todo a little extra to get it working with Bootstrap’s form-horizontal class. TheREADME doesn’t mention this, but it’s built in. Just write your form declaration like this: