<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Manly Code</title>
  <id>http://manlyco.de/</id>
  <updated>2010-08-19T00:00:00Z</updated>
  <author>
    <name>Chris Rittersdorf</name>
  </author>
  <entry>
    <title>Lean iPhone Game Development: Day 10</title>
    <link href="http://manlyco.de/2011/07/20/lean-iphone-game-development-day-10/" rel="alternate"/>
    <id>/2011/07/20/lean-iphone-game-development-day-10/</id>
    <published>2011-07-20T00:00:00Z</published>
    <updated>2011-07-20T00:00:00Z</updated>
    <author>
      <name>Chris Rittersdorf</name>
    </author>
    <summary type="html">&lt;p&gt;It&amp;rsquo;s the night before I&amp;rsquo;m supposed submit this game to the iTunes App
store. I don&amp;rsquo;t have a starting menu, I don&amp;rsquo;t have an icon, or a splash
screen, and I only have some basic game mechianics working. What&amp;rsquo;s a&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;It&amp;rsquo;s the night before I&amp;rsquo;m supposed submit this game to the iTunes App
store. I don&amp;rsquo;t have a starting menu, I don&amp;rsquo;t have an icon, or a splash
screen, and I only have some basic game mechianics working. What&amp;rsquo;s a
developer to do?&lt;/p&gt;

&lt;h2&gt;What went wrong?&lt;/h2&gt;

&lt;p&gt;Aside from my own hubris, a few cards were stacked in the deck against
me. I had forgotten about family obligations in this last half week
of development. This took time away from development, and also writing
updates about the project.&lt;/p&gt;

&lt;p&gt;Also, Victor the designer had a busy week at work this week. So the character
design for the game has been pushed back (beyond the original end date).&lt;/p&gt;

&lt;h2&gt;Changing Gears&lt;/h2&gt;

&lt;p&gt;Since Victor couldn&amp;rsquo;t help out with the character design, It was up to
me to produce the artwork for the game. And I&amp;rsquo;m not artistic. So I had
to simplify things.&lt;/p&gt;

&lt;p&gt;While my PhotoShop skills are limited, my MSPaint Skills are amazing. So
I decided to make the game pixellated and have a retro feel. That means
the general theme for the game would have to change. So now instead of
&lt;strong&gt;Bastard Bricks&lt;/strong&gt;, it&amp;rsquo;s now &lt;strong&gt;Bit Bricks&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;What went right?&lt;/h2&gt;

&lt;p&gt;After several days of fumbling around with Box2D and not making much
progress, some advertisements on &lt;a href="http://www.raywenderlich.com/"&gt;raywenderlich.com&lt;/a&gt;
caught my attention wile I was reading through a tutorial. So I clicked on them.&lt;/p&gt;

&lt;p&gt;They took me to the websites for &lt;a href="http://www.levelhelper.org/"&gt;LevelHelper&lt;/a&gt; and
&lt;a href="http://www.spritehelper.org/"&gt;SpriteHelper&lt;/a&gt;. LevelHelper is a desktop
application that lets you drag, drop, and customize objects in a level.
This can then be exported and loaded into an Objective-C application.
This is everything I was trying to do programmatically, but failing
miserably at.&lt;/p&gt;

&lt;p&gt;&lt;a class="polaroid right" href="#" title="Level Helper"&gt;
  &lt;img src="/images/level_helper.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SpriteHelper takes an image, detects sprites in that image, then exports
them in a format that allows you use them within LevelHelper. It also
exports them into a format that allows you to use them directly in
Cocos2D as well.&lt;/p&gt;

&lt;p&gt;These two tools are amazing. The UI is a little clumsy to use, but for
the pair, I paid less than $35. I definitely got my money&amp;rsquo;s worth.&lt;/p&gt;

&lt;p&gt;In addition, I found a tool for authoring bitmaps bitmaps pixel by pixel called
&lt;a href="https://github.com/philippec/Pixen"&gt;Pixen&lt;/a&gt;. I haven&amp;rsquo;t used this much
yet other than creating squares, but it looks promising.&lt;/p&gt;

&lt;h2&gt;Demo&lt;/h2&gt;

&lt;p&gt;Although I&amp;rsquo;ve been quiet for the past several days, I have been working hard on Bit Bricks. I still
need menus, and bosses. But so far I have a functioning Breakout clone.&lt;/p&gt;

&lt;p&gt;You can see the progress that&amp;rsquo;s been made here:
&lt;object id="scPlayer" width="368" height="716" type="application/x-shockwave-flash" data="http://content.screencast.com/users/chrisrittersdorf/folders/Jing/media/d7dc1fb3-6fa8-45c9-9ee6-bddc133713a3/jingswfplayer.swf" &gt; &lt;param name="movie" value="http://content.screencast.com/users/chrisrittersdorf/folders/Jing/media/d7dc1fb3-6fa8-45c9-9ee6-bddc133713a3/jingswfplayer.swf" /&gt; &lt;param name="quality" value="high" /&gt; &lt;param name="bgcolor" value="#FFFFFF" /&gt; &lt;param name="flashVars" value="thumb=http://content.screencast.com/users/chrisrittersdorf/folders/Jing/media/d7dc1fb3-6fa8-45c9-9ee6-bddc133713a3/FirstFrame.jpg&amp;containerwidth=368&amp;containerheight=716&amp;content=http://content.screencast.com/users/chrisrittersdorf/folders/Jing/media/d7dc1fb3-6fa8-45c9-9ee6-bddc133713a3/00000004.swf&amp;blurover=false" /&gt; &lt;param name="allowFullScreen" value="true" /&gt; &lt;param name="scale" value="showall" /&gt; &lt;param name="allowScriptAccess" value="always" /&gt; &lt;param name="base" value="http://content.screencast.com/users/chrisrittersdorf/folders/Jing/media/d7dc1fb3-6fa8-45c9-9ee6-bddc133713a3/" /&gt; Unable to display content. Adobe Flash is required. &lt;/object&gt;&lt;/p&gt;

