Monday, December 4, 2017

Music for Coding

Writing good code takes concentration. As easily distracted as I am, I have to find ways to drown out the noise around me. That's why when it's time to write code, I slap on my QC25 headphones and spin up the tunes. Today I thought I'd share what I listen to.

In order to stay focused, I need music that's not distracting - if there are lyrics or catchy melodies, it'll break my concentration. So most of the time, I turn to video game music, because it's crafted to sit in the background.

So without further delay, here are the albums that I listen to the most when I write code.


Child of Light

Child of Light has an absolutely amazing soundtrack, with simple but intriguing arrangements that largely feature piano, cello, and other strings. There are a variety of more intense songs mixed in, but overall the mood reflects the storybook art style of the game. I'm almost certain that I've listened to this album more than any other album ever, because I listen to it almost every single day that I write code.

The game was also a lot of fun - it's a simple RPG with characters that are likable, and a story that's immersive but not overly complex.


Hollow Knight

I purchased the Hollow Knight soundtrack just a few months ago, but it's quickly becoming one of my favorite albums to code to. The mysterious nature of this soundtrack lends itself well to thinking, and it has just the right amount of action songs mixed in to keep you moving forward. This is another one that I've started listening to almost every day.


Ori and the Blind Forest

I've you've played Ori and the Blind Forest, you know that the game is a masterpiece in almost every respect. The music is absolutely commensurate with the breathtaking visual art of the game.

The music is more thematic than Child of Light, so there are sections that draw my attention a bit more, but overall it's still a fantastic album to listen to when you write code.


Dust: An Elysian Tale

Dust was an amazing game. The gameplay was addicting, and the world was immersive. And it was basically made all by a single guy - an artist named Dean Dodrill who decided to write a video game with XNA. The postmortem is an excellent read.

The soundtrack was done by HyperDuck SoundWorks, and it's also a great album to code to. It's also got some tracks that are a bit more thematic, but overall still works well for writing code.


Nightsky

This one's not a video game soundtrack, but I still found it to be a great album for concentration. Tracey Chattaway's Nightsky album has songs that have a slow, steady, warm sound to them, which is fantastic when I need to slow down and think.


How about you?

So those are some of my favorite albums for concentration when I'm writing code. How about you? What do you listen to?

Monday, October 23, 2017

My Latest Project: TypeAlias

There are lots of great reasons to explore new programming languages, even if you don't end up using them in production. I especially appreciate the new perspective that they give me. And sometimes, I come across a language that ends up being a fantastic fit for the particular set of problems that I'm working on at the time.

As I focused a lot of my development efforts on Android over the past year, I came to appreciate the benefits of Kotlin quickly. I liked it back when it was in beta a few years ago, and I put in enough time with the language to understand most of what it had to offer.

But there's

Thursday, November 12, 2015

Kotlin Gradle Blooper!

This weekend I had a blast working through the Kotlin Koans, so I thought I'd fire up my IDE and try my hand at porting one of my existing hobby projects from Groovy to Kotlin.

As I began working on it, I was surprised to notice that some of the cool features from the Koans and other examples online weren't available to me in my project -- things like doing MyClass::class.java, listOf(), and even forEach on my List<> objects.

My build.gradle file was including the kotlin-gradle-plugin, of course, but if you want all the goodies, you've got to also include the Kotlin Standard Library:


dependencies {
    compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version_number'
}

Naturally, the instructions for configuring dependencies for the Kotlin Gradle plugin say very clearly to include it, and they even give a full example. I guess in my excitement I just skipped over that part! My bad, yo.

So... if you're a Kotlin newb like me and your code seems to be missing some major Kotlinness, be sure to include the Standard Library!

Leeds out.

Thursday, May 1, 2014

Happy Birthday, BASIC!

Birthday cake... worst pixel art ever!

I haven't written a lick of BASIC in years, now. But because 2014 marks its 50th anniversary, I simply have to tip my hat to the language that introduced me to programming back when I was a kid.

According to the wikipedia article for Dartmouth BASIC, May 1, 1964 is recorded as the date when Kemeny and McGeachie successfully fired off their first BASIC command. As for me, I didn't successfully fire off my first BASIC command until almost twenty years later. I was

Tuesday, April 1, 2014

Java 8 Collection Updates - Slides and Code

Here are the slides from my presentation at the Nashville Java User Group on April 1, 2014. Also, I've got the Hack-n-Slash code samples from the presentation available on GitHub. They run as JUnit tests, so you can explore them, tinker with them, and see them in action!

Thursday, August 8, 2013

Writing Small Methods... No, I Mean Really Small Methods

Mouse and Elephant

Like many programmers, I've typically aimed to keep my methods small. On average, my methods have been probably around 8-12 lines long. But lately, I've had a blast

Wednesday, June 26, 2013

Unit Testing: What's a Unit?

We all know that we should be writing unit tests, but have you ever thought about what a unit is, exactly? Most definitions out there, including the one on Wikipedia, describe it as the smallest piece of code that can be tested.

But what does that mean? The answer to that question will

Friday, May 31, 2013

My Favorite Presentations from RailsConf 2013

