TWO SHOES WEEKEND 2: THE SHOESENING

MARK YOUR CALENDARS, START YOUR ENGINES, DUST OFF YOUR MECHANICAL GIRAFFES

Last spring, I spent a weekend working with a computer program that makes it simple to make creative and interesting interactive experiences that you can share with people you know. The toolkit is called Shoes and the weekend was called the Two Shoes Weekend. On November 11-13, the Two Shoes Weekend is making a comeback.

STATEMENT OF PURPOSE (DRY, SERIOUS)

The purpose of Two Shoes Weekend is to build two programs using Shoes over a specific weekend. That’s it. Pretty simple! If that’s good enough for you, go get ready! Go! Get out of here!

…still here, huh? You must be one of those rules-questioners. Well, I’ve got some rules-answerers lined up, so let’s match you two up so you can stay with your buddy. Yep, it’s all buddy system around here, pal. All pal system, buddy.

DOES IT HAVE TO BE TWO PROGRAMS?

Yes! I’ll go ahead and reveal my sneaky secret up front: forcing you to make two things is the whole key to the Two Shoes Weekend. When you sit down to start your weekend, you’ll probably already have an idea that you’ve been thinking about. It occurred to you weeks ago, and you’ve been looking forward to watching it spring to life. Yes, soon that picture of Alan Alda will become animated and sing along with Dolly Parton’s “Jolene”. But when Saturday afternoon rolls around and you’re watching your work satisfactorily loop over and over again on your screen, it’ll be time for you to set that aside and start the next thing. The next thing can be born out of desperation. The next thing can be a flash of insight. The next thing will come from somewhere deep in your skull where a tiny voice will explain to you that what the world needs now is a calculator that uses D’ni numerals. And while Jolene Alda is certainly a gift, the D’ni calculators of the world are what I’m looking to sift out from an event like this, because this second thing you made didn’t come from weeks of traffic jam boredom and showertime brainstorming. It came from a very strange part of your consciousness, and it’s those things that always take you by surprise and make you laugh or cry or stroke your chin weeks later when you look back at what you made.

MUST I USE SHOES?

Well, okay, so this one is negotiable. The spirit of the Two Shoes weekend is one of computer programming-based creative expression, a spirit that is inspired by the original creator of Shoes, an internet so-and-so called ‘why the lucky stiff’. Since I’m the one who’s interpreting his ideals, I’m going to go ahead and say that he would be happy for people to be engaged with the Two Shoes Weekend if they’re making things on the computer with anything. You could make a game in Flixel or Inform if those are in your wheelhouse. Prefer to create trivia games in node.js? Quiz on, quizmaster! It’s hard to make two things in a weekend, and if you have a mahogany, satin-lined toolbox that will make this whole thing easier and more fun for you, then I say go for it.

If you’re in for the spirit of adventure or are already familiar with Shoes, though, then you’re welcome to join in on the fun as a community gathers around the use of Shoes. A group of crack Shoesers will be gathering in the Freenode #shoes IRC channel to help you figure out how to make your shady trenchcoat-wearing watch salesman animate his way across the screen only to get carried away by a giant falcon when you press the “F” key (for falcon).

CAN IT ONLY BE OVER THE WEEKEND?

Well, uh… yes. Yeah, sorry. I mean, I’d love to bend on this one, because I know that you’re busy. I’m familiar with opportunity cost, Friendo, and I know that by locking yourself in your computer-pod all weekend, you’ll miss out on a marching band reunion, free tickets to the wax museum, the serendipitous discovery of a traveling gang of sword-swallowers, and all manner of sock-hops, galas, and jamborees. But you could always take your computer OUT of its special sensory deprivation chamber, join up with some friends and computer-programming rivals (you’ve got some computer-programming rivals, right? Everyone should have a couple. I’m looking at you, Jake, and I’m shaking my fist), and program the night away in a nearby apartment, coffee shop, or abandoned roller rink.

The fact of the matter is that it’d just be awkward to call it “Two Shoes Weekend Plus Some Other Days Because Rachel Was Too Busy Being Popular And Cool So She’ll Do Hers Next Tuesday”. You see what I mean? So the Two Shoes Weekend is for the weekend, and I would love it if you felt inspired to do something similar some other time, but the weekend timing is just a thing we need for this to work. I hate to leave you out, Rachel. I’ll make it up to you next time.

OKAY, IT’S MONDAY NOVEMBER 14, I DID THE THING, WHAT NOW?

Wait, really? You did it? You made two things? Oh! Uh… I wasn’t really prepared for this!

Um…

Just a second.

Okay, right, that was it: email me to tell me what you did and I’ll post about your projects in a big roundup with all of the people who made two things. You get bonus points (which will not be tabulated and don’t get recorded anywhere) if you write a blog post (with pictures!) and give me a link AND/OR post the source code to your projects on the internet (Github is an attractive internet website, but anywhere public will do).