&lt;br /&gt;


&lt;br /&gt;


&lt;h2&gt;Submission to the Apple Store&lt;/h2&gt;

&lt;p&gt;Tomorrow, I&amp;rsquo;m going to try to cobble up a menu screen and submit Bit
Bricks as
a &amp;ldquo;light&amp;rdquo; application. Since it&amp;rsquo;s very light on features, I don&amp;rsquo;t want to start
charging for it quite yet. But I also don&amp;rsquo;t want to back down on my goal
of submitting this on the 11th day.&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s going to get rejected on the initial versions. So, to make lemons out of
lemonade, I will be posting updates about the Apple Rejection process.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lean iPhone Game Development: Day 3 &amp; 4</title>
    <link href="http://manlyco.de/2011/07/15/lean-iphone-game-development-day-3-and-4/" rel="alternate"/>
    <id>/2011/07/15/lean-iphone-game-development-day-3-and-4/</id>
    <published>2011-07-15T00:00:00Z</published>
    <updated>2011-07-15T00:00:00Z</updated>
    <author>
      <name>Chris Rittersdorf</name>
    </author>
    <summary type="html">&lt;p&gt;Things have not been going well for this project. I&amp;rsquo;ve been encountering road-block after road-block.
The past two days have been spent mostly reading documentation and tutorials&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Things have not been going well for this project. I&amp;rsquo;ve been encountering road-block after road-block.
The past two days have been spent mostly reading documentation and tutorials.&lt;/p&gt;

&lt;h2&gt;Required Reading&lt;/h2&gt;

&lt;p&gt;For the most part, I&amp;rsquo;ve been reading and re-reading the &lt;a href="http://www.box2d.org/manual.html"&gt;Box2D
manual&lt;/a&gt;. It&amp;rsquo;s a great library, which
does all the heavy lifting for position calculation and collision
detection. It feels really awkward to work with though. It&amp;rsquo;s been a while
since I&amp;rsquo;ve touched C++, so the syntax is a bit unfamilliar. In addition,
the C++ syntax looks gross sitting next to Objective-C.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;ve also been reading through &lt;a href="http://www.raywenderlich.com/"&gt;Ray Wenderlich&amp;rsquo;s Tutorials&lt;/a&gt;. This blog has
several really great iPhone tuturials. Where it shines are the Cocos2D
tutorials. There&amp;rsquo;s even a tutorial on &lt;a href="http://www.raywenderlich.com/475/how-to-create-a-simple-breakout-game-with-box2d-and-cocos2d-tutorial-part-12"&gt;how to build a Breakout Clone&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;What happened to my frame-rate?&lt;/h2&gt;

&lt;p&gt;&lt;a class="polaroid right" href="#" title="What happened?"&gt;
  &lt;img src="/images/day_3_4/7_frames.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;
I was able to get the ball moving around the screen by removing
gravity from the world (the physics context which objects move around
the screen relative to). This eliminated the need to add a vector to the ball to balance
out the world gravity. Progress.&lt;/p&gt;

&lt;p&gt;But upon running this in the simulator, I noticed that the frame-rate
had dropped from 60.0 FPS to 20.0 FPS. That&amp;rsquo;s not good. Especially when this is
in the simulator.&lt;/p&gt;

&lt;p&gt;I set up my provisioning profile and ran the code on my device. And just
as I expected, it was much worse. 7.0 frames per second. Completely
unusable.&lt;/p&gt;

&lt;p&gt;So I&amp;rsquo;ve got a lot of work and experimentation ahead of me. Hopefully
things will pan out.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Vino Veritas</title>
    <link href="http://manlyco.de/2011/07/13/vino-veritas/" rel="alternate"/>
    <id>/2011/07/13/vino-veritas/</id>
    <published>2011-07-13T00:00:00Z</published>
    <updated>2011-07-13T00:00:00Z</updated>
    <author>
      <name>Chris Rittersdorf</name>
    </author>
    <summary type="html">&lt;p&gt;There will be no &amp;ldquo;Day 3&amp;rdquo; on Day 3. It&amp;rsquo;s taking me forever to write about
what I&amp;rsquo;m doing (I write slowly). And also, I&amp;rsquo;ve been social with friends
today. Expect a digested post of Day 3 and Day&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;There will be no &amp;ldquo;Day 3&amp;rdquo; on Day 3. It&amp;rsquo;s taking me forever to write about
what I&amp;rsquo;m doing (I write slowly). And also, I&amp;rsquo;ve been social with friends
today. Expect a digested post of Day 3 and Day
4 with the next post.&lt;/p&gt;