Confreaks has been busy over the past few weeks, putting together the videos from RailsConf 2013. Now that they've posted over 90% of the presentations, you've got

Tuesday, May 21, 2013

3½ Ways to Reuse Code in ColdFusion Components

Programming languages give us a variety of options for sharing code among multiple classes. In this article, let's look at the 3½ ways that ColdFusion allows us to get code reuse in our components.

Let's start with a problem – we've got two

Monday, May 6, 2013

RailsConf 2013 Highlights

Last week, I had the privilege of attending RailsConf up in Portland. With about 1500 attendees, 4 days of sessions, about 3-4 session options to choose from at any time, and a set of about 40 lightning talks, there was

Thursday, April 25, 2013

Extra Git Merge Commits: Merge branch 'master' of github.com:owner/repo

As I've been working with some friends on a GitHub-hosted project lately, I've seen tons of seemingly extraneous merge commits in our master branch that look something like this:

Merge branch 'master' of github.com:owner/repo

This can seem confusing, especially to those coming from a subversion paradigm, for a few reasons:

  1. You see it when you're working on master. If there's no branching happening, why is there a merge?
  2. The merge commit includes changes that have already been committed, so it looks like they're happening twice.

What Causes This?

When you're

Wednesday, March 27, 2013

A Quick Look at SourceTree for Windows

Atlassian recently released a beta version of SourceTree for Windows, their graphical Git client, which was previously only available on Mac. Since BitBucket kept telling me to give it a try, I gave in and snagged a copy.

Now, I gotta say, the Git CLI is amazing. I mean, you can do some crazy stuff in a simple terminal window. Tasks like interactive rebasing and cherry picking hunks of changes work surprisingly well on the command line. But there are also tons of features of Git that would lend themselves well to a GUI. So let's peek in on SourceTree to see what it provides.

Wednesday, March 20, 2013

Book Review: Effective C# by Bill Wagner; Addison-Wesley

This review covers Effective C#: 50 Specific Ways to Improve Your C# (Second Edition) by Bill Wagner, published by Addison-Wesley. You can pick it up from Amazon or InformIT.

Bill Wagner's book, Effective C#, 2nd Edition delivers fifty easily-digested best practices to take your C# to the next level, covering a variety of topics from language idioms to dynamic programming and beyond. There are roughly 300 pages that are packed with content, striking an excellent balance of code and prose.

As a professional programmer who has

Thursday, March 14, 2013

Time to Restructure!

I love greenfield projects! They're a chance to start with a clean slate. A chance to do things right. After maintaining our existing apps for so long, we're keenly aware of everything that we'd do to fix them. A fresh start is a golden opportunity to take all those lessons we've learned and apply them in order to build a shiny, pristine code base that we can be proud of.

The New Project Rush

New projects are also usually a bit of a rush. The business team wants to make sure you can deliver by a certain date, so things

Thursday, March 7, 2013

Are You a Programming Newbie?

We were all coding noobs at one point or another. Here's my list of the top ten things that I hope you don't do anymore.

You might be a programming newbie if...

  1. You put all of your variables in the global scope
  2. You've got a conditional with half a dozen expressions
  3. All of your variables names have

Wednesday, February 27, 2013

Best Practices vs. Prototypes

I've noticed that developers are good at identifying and learning best practices. I've also noticed that they're equally good at coming up with reasons why the best practices don't apply in some particular case they're working on.

If that's you, don't worry. I'm not here to slam you. In fact, I think it's something that we all wrestle with daily. We know the

Thursday, February 21, 2013

Code Review Best Practices - Use Code Review Software

Although you can get by doing live code reviews, I've found that using code review software has generally made my code reviews much more productive. There aren't a ton of code review software packages out there, but some of them are outstanding.

If you're

Wednesday, February 13, 2013

HTML5 Date Pickers and JavaScript Date Objects

HTML5 date picker elements have a lot of potential. After all, there are tons of apps out there that need a control for choosing a date. The number of browsers that support them is gradually growing, but not as quickly as you'd expect. Here's what it looks like in your browser -- it might just be a text box if your browser doesn't yet support date pickers:

Because of the lack of support in some browsers and the simple implementation in others, many developers still end up going with jQuery UI to render their date pickers.

If you choose to go with the native HTML5 control, you might notice a problem when

Friday, February 8, 2013

Code Review Presentation Slides

For those who attended this week's Nashville Java Users' Group and were interested in reviewing the slides from my lightning talk on Code Reviews, I put them up on SlideShare. For convenience, I'm also embedding the presentation here.

While preparing for that presentation, I also realized that I've got a few gaps to fill in from the initial series on code reviews, so I'll be adding to that series over the coming weeks.

Monday, January 28, 2013

What vs. How

Have you ever had this happen to you? -- You're wading through code, analyzing one expression after another. After getting forty lines into the method, you pause and ask yourself, "Wait, what is this method supposed to do again?" It's easy to miss the forest for the trees.

This happens a lot when the code is

Profile Picture
Dave Leeds
My Hobbies:
  • Programming
  • Cartooning
  • Music Writing
Full Profile