Friday, December 30, 2011

How do you deal with coder's block?

I've kind of fallen into a trap with my Ruby work. I've been working on Dungeon Crawler for so long that I'm getting sick of it. I've had help from several friendly Rubyists (@jqr, @mileszs, @netshade, I am looking at you here) and I simply can't figure out how to make a proper redirect based on a form input.

This is extra irritating because I'm pretty sure I DO get how routing with Sinatra works, but starting a user out on one page with an input form, then redirecting that user to another page based on his input, seems to be escaping me.

I've gotten this to work in a limited capacity, when all of the logic is thrown into the

get '/input' do

method, but using a case/when statement here always uses the same logic. For example, dais_room will be north of torch_room, but vine_room will be north of dais_room, and I was always being redirected to dais_room with input "go north."

I also had a problem of simply being redirected to a white page with black text pulling the description of the room. I believe this was the method @netshade showed me for automatically creating a room without explicitly coding it, but for some reason it was not loading a view file.

Here's a full gist of what I've got, if anyone wants to give me some srs help:

Dungeon Crawler full gist

What do you guys do when you get so frustrated with a project? Do you power through, work on something else, or just take a break? I feel like since the holidays began, I've found a ton of great excuses not to code. It's Christmas Eve! It's Christmas! I just had LASIK surgery done!

But I'm sick of making excuses and I want to get back into working on a project without feeling like a gigantic dummy or just tearing my hair out because I can't figure it out. That makes sense, right?

It's not all bad news, though. @netshade and @annamul gave me The Pragmatic Programmer, a philosophical/theoretical book about coding. I really like the PragProg guys, and this book has been a lot of fun to read so far.

I think I need some way of setting goals for myself each week with coding. As in, "This week get better with using Git for source control," or "This week, get more comfortable with Javascript." Any recommendations for simple goal setting applications, or methods you've used? I use Tadalist for simple day-to-day chores and things, but that's not quite what I want. Maybe Evernote would work? I still haven't checked into that.

Either way, thanks for all your help, everyone! And Happy New Year!