&lt;h2&gt;Standing On My Soapbox&lt;/h2&gt;

&lt;p&gt;In the interim, if I may stand on my soapbox for a minute.&lt;/p&gt;

&lt;p&gt;&lt;a class="polaroid right" href="#" title="If you're apprehensive..."&gt;
  &lt;img src="/images/wine.jpeg"&gt;&lt;/img&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you haven&amp;rsquo;t lately, &lt;strong&gt;get into
a conversation with a stranger&lt;/strong&gt;. As a developer, I find my technical
skills to be adequate, but my people skills have something to be
desired. But, in software development, communicating with people is a
much more important skill than slinging code. And getting better at
this is something I&amp;rsquo;ve been trying to work on.&lt;/p&gt;

&lt;p&gt;I got into a conversation with a stranger tonight. It was brief, fun,
and interesting. So the next time you overhear an interesting
conversation, butt in. You&amp;rsquo;ll know if you&amp;rsquo;re welcome or not. If you&amp;rsquo;re
not, then who cares? You don&amp;rsquo;t know those people anyway. If you are
welcome, then you&amp;rsquo;ve gotten yourself into an interesting conversation,
haven&amp;rsquo;t you?&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;ve never been all that good with engaging with people. But I find the
more I do, the easier it gets. It&amp;rsquo;s when you stop caring about what others
think about you that you can let go and really get good at talking and
listening to others.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lean iPhone Game Development: Day 2</title>
    <link href="http://manlyco.de/2011/07/12/lean-iphone-game-development-day-2/" rel="alternate"/>
    <id>/2011/07/12/lean-iphone-game-development-day-2/</id>
    <published>2011-07-12T00:00:00Z</published>
    <updated>2011-07-12T00:00:00Z</updated>
    <author>
      <name>Chris Rittersdorf</name>
    </author>
    <summary type="html">&lt;p&gt;Sometimes the second steps of a journey are just as difficult as the
first. Today I finally dug into development and discovered that I&amp;rsquo;m in over my head in a few areas. To parrot the sentiment of Teen Talk Barbie: &amp;ldquo;Physics class is tough!&amp;rdquo;. I don&amp;rsquo;t have much choice except to buckle down and learn this stuff as fast as possible&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Sometimes the second steps of a journey are just as difficult as the
first. Today I finally dug into development and discovered that I&amp;rsquo;m in over my head in a few areas. To parrot the sentiment of Teen Talk Barbie: &amp;ldquo;Physics class is tough!&amp;rdquo;. I don&amp;rsquo;t have much choice except to buckle down and learn this stuff as fast as possible.&lt;/p&gt;

&lt;h2&gt;Working Prototype&lt;/h2&gt;

&lt;p&gt;Before putting any effort into design, I must first prove out the basic
concept of the game. Doing design work for a game that won&amp;rsquo;t fundamentally
function is like polisihing brass on the Titanic. Completely pointless.&lt;/p&gt;

&lt;h2&gt;Frameworks Galore&lt;/h2&gt;

&lt;p&gt;After taste-testing a few game engines I settled on &lt;a href="http://www.cocos2d-iphone.org/"&gt;Cocos2d&lt;/a&gt;
as the game engine for &lt;strong&gt;Bastard Bricks&lt;/strong&gt;. It&amp;rsquo;s free and it has an extensive community behind
it (something I always look for when choosing an open source library).&lt;/p&gt;

&lt;p&gt;Best of all, Cocos2D provides Xcode templates which create boiler-plate projects
for both &lt;a href="http://code.google.com/p/chipmunk-physics/"&gt;Chipmunk&lt;/a&gt; and
&lt;a href="http://www.box2d.org/"&gt;Box2D&lt;/a&gt;. I wanted to incorporate a physics engine
as the main means of motion for the sprites. These templates make my
work much easier. I settled on Box2D as that seemed to be what most
others on the Cocos2D forums were using.&lt;/p&gt;

&lt;h2&gt;Fleshing Things Out&lt;/h2&gt;

&lt;p&gt;Out of the box, the Cocos2D/Box2D demo app looks creates bricks that
drop based upon the gravity setup in the Box2D environment. It looks
something like this:&lt;/p&gt;

&lt;iframe width="600" height="410" src="http://www.youtube.com/embed/0KQTYc8xCBU" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;


&lt;p&gt;To create the stack of bricks at the top of the screen, I reverse the
gravity:&lt;/p&gt;

&lt;script src="https://gist.github.com/1079702.js?file=HelloWorldLayer.m"&gt;&lt;/script&gt;


&lt;p&gt;&lt;a class="polaroid right" href="#" title="Still needs some work."&gt;
  &lt;img src="/images/day_2/prototype1.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This made it so that the bricks would float to the top of the screen.
Then I place brick sprites on the screen next to each other in 4 rows. I
calculated them as carefully as possible, but I let gravity do most of
the work. In addition I colored each row similar to the Atari Breakout.
That just makes it look kind of nice.&lt;/p&gt;

