SPWA Week 2: Funding and Forms
« SPWA Week 1 Response: Code Hassles and Kittens
» Now Featuring Monsters
Games: PHP, satisficing, so play we all, templating
So Play We All is partly a motivation hack, with teammates/competitors and penalties to make sure we each put in time towards our games. Luke’s job sent him to a conference for almost all of the week, so he didn’t get to do any of his hours. He’s paying us both $20. To keep anyone from falling behind, we’ve tweaked the rules to say that anyone who pays the penalty for missed hours can make them up when they have the time.
Meanwhile, Jim’s done great, getting code live for the first time. I took a screenshot:
The first page has a simple login form. There’s no way to register an account, and any login/password you enter gives you the above message. In his blog post, Jim wrote about the code
At that point, it was a fairly easy task to take the user object and add its data to the display for rendering. I chose to go with something like:
Hello %user%! Your account was created at %time% on %date% and you last logged in at %time% on %date%. Enjoy your stay!
STOP IT. You are writing a template language in a template language! Templates are the one thing PHP actually does pretty decently (well, it’s not Haml, but it’s way better than TAL)! Wrap PHP’s output buffering around include() and get on with your life before you find yourself implementing conditionals and loops.
This is part of a larger topic I have to respond to:
This is mostly because I had to rush myself just to even get this far and put in lots of sloppy code. So, I’ve decided that I don’t care how far ahead the others get, I am not going to worry about matching their pace.
Really, it was an unrealistic goal that I’m glad to be letting go of. They’re using a pre-built framework which means they have options to solve a lot of their issues right out of the box. I, on the other hand, have to implement even my low-level functionality. This means that I’m going to be slower to execute no matter what happens. That’s the price that I pay for wanting to use my own implementation. The positive upside is that once I manage to solve these issues, they’ll be solved for me in all of my future games and I’ll be able to skip this tedium the next time around. …
Sure, it slows me down in terms of this competition, however, I will have 100% control over every aspect of the process which is not something that I would have if I were to leverage Drupal to build the game.
I know you write good code, Jim, but satisfice, man. You’ve got the worst time demands of all of us. Luke and I aren’t barfing into our editors and making sure it passes a syntax check, we’re taking acceptable components from other people so we spend our time on the important bits.
Last week I bought and added a theme to Oaqn. I was hugely tempted to tear it apart and make sure everything was perfect, with semantic class names and no unused code and efficient selectors and and and… Instead I added achievements, a feature that will help inspire and retain players for the lifetime of my game. That code’s not perfect, either, I already know I’ll want to tweak it to add some kind of bronze/silver/gold upgrading medals — but now I’ve got something decent in place and I can get closer to a running game.
Finish a game. So Play We All.