OH GOD WHY IS THIS STILL HAPPENING

No, it’s okay, that’s just about it. If you need something else to read before November 11 rolls around, you could read about the last Two Shoes Weekend, which I announced on Friday afternoon and yet somehow convinced two other people to join in on, or you could read my mushy feelings about why the lucky stiff, who wrote Shoes in the first place and inspired me to do this.

If you need to learn about Shoes to get started, you could try these helpful things:

  • Nobody Knows Shoes, simultaneously an in-depth guide to Shoes and the frightening scribblings of a raving lunatic;
  • The Shoes Tutorials, a short guide to writing your first Shoes programs; or
  • The Shoes Manual, a comprehensive handbook to the built-in gadgets and gizmos provided to you by the people who make Shoes work.

But if you’ve done all that, maybe you should go sit down, have a glass of water, or take a nap and get ready for November 11-13, a weekend of fun and mystery and PRIZES (NOTE: YOU MUST PROVIDE YOUR OWN PRIZES).

My Friends’ Two Shoes

Here’s a quick summary of what two of my friends did with their Two Shoes Weekend. Make sure to go check out their full posts for more details!

inky:

I asked my inner child what he would make if he had Shoes to play with. Here are my two things:

№ 1. Butt-Touches is a butt-touching simulator and bubble-wrap contender, based on a comic by Ryan Pequin. [download] [code]

№ 2. News In Bed grabs the latest headlines from BBC News and makes them more exciting in bed. [download] [code]

sorryeveryone:

…it took me a little while, but looking back at it the process was actually kind of simple. I hit a road block or two but Casey was always kind enough to take a look & help me figure out what was going wrong. Once the framework was in place I put in all the variables, and there was p.holby’s time saving automatic sartorial selector!

I spend too much time trying to decide what shirt to wear. Too many times I put one on and then decide I’ve got to go with a different one. So I wrote a program that has an inventory of my shirts and will tell me which one to wear. Once that was done I decided to get fancy and wrote a “Sounds good!” button that exits the program and a “That doesn’t match.” button that suggests another shirt. In keeping with my philosophy that choosing is often more important than which choice you make, this program could really help me out.

[…]

Program #2[…] is a Mad Libs program! I’d post a screenshot, but I did something a bit different with it and a screenshot would kind of give away what’s going on. So obviously, I’d be pleased as punch if you gave it a shot! [Download]

Peter’s post in particular is a really great read (and I’m not just saying that because he thanks me profusely throughout the whole thing)— he had never programmed before, so you get a real sense of what this whole process was like for someone totally new to the process.

There are a few more stragglers so if I get any more information I’ll make sure to share it here. In the meantime, go out and make some cool stuff or something!

(Source: inky)

My Two Shoes Weekend

Why?

When I decided to have the Two Shoes Weekend, it started as a personal goal. I was going to take a stab at using Shoes, which I had earmarked a long time ago as something I’d like to play with, and I was going to start and finish two projects within the span of the weekend.

I’m not sure how exactly, but telling someone that I was doing it turned into telling everyone that they should also do it. There was a bit of grumbling from people about my choice of toolkit, but I knew that the best way to make the goal attainable for me was to pick something that would end up feeling limiting— if the goal was “make as many things as possible using whatever you want to”, I would only half-finish one thing.

Why Two?

So why two? Well, basically because it wasn’t one and it wasn’t too much bigger than one. I wanted to push myself to see what I would do when I finished making something out of the first idea and had to move on to something else, but I wanted to make sure that I would reach my goal and was hoping to avoid feeling rushed to move on to other things before I was done with one idea just to meet my goal.

It worked pretty well! My first idea was something that I’m fairly used to— querying a website, pulling down some data, and formatting it. My second project involved implementing a physics equation, which is definitely not something I’m used to doing, as much as I’ve always liked the idea of making games and as much as “collision detection” is a basic concept within that world.

My Projects

As promised, I made two things! One fetches data from Twitter to make you laugh and the other is a graphical tech demo.

Big Fan

Big Fan loads the last 50 tweets that I’ve starred on Twitter. I follow a lot of funny people— some are professional comedians, some self-styled funny internet personalities, and some are just my really funny friends. When I see something that makes me laugh, I star it, and sometimes by myself or with my wife I review the jokes that I’ve starred recently just to laugh again. I think Twitter is a really great platform for joke delivery.

When Big Fan loads, it shows the most recent tweet that I starred. You can use page down or the down arrow key to view the tweets before the currently displayed tweet, and page up/the up arrow key to view the tweet after it. The Home and End keys go to the first and last tweets respectively.

Dots