&lt;p&gt;I was also able to add the ball as well by copying the sprite
configurations
for the bricks, and then modifying it. The Ball drops in the direction
of gravity, then comes to rest on the bricks. Not too exciting.&lt;/p&gt;

&lt;h2&gt;The Next Steps&lt;/h2&gt;

&lt;p&gt;This prototype is nowhere near complete. There&amp;rsquo;s several things I&amp;rsquo;d like
to get working before I&amp;rsquo;d be comfortable with proceeding. First, the
ball needs to move. I&amp;rsquo;ll have to figure out a way to balance out the
gravity and then give the ball its own motion vector.&lt;/p&gt;

&lt;p&gt;Also, I still don&amp;rsquo;t have any sort of user interaction. I need to get the
paddle on the screen and have it react to touches.&lt;/p&gt;

&lt;p&gt;As long as I can get these few things squeezed into this prototype. I
think I can make this work.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lean iPhone Game Development: Day 1</title>
    <link href="http://manlyco.de/2011/07/11/lean-iphone-game-development-day-1/" rel="alternate"/>
    <id>/2011/07/11/lean-iphone-game-development-day-1/</id>
    <published>2011-07-11T00:00:00Z</published>
    <updated>2011-07-11T00:00:00Z</updated>
    <author>
      <name>Chris Rittersdorf</name>
    </author>
    <summary type="html">&lt;p&gt;The first steps of any journey are the hardest. Today I was able to get
most of the tedious things out of the way. But I was also able to squeeze
some of the fun things in too&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;The first steps of any journey are the hardest. Today I was able to get
most of the tedious things out of the way. But I was also able to squeeze
some of the fun things in too.&lt;/p&gt;

&lt;h2&gt;The Busy Work&lt;/h2&gt;

&lt;p&gt;Although this project is not billable (workin' for free!), I set
up a &lt;a href="http://www.getharvest.com/"&gt;Harvest&lt;/a&gt; account in order to keep tabs
on where my time is going. I want to keep time spent on this project
to a minimum, so I&amp;rsquo;m using Harvest as a tool to keep an eye on things.&lt;/p&gt;

&lt;p&gt;I also renewed my enrollment in the Apple Developer Program. My initial
estimate of sunk costs was $99. I didn&amp;rsquo;t consider the tax. There&amp;rsquo;s always
tax. The cost invested now is a total of $104.94, which moves my initial
sales goal in the first month up to 150 units.&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s going on 3 hours now and I still haven&amp;rsquo;t gotten a confirmation from
Apple that my order was processed. This is just one of the many
headaches
I have to deal with involving the Apple mobile development process. They
do desktop UX so well, why can&amp;rsquo;t they apply that to their web services?&lt;/p&gt;

&lt;h2&gt;The Fun Part&lt;/h2&gt;

&lt;p&gt;&lt;a class="polaroid right" href="#" title='Hell Panzers: Too Big to
Succeed'&gt;
&lt;img src="/images/day_1/hell_panzers.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;
I came up with the idea for this project a while ago. I knew I&amp;rsquo;d have
this large chunk of free-time ahead of me and wanted to work on a pet
project I&amp;rsquo;d been thinking about for a while: Hell Panzers.&lt;/p&gt;

&lt;p&gt;The idea for Hell Panzers is a mobile turn based strategy game using tanks. But
really it was an excuse for me to mess around with NodeJS. I&amp;rsquo;d not only
have to create a client to play the game with, but also a server to run
the turn-based portion of the game. This idea was
simply too large for my own abilities. I needed to scale back.&lt;/p&gt;

&lt;p&gt;&lt;a class="polaroid left" style="margin-top: 1.0em" href="#" title='Standing on Shoulders of
Geniuses'&gt;
&lt;img src="/images/day_1/breakout.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;
Sipping coffee one day, I had an idea. Re-create the
Atari favorite &lt;a href="http://en.wikipedia.org/wiki/Breakout_(video_game)"&gt;Breakout&lt;/a&gt;,
but put a modern spin on it. Breakout is a simple game. You control a paddle, you bounce a ball against some
bricks, and the bricks disappear. That&amp;rsquo;s easy enough to implement. This simplicity
makes it a blank canvas for creativity.&lt;/p&gt;

&lt;p&gt;What if the bricks had personalities? What if they had different
behaviors? What if they had cute faces? Or ugly, angry ones? What if they
fight back?&lt;/p&gt;

&lt;p&gt;There are so many possibilities!&lt;/p&gt;

&lt;br /&gt;


&lt;h2&gt;Lunchin' and Sketchin'&lt;/h2&gt;

&lt;p&gt;My classical training is as a developer. I can picture how things
should look visually, but I have a difficult time executing it (refer to
my concept sketch from the &lt;a href="http://manlyco.de/2011/07/10/lean-iphone-gaming-building-a-product-in-11-days/"&gt;last post&lt;/a&gt;).
I&amp;rsquo;d need a lot of help designing this thing.&lt;/p&gt;

&lt;p&gt;&lt;a class="polaroid left" href="#" title="I
can't sketch.."&gt;
&lt;img src="/images/day_1/my_drawing.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I struck up a conversation with &lt;a href="http://mercilessrobot.com"&gt;Victor
Sirotek&lt;/a&gt; about my idea. I work with Victor. He&amp;rsquo;s a designer
at &lt;a href="http://mutuallyhuman.com"&gt;Mutually Human Software&lt;/a&gt;. But more
importantly, he&amp;rsquo;s a gamer, he can illustrate, and he liked my idea. So we
grabbed lunch.&lt;/p&gt;

&lt;p&gt;Over some delicious cuisine we threw ideas back and fourth. Mostly about
character design and gameplay. Having the bricks be just that, bricks, is boring. You
hit them with the ball and they disappear. That&amp;rsquo;s not interesting. So we
decided to give them faces. Angry ones. Ones that get madder and madder each time you hit
them. They wobble and shake, get furious and attack you.&lt;/p&gt;

&lt;p&gt;&lt;a class="polaroid right" href="#" title="...
but Victor can!"&gt;
&lt;img src="/images/day_1/victors_drawing.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I sketched out the basic dynamics of the game (Breakout, but using a
physics engine). Then Victor sketched a character in detail. At the end
of lunch, our heads were swollen with ideas of how we want this
thing to work. The biggest take-away from the discussion was the working
title for the game: &lt;strong&gt;Bastard Bricks&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We both decided that before doing any actual design work, we should
prove out the feasibility of the game dynamics. So tomorrow, I will create a
functional prototype and get it in front of people.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lean iPhone Gaming: Building a Product in 11 Days</title>
    <link href="http://manlyco.de/2011/07/10/lean-iphone-gaming-building-a-product-in-11-days/" rel="alternate"/>
    <id>/2011/07/10/lean-iphone-gaming-building-a-product-in-11-days/</id>
    <published>2011-07-10T00:00:00Z</published>
    <updated>2011-07-10T00:00:00Z</updated>
    <author>
      <name>Chris Rittersdorf</name>
    </author>
    <summary type="html">&lt;p&gt;Taking lessons learned from lean startups, I&amp;rsquo;m going to build and
