1 min read

Tags

Doing Test Driven Development (TDD) and learning Ruby simultaneously is a problem for brand new developers.

When you’re new to development, you don’t have the foresight to take on multiple subjects at once. You’ll context switch and end up frustrated with slow progress.

Automated testing is vital to development but I only gained an appreciation for it after I learned Ruby and was already comfortable with Rails.

Focus on one thing

If you’re learning Ruby, focus on Ruby. Be playful with syntax. Let go of the police in your head. There’s no need to have ‘clean’ code while you’re learning. Even if it’s messy but it works, you’ll feel good because you’re progressing.

Remember, you’re not going to be shipping code. Testing is not relevant at this stage.

TDD brings a layer of complexity with additional syntax that can distract you from learning your programming language.

Paralysis from test first mentality

As you’re learning Ruby, you don’t have the breadth of knowledge to know what’s possible. A lot of learning happens as type away on those keys.

You can’t plan tests beforehand because your Ruby planning skills aren’t formed yet.

Compare coding as a beginner to the craft of writing. You open up an empty page and begin writing with a fuzzy idea of what you want to write about.  That first draft is going to be a piece of crap, but you keep going. You know that the secret to writing is in editing afterward.

Imagine if you had to know exactly what you’re going to be writing about before putting the pen on paper.  You’d never start writing because you’d be paralyzed. Ideas come while you’re writing and learning happens while you’re typing.

This is why I failed to learn Rails the first time. I was paralyzed with TDD before I could write any piece of code.

My success with Rails came because I skipped TDD and focused on learning Rails. I waited to pick up automated testing skills after Rails and finally appreciated their value.