Dots puts a bouncing dot on the screen. You can press the ‘a’ key to add another dot, and another, and another. After that, any dots you add will cause the oldest one to fade away and disappear forever. It’s a metaphor for life (right?) and a proof of concept for modeling perfect inelastic collision across two dimensions using Shoes’ basic “Shape” objects.

Dots also comes with dot.rb, a set of classes that does the heavy lifting with regards to wrapping up the Shoes shapes and handling collision detection. dot.rb could be expanded and re-used for other projects involving modeling 2D objects in a Shoes app.

P.S.: Shoes from Vim

After working on my first project for a few hours, I got tired of saving in vim, then dragging my .rb file from Finder to the Shoes dock icon. I took a moment to write a keybinding in vim to make open the currently open .rb file in Shoes based on the default install location in Mac OS X. On Sunday afternoon I realized that it might be helpful to other people to have the same thing, so I put it up on Github, at which point [inky] suggested that using open -a would make it even better. So I present to you the addition to your vimrc that will open the current .rb file in Shoes on Mac OS X:

How it Went

Pretty well; thanks for asking! I worked on this stuff for a decent chunk of the weekend, but I also saw a movie, went out for a few meals, hung out with my friend, drank some beers, talked to one of my college roommates, read a chapter of a book, and watched some TV with my wife, so it by no means dominated my weekend. Two things started and finished in that time! That’s pretty cool, right?

Gems & Shoes, Shoes & Gems

When I started on Friday night, I thought that I would just start using Ruby gems with wild abandon. Ruby has a wonderful community that has written a lot of code to make your life easier, so I was hoping to make use of that to make some really cool things. Unfortunately, I discovered that Shoes’ compatibility with gems is pretty limited.

The most obvious problem is that since Shoes is built with the purpose of packaging cross-platform applications in mind, you can’t use any gems that require “native extensions”, which is to say that installing the gems involves compiling any code for your specific platform (frequently it’s something that’s been written in pure C). This is regrettable, but it makes sense, and technically you can make it work on your own system at least if you’re familiar with the underpinnings of the Ruby environment and just copy gems into the right location for Shoes to find them.

Unfortunately, copying a gem into the right location isn’t enough— gems can have dependencies on other gems, which can obviously have dependencies of OTHER gems, and before you know it one pure-Ruby gem that you want to use requires getting 8 other gems set up within your Shoes environment, and 5 of those have native extensions, which means you can no longer package your app for other platforms.

This is a messy problem. I’m not sure that there’s a WHOLE lot that can be done about this, but I have a few ideas:

  • Shoes should be better at reporting errors with the Shoes.setup process. A Shoes.setup block is how you tell Shoes to install gems, but if you try to install Gems with native extensions on Snow Leopard it thinks for a very long time before giving you a confusing error message. The process is even more broken if the problem lies within a DEPENDENCY of a gem that you are trying to install. It would be nice if Shoes could be upfront about what went wrong.
  • We need some way to search for gems that are pure ruby and only depend on gems that are also pure ruby all the way through their dependency tree. This may exist somewhere already, but I don’t know how it works and I would really like this. That way you know which gems are safe to put in a Shoes.setup block if you’re trying to write a Shoes app with cross-platform packaging in mind.
  • It would be nice if you could somehow install gems with native extensions anyway if you’re only planning on targeting one platform. It’s possible that this still wouldn’t work, since I don’t know a whole lot about the Shoes code itself, but I’d like to investigate that as a possibility.
  • Last resort: make a script that, if you have a gem installed within your native Ruby environment, will copy it and all gems in its dependency tree into your Shoes environment so that you can use those gems on your computer (and give an easy way for other people to get their Shoes environment ready to run your app on their computers).

Shoes Error Logging

The error console in Shoes is really confusing. You frequently end up with no line number telling you where a problem is, and sometimes the program execution just seems to halt without ANY kind of error in the console. It took me half an hour to figure out that I was missing an “end” in one of my methods this afternoon because the method was being included from a different file via a ‘require’ directive. This is something that would have taken 60 seconds running a ruby program via the command line. The error console always reads “Debug in line 0” at the top even though the line number is sometimes mentioned within the error message below that— I’m not sure if that’s a problem with the MacOS X version or something I’m doing wrong, but it’s totally useless and needs to be fixed.

Teaching From Scratch

I was really happy that a few people took me up on the whole idea and spent part of their weekend working on making some things too. One was a veteran of doing creative things with computer science, one was a programmer who hasn’t coded outside of work in a long time, and a couple were people who had never written a line of code. These last two were tricky— the more I ran across weird issues in Shoes, the more worried I got that this was going to make it too difficult for them to accomplish anything. I spent a decent amount of time answering questions about syntax and trying to teach concepts like Arrays, Hashes, and how to make use of method calls returning a value. And it was great! I’m not sure if the non-programmers will ever program again, but I hope that amid the frustrations of “Shoes.app, not shoes.app” and “make sure all your do/ends match up” there were some flashes of “wow, I made that button do that!” I also got a few bug reports for the Windows version of Shoes that I managed to confirm on my work laptop that I’ll be reporting to the Shoes issue tracker on Github, and I’m glad that just within the scope of my friends’ learning about Shoes they managed to find some concrete ways we can improve Shoes.