market an iPhone game in 11 days. I have no experience in game
development, but why would that deter me?&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Taking lessons learned from lean startups, I&amp;rsquo;m going to build and
market an iPhone game in 11 days. I have no experience in game
development, but why would that deter me?&lt;/p&gt;

&lt;p&gt;&lt;a class="polaroid right" href="#" title='"Character Design"'&gt;
&lt;img src="/images/11_days/character_design.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Finding Inspiration&lt;/h2&gt;

&lt;p&gt;This past May I had the opportunity to attended the West Michigan Lean &lt;a href="http://www.momentum-mi.com/events/lean-conference/"&gt;Startup
Conference&lt;/a&gt;. I
originally hadn&amp;rsquo;t planned on attending. I thought the event was sold out
before I had the inkling to go. Fortunately for me I was able to attain
admission.&lt;/p&gt;

&lt;p&gt;And I&amp;rsquo;m glad I did. It was an excellent conference, and I came out of it
understanding how modern businesses are created.&lt;/p&gt;

&lt;p&gt;I took some of what I&amp;rsquo;d heard with a grain of salt. I&amp;rsquo;m a skeptic by
nature, and some of the things they were talking about seemed un-applicable
to a tech climate like Grand Rapids, MI.&lt;/p&gt;

&lt;p&gt;After all, several of the speakers were from &amp;ldquo;The Bay&amp;rdquo;. My impression of
California is that you can&amp;rsquo;t throw a rock down the street without
hitting a VC or angel investor willing to take a risk on your rock
throwing startup. While West Michigan has a growing tech scene, it&amp;rsquo;s a
far cry from the leviathan out west.&lt;/p&gt;

&lt;h2&gt;Lessons Learned&lt;/h2&gt;

&lt;p&gt;Skepticism aside, I did walk away from the conference full of ideas and
inspired. Much of what I did take away from it was the essence of what
everybody discussed.&lt;/p&gt;

&lt;p&gt;First and foremost &lt;strong&gt;build something and show it to people&lt;/strong&gt;. I&amp;rsquo;m a
developer and as such, I build things. I can&amp;rsquo;t count how many times I&amp;rsquo;ve
built something an never shown it off because &amp;ldquo;it&amp;rsquo;s just not that good&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;If you show your product to people and elicit feedback from them, then you can
determine why it&amp;rsquo;s not good. You can then tweak it until it is a
product that somebody wants.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who cares if it&amp;rsquo;s a failure?&lt;/strong&gt; As long as you minimize the cost of
failing, your return on investment is the knowledge gained from doing
things wrong. You can always try again, but with the lessons learned
from your past mistakes.&lt;/p&gt;

&lt;h2&gt;The Ground Rules&lt;/h2&gt;

&lt;p&gt;So I&amp;rsquo;m going to apply the lessons I learned at this conference and
flesh out an idea I&amp;rsquo;ve had for some time.&lt;/p&gt;

&lt;p&gt;This idea is a video game for the iPhone. It&amp;rsquo;s going to be a casual game very simple. I intend on
marketing it for 99&amp;#162; on the iTunes App Store. I want to make it
something I would play, and something that others would enjoy playing.&lt;/p&gt;

&lt;p&gt;My main goal is to break even (on actual costs) within the first month.
Right now my only cost is paying for the Apple Developer Program ($99). If I make
70&amp;#162; per unit that means I need to sell 143 of them. On the 11th
day I will submit whatever I have to the iTunes App Store (regardless of
done-ness).&lt;/p&gt;

