:: like newspeak, minus the ungood bits. ::

newstalk RSS Feed

Free Sky: A New Hope

I’ve been working on a reboot of Free Sky, codenamed “Shiny”, and things are coming along nicely. I’ve learned a lot about program structure in the last two years, and I’m finally beginning to understand the MVC (Model-View-Controller) way of making an app with a graphical interface. A lot of problems that seemed unapproachable two years ago now open themselves to solutions. Instead of writing reams of boilerplate code, my new controllers and views are slim and easy to understand. And I am finally beginning to understand and apply the most important design principle of all: You Ain’t Gonna Need It (a.k.a. YAGNI).

Several frameworks have influenced my new approach: TurboGears finally provided me with an elegant, cleanly encapsulated example of an MVC approach. The Cocos library for Pyglet demonstrated a simple method for managing flow control between screens, with their Director/Scene metaphor. Combining this metaphor with Python’s fairly new Context Manager idiom produces remarkably clean code. This is great, because GUI construction code is almost invariably messy and ugly, so having a clean container for it helps immeasurably.

Regarding YAGNI: I recently re-read The Pragmatic Programmer, and have just started reading Getting Real. I’ve now spent years slogging through reams of complex and buggy code that I once wrote, thinking at the time that “it might come in handy some day”. The principle that “unwritten code is the easiest to debug” now makes sense in a way far beyond head-nodding, “Yeah, that sounds nice, but… wouldn’t be cool if I did this thing, too?”

“Simplify, simplify, simplify!” cried Thoreau, and I’m finally getting around to it. My goal for Shiny in the next couple of months is to have a very small, barely playable game. I’ve been following the Roguelike development world for a little while, I’ve played Dwarf Fortress a few times, and I’ve been inspired to write the first iteration of Shiny in text-only mode, using the excellent python “TUI” library, Urwid. So without further ado, I’m going to go get to work, and leave you with this teaser:

     _____                                       //
    //  ) )                                     //
 __//__  __      ___      ___          ___     //___
  //   //  ) ) //___) ) //___) )     ((   ) ) //\ \ //   / /
 //   //      //       //             \ \    //  \ ((___/ /  
//   //      ((____   ((____       //___) ) //    \_\  / /
       You can't take it away from me. Shiny.<p><strong>Possibly related:</strong></p>
    None Found

Like what you see?

Don't forget to subscribe via RSS or email to receive updates when I post new material. Thanks!

Comments are closed.

Feedback: I'd love to hear what you have to say!
  1. I don't have time to manage or moderate a live comments forum, but I'd love to hear from you.
  2. (required)
  3. (valid email required)

cforms contact form by delicious:days