What’s Next

I have some ideas for where to go from here based on what happened to me this weekend. I had never really played with Shoes before beyond stepping through a couple tutorials and filing it away as something I wanted to play with more later. Now I have played with it, and while I think it’s got some problems, I also think that what it DOES do right is pretty cool.

dot.rb

Dots!, my second project, wasn’t meant to take as long as it did. I had never written a collision detection engine before, let alone the physics of what to do when a collision does occur, and it took me longer to write that part than I would have liked. On Sunday I decided to spend some time refactoring the code to make it stand separate from any particular Shoes app and then did a little bit more work to pull common functionality into dot.rb so that more than one app could use it. Dots!, therefore, is just a tech demo, and I’d like to improve on dot.rb and play around with making games using it. I decided that rather than stress myself out this weekend with trying to make an entire game and have it in fully working order by Monday morning, I’d rather stick with something clean and polished that’s ready to be improved upon in the future.

Shoes Contributions

The reason I’m so blunt about the problems I saw with Shoes in this post isn’t because I’m a jerk. Well, it’s not JUST because I’m a jerk. I really do think Shoes is a neat idea and there are things about it that work really great right now, and I want it to get better and be totally awesome. When it comes to Ruby specifics, I’m still learning, but I’m hoping to spend some time now that I’ve seen particular pain points in Shoes working on fixing them. If I want them to work, what better way to ensure that they get done than to do them myself?

In any past time, this would be made more daunting, but I feel lucky that in this day and age we have the tools we do to streamline the work of contributing to a communal codebase and discussing it efficiently. With things like git and the community that’s out there on Github, it should be much easier to make changes and have them reviewed by people who can catch my mistakes.

Everyone Else

I know that at least 4 other people participated in the Two Shoes Weekend. I’ll be collecting their projects and will share as much information as they’re willing to let me share (definitely summaries, hopefully screenshots, maybe source code!) here on my blog. If you participated and you want to share, please email me.

TWO SHOES WEEKEND

HI

I’m going to sponsor a programming festival this weekend. From my apartment. With you all in your apartments/houses/cross-Europe sleeper cars. We’re all going to make TWO (2) things. Using SHOES, a fun Ruby toolkit for making computer things that work on Windows, Mac, and Linux.

PROGRAMMERS READ THIS

“Shoes?” you find yourself saying. “Cross-platform GUI toolkits are so dumb. Write once, run anywhere, yeah right. What a headache.” You’re probably right! I’m sure Shoes does all kinds of horrible things and I’m sure that some things that you think you want to do don’t work in Shoes! We could spend all weekend arguing about what the best way to program is and what environment you should write it in and which color scheme you should use in your text editor. But how about this? This weekend, instead of doing that, you write 2 things, just because you can. There are lots of things that Shoes can do, like make an arcade game or turn some internet meme into a goofy interactive  .exe/.app/.i_wish_you_linux_nerds_put_an_extension_on_the_end_of_your_binaries_right_now! So do that and show me what you’ve got!

NON-PROGRAMMERS READ THIS

“Shoes? Ruby? Programming? MAKING COMPUTER THINGS?” you find yourself saying. “I’m not some kind of magical wizard that can just turn lines of text into an interactive marvel!” But guess what! I’m here with good news! YOU TOTALLY CAN!

Shoes is relatively simple to use. You write your programming code into a text file (in Notepad! or TextEdit!) and then open Shoes and point it at your code and it just magically turns your lines of text into an interactive marvel!

If you fancy yourself a fairly analytical person, by browsing the Shoes website and The Shoebox, looking at example programs, you could probably piece together a simple program without too much effort. Will it be fancy? No, probably not! But you’ll have a runnable program that you can share with everyone, right? And you’ll go “I WROTE THAT” and that’ll probably feel pretty good! If you’ve never done it before, you might find that you like it!

If you’re not an analytical person, but you’re a creative person, try Hackety Hack! It uses Shoes to teach you Ruby and then you also know Shoes! If you work through the Hackety Hack stuff on Saturday, you still have all day on Sunday to make two things! And that’s all you have to do!

OKAY NOW EVERYONE READ THIS

I’m not sure if this is really going to work. I’m going to make my two things and I’ll post about them here on Monday. If other people do it, they should definitely email me about it (and feel free to put it on your own blog too). I’ll share whatever people do here as long as they tell me it’s okay to.

The key is to make two things before Monday morning. You can make more than two things, but I want to know about the first two things you made (don’t cheat!).