&lt;p&gt;As it goes without question, my family and career come first. I have a
9-5  at &lt;a href="http://www.mutuallyhuman.com/"&gt;Mutually Human Software&lt;/a&gt; that I need to stay sharp for. So I need to be cautious about how much
time is spent on this so as to avoid burnout.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m hoping that these constraints will help me get things done faster as
opposed to thinking about things I need to do and leaving deadlines open
ended.&lt;/p&gt;

&lt;h2&gt;Stay Tuned!&lt;/h2&gt;

&lt;p&gt;Each day I plan on blogging about my progress. This is very much a
learning experience for me. Not only because of the technical hurdles
I&amp;rsquo;ll have to bound, but also because it&amp;rsquo;s my first experience with
marketing and customer development.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Setting Firebug Ablaze With 'debug;'</title>
    <link href="http://manlyco.de/2010/12/02/setting-firebug-ablaze-with-debug/" rel="alternate"/>
    <id>/2010/12/02/setting-firebug-ablaze-with-debug/</id>
    <published>2010-12-02T00:00:00Z</published>
    <updated>2010-12-02T00:00:00Z</updated>
    <author>
      <name>Chris Rittersdorf</name>
    </author>
    <summary type="html">&lt;p&gt;Firebug is a tool well loved by all web developers. You can modify CSS on the fly.
You can view your DOM. You can easily view JavaScript errors. You can even debug JavaScript. I&amp;rsquo;ve&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Firebug is a tool well loved by all web developers. You can modify CSS on the fly.
You can view your DOM. You can easily view JavaScript errors. You can even debug JavaScript. I&amp;rsquo;ve
never really used it for that though. I&amp;rsquo;d always found setting breakpoints in Firebug to be tedious.
But after today, things have changed for me.&lt;/p&gt;

&lt;p&gt;&lt;a class="polaroid left" href="#" title="Weeeeeeeeeeeeeeeeew!"&gt;
  &lt;img src="/images/firebug/redneck_fire_starter.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Setting Breakpoints Within Firebug&lt;/h2&gt;

&lt;p&gt;Whenever I wanted to set a breakpoint, I would first have to click through a file list in the
script tab, then scroll through the source to the line I wished to set the breakpoint on,
click on it, then reload the page. Too many steps. I&amp;rsquo;ve always opted to litter my code with
&lt;strong&gt;&lt;em&gt;console.log();&lt;/em&gt;&lt;/strong&gt; instead. That much simpler to do than setting a breakpoint. This console
technique has served me well for the past several years.&lt;/p&gt;

&lt;br/ &gt;


&lt;br/ &gt;


&lt;h2&gt;Setting Breakpoints Within JavaScript&lt;/h2&gt;

&lt;p&gt;While working on a project with my fellow developers at &lt;a href="http://www.mutuallyhuman.com/"&gt;Mutually Human Software&lt;/a&gt;,
I found myself having to set several brakpoints for some JavasScript. Tired of this,
I did a Google search for &lt;em&gt;&amp;ldquo;setting a firebug breakpoint in code&amp;rdquo;&lt;/em&gt;.
The Google gods smiled upon me and blessed me this this little gem: &lt;a href="http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBYQFjAA&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Ffirebug%2Fbrowse_thread%2Fthread%2F1bc2239c0c7047bb&amp;amp;ei=Qez4TPe7C-jfnQfBrtDrCA&amp;amp;usg=AFQjCNGKdRIvjb_nx8KePzprimOZqNjq_Q&amp;amp;sig2=XiEEiR2quGt0qe_1bTKvXA"&gt;how to set breakpoints
from within JS code?&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Amazing! You can set breakpoints from within your JavaScript. Simply call &lt;strong&gt;&lt;em&gt;debugger;&lt;/em&gt;&lt;/strong&gt; in the
place where you would like the browser to stop executing the JavaScript and hand
control over to you.&lt;/p&gt;

&lt;p&gt;Here is a small example. Say you have an HTLM file that loads the following
JavaScript file &lt;strong&gt;hello_debugger.js&lt;/strong&gt;:&lt;/p&gt;

&lt;script src="https://gist.github.com/726519.js"&gt; &lt;/script&gt;


&lt;p&gt;If you start Firebug and view the HTML file, the &amp;ldquo;debugger;&amp;rdquo; keyword
gets interpreted and Firebug breaks the execution of the code.&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/firebug/breakpoint.jpg"&gt;&lt;/img&gt;&lt;/p&gt;

&lt;p&gt;You can set a watch expression or peek at the status of DOM elements at this point.
In addition, the console has the same context as the location of the breakpoint.&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/firebug/console.jpg"&gt;&lt;/img&gt;&lt;/p&gt;

&lt;p&gt;In this snapshot, you can see that the console has full knowledge of &lt;strong&gt;anObject&lt;/strong&gt; and &lt;strong&gt;anArray&lt;/strong&gt;. This is the
same context as the closure that lexically scopes the contents of the &lt;strong&gt;&lt;em&gt;hello_debugger.js&lt;/em&gt;&lt;/strong&gt; file. From the
Firebug console, if you type in:&lt;/p&gt;

&lt;script src="https://gist.github.com/726947.js"&gt; &lt;/script&gt;


&lt;p&gt;Then you&amp;rsquo;ll see from the alert that the object is in-fact the one you defined in your file.&lt;/p&gt;

&lt;p&gt;I like this method of using console rather than setting up watches. Since I&amp;rsquo;m a rubyist, using the console
feels more like using the Ruby debugger as opposed to using the GUI based tools provided by Firebug.&lt;/p&gt;

&lt;p&gt;Calling &lt;strong&gt;&lt;em&gt;debugger;&lt;/em&gt;&lt;/strong&gt; from code also works in Google Chrome. I haven&amp;rsquo;t tried this with any other
browsers though. So give it a try. Hopefully you find this to be a useful item to have
in your toolbox too.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Obviously, You're Not a Golfer</title>
    <link href="http://manlyco.de/2010/08/19/obviously-youre-not-a-golfer/" rel="alternate"/>
    <id>/2010/08/19/obviously-youre-not-a-golfer/</id>
    <published>2010-08-19T00:00:00Z</published>
    <updated>2010-08-19T00:00:00Z</updated>
    <author>
      <name>Chris Rittersdorf</name>
    </author>
    <summary type="html">&lt;p&gt;JavaScript is production code and should be treated just like your server side code. It helps define
the user experience of your web application, so it&amp;rsquo;s important to write robust JavaScript. In the past,&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;JavaScript is production code and should be treated just like your server side code. It helps define
the user experience of your web application, so it&amp;rsquo;s important to write robust JavaScript. In the past,
web applications were essentially server driven front ends for databases. JavaScript was used to add a little
polish to these front-ends. But with HTML5 gaining traction, web
applications are becoming rich client-side tools available not only to web browsers, but to mobile
devices as well. JavaScript will play a much larger roll in your day-to-day development of
web applications in days to come.&lt;/p&gt;

&lt;h2&gt;TDD and JavaScript&lt;/h2&gt;

&lt;p&gt;For the longest time, I didn&amp;rsquo;t use TDD when developing in JavaScript. At the time I only needed
to use JavaScript to do minor DOM updates. Eventually I had to code forms that included
business logic. As the complexity of the code increased, the likelihood of my code being
altogether broken increased as well. I had to re-evaluate how I was using JavaScript.&lt;/p&gt;

&lt;p&gt;For a majority of my professional development career, I&amp;rsquo;ve practiced Test Driven Development
for all of my server side code. TDD is something I feel very strongly about. I write
better code when I practice TDD. It makes me think in advance about how to design my code.
My code becomes more modular as complexity increases, which makes it easier to maintain.
Most importantly though, TDD give me confidence
about my code. So why didn&amp;rsquo;t I originally feel the same way about TDD with Javascript?&lt;/p&gt;

&lt;p&gt;&lt;a class="polaroid left" href="#" title="Not on the JavaScript... man!"&gt;
  &lt;img src="/images/not-a-golfer/im-the-dude.jpg"&gt;&lt;/img&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The root cause was that I didn&amp;rsquo;t understand the language. Being a Rubyist, I&amp;rsquo;d treated JavaScript much
like ruby. I&amp;rsquo;d become accustomed to the hand holding that
the Prototype framework provided since it was included with Rails. My code was a mess and it would take me
significantly longer to develop in JavaScript than Ruby. So I broke down and
bought (I hate purchasing technical books for specific technologies) &lt;a href="http://oreilly.com/catalog/9780596517748"&gt;JavaScript:
The Good Parts&lt;/a&gt;. It was very insightful and for me it was shocking to see how incredibly
incorrect I was about how to use JavaScript.&lt;/p&gt;

&lt;p&gt;Now I&amp;rsquo;m able to think and code in JavaScript. I then applied the same principles
of test driven development to my JavaScript work-flow. I tried a few testing frameworks (&lt;a href="http://www.jsunit.net/"&gt;JSUnit&lt;/a&gt;,
and &lt;a href="http://github.com/nkallen/screw-unit"&gt;ScrewUnit&lt;/a&gt;) but eventually settled on &lt;a href="http://visionmedia.github.com/jspec/"&gt;JSpec&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;JSpec is a behavior driven development framework based on RSpec. Snice I do all of my
unit level testing with RSpec, JSpec was a comfortable fit for me. It has a DSL to
define specifications (before, after, describe, and it blocks). And also
a matcher library to add some syntactic sugar to your assertions.&lt;/p&gt;

&lt;h2&gt;&amp;hellip;let&amp;rsquo;s go bowlin'!&lt;/h2&gt;

&lt;p&gt;&lt;a class="polaroid right" href="#" title="Mark it ZERO!" style="margin-top: -40px"&gt;
  &lt;img src="/images/not-a-golfer/markitzero.jpeg"&gt;&lt;/img&gt;
&lt;/a&gt;
The following is JSpec in action. It uses the Ron Jeffries' bowling game as an
example. This is generally the first bit of TDD a developer sees. It explains
the general red-green-refactor workflow of TDD, and stresses the importance of
keeping your code clean.&lt;/p&gt;

&lt;p&gt;To begin a JSpec project needs to be created.&lt;/p&gt;

&lt;br/&gt;


&lt;p&gt;First, install JSpec and set up the project:&lt;/p&gt;

&lt;script src="http://gist.github.com/539018.js?file=gistfile1"&gt;&lt;/script&gt;


&lt;p&gt;The library file and its spec file get renamed to something that has meaning. The
test runner also needs to get updated to reference the renamed files:&lt;/p&gt;

&lt;script src="http://gist.github.com/539030.js?file=dom.html"&gt;&lt;/script&gt;


&lt;p&gt;Now, start the spec watcher:&lt;/p&gt;

&lt;script src="http://gist.github.com/539034.js?file=gistfile1"&gt;&lt;/script&gt;


&lt;p&gt;This starts a process that detects changes in the spec or implementation files then opens a Firefox tab that
runs all specs for the project.&lt;/p&gt;

&lt;p&gt;There needs to be a place to hang the code, so the initial test will ensure
that the library exists.&lt;/p&gt;

&lt;script src="http://gist.github.com/539303.js?file=bowling_game.spec.js"&gt;&lt;/script&gt;


&lt;p&gt;It fails with &amp;ldquo;ReferenceError: BowlingGame is not defined&amp;rdquo;. Make it pass by
adding a factory to generate a BowlingGame object:&lt;/p&gt;

&lt;script src="http://gist.github.com/539303.js?file=bowling_game.js"&gt;&lt;/script&gt;


&lt;p&gt;Then create a spec to excercise the game logic. The simplest game a player can roll is all gutterballs:&lt;/p&gt;

&lt;script src="http://gist.github.com/539350.js?file=bowling_game.spec.js"&gt;&lt;/script&gt;


&lt;p&gt;And this fails with &amp;ldquo;TypeError: game.roll is not a function&amp;rdquo;. So define the methods
under test on the BowlingGame lib:&lt;/p&gt;

&lt;script src="http://gist.github.com/539350.js?file=bowling_game.js"&gt;&lt;/script&gt;


&lt;p&gt;And the spec passes. The next simplest game is one where the player rolls all 1s.&lt;/p&gt;

&lt;script src="http://gist.github.com/539365.js?file=bowling_game.spec.js"&gt;&lt;/script&gt;


&lt;script src="http://gist.github.com/539365.js?file=spec.helper.js"&gt;&lt;/script&gt;


&lt;p&gt;In this iteration I extracted the &amp;ldquo;player rolls&amp;rdquo; part of the describe blocks into
a shared describe block. The output still has &amp;ldquo;player rolls&amp;rdquo; in it. I also
pulled the for loop into the &amp;ldquo;roll_a&amp;rdquo; helper located in the spec.helper.js file. This
file gets loaded before any of the specs run.&lt;/p&gt;

&lt;p&gt;Now make the spec pass:&lt;/p&gt;

&lt;script src="http://gist.github.com/539365.js?file=bowling_game.js"&gt;&lt;/script&gt;


&lt;p&gt;So far the design is simple. There is an accumulator variable that gets incremented
by the number of pins felled for a roll.&lt;/p&gt;

&lt;p&gt;The next case to test is when the player rolls a spare:&lt;/p&gt;

&lt;script src="http://gist.github.com/539387.js?file=bowling_game.spec.js"&gt;&lt;/script&gt;


&lt;p&gt;This fails with the message &amp;ldquo;expected 15 to eql 18&amp;rdquo;. Now the design needs to change.
In order to detect that the player rolled a spare, the code needs to be able to look
forward and backward in the history of rolls.&lt;/p&gt;

&lt;script src="http://gist.github.com/539391.js?file=bowling_game.js"&gt;&lt;/script&gt;


&lt;p&gt;This design changes satisfies the previous specs, but it doesn&amp;rsquo;t satisfy the
case that exercises a spare. It needs further refinement.&lt;/p&gt;

&lt;script src="http://gist.github.com/539396.js?file=bowling_game.js"&gt;&lt;/script&gt;


&lt;p&gt;In this iteration, the score is calculated by frame (like any good bowling game should).
This allows for the game to detect if the player has rolled a spare. It can also look
ahead to calculate the bonus for the spare.&lt;/p&gt;

&lt;p&gt;Now to test for a strike:&lt;/p&gt;

&lt;script src="http://gist.github.com/539407.js?file=bowling_game.spec.js"&gt;&lt;/script&gt;


&lt;p&gt;And it fails with &amp;lsquo;expected NaN to eql 28&amp;rsquo;. There&amp;rsquo;s an indexing error. And the fix:&lt;/p&gt;

&lt;script src="http://gist.github.com/539407.js?file=bowling_game.js"&gt;&lt;/script&gt;


&lt;p&gt;Success! Now for the grand finale, the perfect game:&lt;/p&gt;

&lt;script src="http://gist.github.com/539422.js?file=bowling_game.spec.js"&gt;&lt;/script&gt;


&lt;p&gt;Our game logic satisfies this case. We&amp;rsquo;ve made some manly code! Even if JSpec isn&amp;rsquo;t
a good fit for you, at least give some form of TDD a try. The final code for this
exercise is available on &lt;a href="http://github.com/manlycode/jspec-bowling"&gt;my github account&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
</feed>
