![]() |
Articles Feed |
Categories
Archives
- July 2010 (5)
- June 2010 (4)
- April 2010 (3)
- March 2010 (2)
- February 2010 (2)
- January 2010 (1)
- December 2009 (1)
- October 2009 (2)
- September 2009 (2)
- August 2009 (1)
- July 2009 (5)
- June 2009 (2)
- May 2009 (2)
- April 2009 (8)
- March 2009 (7)
- January 2009 (2)
- December 2008 (3)
- November 2008 (5)
- October 2008 (4)
- September 2008 (6)
- August 2008 (4)
- July 2008 (5)
- June 2008 (5)
- May 2008 (4)
- April 2008 (2)
- February 2008 (4)
- January 2008 (2)
- December 2007 (2)
- November 2007 (2)
- October 2007 (2)
- September 2007 (1)
- August 2007 (3)
- July 2007 (1)
- June 2007 (4)
- May 2007 (7)
- April 2007 (2)
- February 2007 (3)
- January 2007 (3)
- November 2006 (3)
- October 2006 (3)
- September 2006 (17)
- November 2004 (1)
Reflection on Hangman
by: micah | October 4th, 2009 | 7 comments »
Last week concluded the Hangman Ruby Sparring Tournament. The results are below.
Unlike the previous Battleship Tournament, I put the effort in to write a competitive hangman player (of course he was banned from competition). This made things interesting. By knowing precisely what it takes to create a player, I was able to precisely tune the scoring metrics. My goal with the scoring metrics was to evaluate the code, without actually looking at it myself, and rate it’s quality/cleanliness on a scale of 0 to 100, where 100 was asymptotically impossible to reach.
It is not easy to score well on ALL the metrics. Each metric will push your code in a different direction some of them are opposing. For example, to score well on the flog metrics, you have to break your code up in to lots of tiny methods. However, extracting methods increases the amount of code you have which brings down the simplicity score. To get an overall high score requires compromising between opposing metrics over and over again. Realistically, writing clean code requires the same type of compromising between coding principles. I am thoroughly impressed with the high scores that people were able to achieve in this tournament.
In the end, I believe that the highest scoring players do fit many of the criteria for “clean code”. Which is to say that to metrics used to evaluate the code are fairly complete. However, there is one gaping hole. The highest scoring solutions look like this:
- def b
- @r.fill(0)
- c
- @l = @l.sort_by { |x| @r[x] }
- end
People discovered that by using short variable names and method names, they could considerably reduce the “simplicity” of their solution. For this tournament, the simplicity score measures the code mass (compress all the code and count the bytes). It’s a fair metrics because in general, the less code there is, the less code people have to read to understand it. I especially like the fact that comments hurt the score. Anyhow, clearly the code above is not good code.
What’s missing is a analysis tool to measure “Readability” of code. I imagine such a tool would be similar to flog and flay in that it parses your code and examines all names used for variables, methods, classes, etc. When it finds 1-letter names like above, it punishes. When it finds names containing english (or other languages) words, or derivatives of other names, it rewards. For example, it I had a class named “Player”, that’s an english word which is readable. Good. Now a class named “ThingAmaBob” is not english but that not necessarily bad. And you’d expect variables with names like “mythingamabob” or “thingama_bobs” which would be good. There are plenty of ways to expand on the idea. Such a tool would bring our repertoire of metric tools one step close to completion.
Hangman Tournament
by: micah | August 28th, 2009 | 12 comments »
Several months ago, I hosted the Ruby Battleship Tournament. It was an all-round fun event where craftsmen sharpened their claws and pitted their skills against their peers. Since then, there has been much interest in the next tournament.
Today I am announcing the commencement of the Ruby Hangman Tournament. In this tournament your challenge is to build an AI to play hangman. Unlike Battleship, your AI will not battle against opponents, but will instead play solo. You must teach your player how find words as accurately and as quickly as possible.
The most prodigious player will be dubbed Tournament Champion. But this is a tournament of Craftsmanship, so the ultimate title will be awarded to the Tournament Master. To earn this most prestigious of monikers, your player must not only play hangman spectacularly, but also be crafted with the utmost quality of code.
Getting started is easy. Simply follow the instructions to get a default AI generated and running on your computer. Then all you have to do is tweak the solution to be as good as you can get it before the end of September.
This is a great way to practice your craft. You could introduce the tournament in your next user group meeting. Show it to your peers over lunch and learn.
You can also just play the game if you like (screenshot below). Good luck!

Announcing chiPhone
by: eric | July 9th, 2009 | 0 comments »
It’s with great pleasure that I announce the creation of chiPhone, the Chicago iPhone developer’s group, with our first meeting on July 23rd at 6:30. The fourth Thursday of every month should feature interesting presentations, hackfests, and everything else you’d expect from a quality developer group.
The group website is now up and running at www.chiphonegroup.org where you can register there to attend the first meetup. In addition you’ll find directions to the 8th Light offices, where most of our meetings will take place, and the announcement of the topic for the next meeting. As the official site website all further information will be posted there, including video recording of the talks.
The first meeting will feature a presentation by “the Eric’s” on Test Driven Development for the iPhone. We’ll be starting with the basics of setup and work all the way through Dependency Injection using Interface Builder. Bring your Macs so you can grab our github project for experimenting. Get to the 8th Light offices early for pizza and refreshments.
8th Light is located just off of Route 45 in Libertyville, and detailed directions are available on the chiPhone website. In addition we are near the Libertyville train station, just email me if you need to arrange to be picked up.
I’m looking forward to a lot of great meetups, and I’ll be asking you to provide some topics in the near future.
Simon
by: micah | November 10th, 2008 | 0 comments »
You remember the classic Simon game, right? The one where the electronic devise will blink a color and make a sound that you have to replicate by pushing the colored buttons.
At RubyConf 2008, I cornered Jim Weirich and asked his opinion on Limelight. He didn’t feel like he had seen enough of it to give a good opinion. So we found an hour where we could both sit down and build a simple Limelight production. We decided to build Simon.
The result is really quite simple. It’s a couple hundred lines of code, UI, game logic, and all. It’s also got a suite of unit tests.
If Limelight is installed, you can download the production file, and double click it, or enter the url in the Startup Limelight Production.
Limelight Production file: http://blog.8thlight.com/files/simon.llp
The Source Code can be found on github.
Ruby Battleship Sparring Tournament
by: micah | November 8th, 2008 | 0 comments »
Yesterday in my talk at RubyConf2008, I announced the commencement of the Ruby Battleship Sparring Tournament.
This is an open tournament. All are welcome to participate.
How Jim got started programming
by: jim | October 6th, 2008 | 0 comments »
Tagged by Micah Martin, Paul Pagel, and Eric Smith.How old were you when you started programming?
I took an introduction to programming college class when I was a sophomore in college, so 18 years old.How did you get started programming?
I was looking for a new major after deciding chemistry (and lab work in particular) probably wasn't for me. So I decided to try a few different classes, hoping to find something that interested me. I took an accounting, an economics, and a programming class. Luckily, I got hooked on programming instead of becoming an accountant.What was your first language?
JavaWhat languages have you used since you started programming?
Java, C++, Perl, JavaScript, Python, C#, ColdFusion, VB 6.0, VB.NET, VBA, PHP, Ruby, Objective-CWhat was the first real program you wrote?
Late in my sophomore year, I was fortunate and landed a job with the US Geological Survey (USGS) in Urbana, IL. At this point, nearly all of the programming I had ever done were machine problems for my CS classes. I was thrown into a whole new world of web programming, tasked with writing CGI scripts with this weird looking language called Perl. My first project was to write an application to disseminate groundwater data to Illinois residents visiting this site. This was all done using Perl to dynamically generate horrendous HTML.What was your first professional programming gig?
Web developer for USGSIf there is one thing you learned along the way that you would tell new developers, what would it be?
You don't know as much as you think you do. Even the best developers are constantly learning and working to improve their craft. To do this, you need to read about technologies that are new to you and then practice, practice, practice. You cannot limit your learning to between 9 and 5.What’s the most fun you’ve ever had programming?
It probably sounds passe by now, but the project that I and many of the 8th Lighters are currently working on has been the best professional experience I have ever had. Never have I worked with a group of people so concerned about and cognizant of the quality of the work and the success of the project. Software is a people business, and working with great people makes even the most mundane tasks bearable and the most difficult challenges surmountable. Next up: Eric Meyer and Matt Segvich.How Paul started coding
by: paul | August 13th, 2008 | 0 comments »
Tagged by Micah Martin
How old were you when you started programming.
I was around 12
How did you get started programming.
Whenever I would visit my grandmother growing up, one of the highlights was she had space invaders on her computer. Once, my Uncle Don saw me captivated by space invaders and decided to show me how computer games/application are written. He pulled up a command prompt in DOS and started writing QBasic code to create a simple application. I was amazed that it was so easy to talk to a computer. I wanted to do it myself.
What was your first language?
BASIC
What languages have you used since you started programming?
What languages have you used since you started programming?
Java, C++, C#, SAS, JavaScript, CSS, HTML, Ruby, C, Basic, Python, Assembly Language, Visual Basic, SQL, ASP
What was the first real program you wrote?
In school I wrote a Jabber client in C#. I was impressed by the drag and drop rich client tools in Visual Studio. That lasted about a day.
What was your first professional programming gig?
Working for a client project with Object Mentor. The first team I was on included Micah Martin, David Chelimsky, Tim Ottinger, Dave Astels, Craig Demyonovich, James Grenning, and Dean Wampler. I had more than just a few mentors to learn from. It was an awing experience for me seeing how great coders code.
If there is one thing you learned along the way that you would tell new developers, what would it be?
Play well with others. It takes teams working well together to create most meaningful software.
What’s the most fun you’ve ever had programming?
Working with the 8th Light team on a project. Many times seeing the requirements for a story, I will say to myself, “can that even be done”? After seeing creative solutions from the team, it has taught me if you are working with good people and good tools, there are only endless solutions. The most amusing thing to learn about programming is if something isn’t all ready there, invent it.
Tagging: Adam Wonak, Jim Suchy, Bob Payne
How Doug got started programming
by: doug | August 8th, 2008 | 0 comments »
Tagged by Micah Martin
How old were you when you started programming.
When I was about 11 or so I bought a Color Computer III at a garage sale. I started typing in some basic programs that I found in a math text book or something. I had no disk or tape drive, so I had to start over every time I turned the computer on. I don’t remember what the program did. I do remember playing the game with the bouncing ball, paddle and busting up bricks.
How did you get started programming.
I started writing static web pages somewhere around 1995. I was the president of my high school’s computer club and we built the first every website for Jacksonville High School, complete with a presentation to the school board. I’m pretty sure the site had blinking text.
We also started learning C++ in the club. We didn’t have a text book, but our sponsor, Robin Manker, would print out sheets each week for us and we’d bind them into one of those plastic spiral bound things that you needed the machine to open up the binding.
What was your first language?
BASIC
What was the first real program you wrote?
Like others, I’m not sure what makes a program ‘real.’ I remember that my first C++ exercise was a Fahrenheit to Celsius converted.
What languages have you used since you started programming?
BASIC, ADI Sharc assembly and other uber-fun machine languages, C, C++, Java, Ruby
What was your first professional programming gig?
My first job was writting DSP (Digital Signal Processing) algorithms in assembly. The first thing I worked on was the compressor algorithm, I implemented time sharing on the averaging algorithms and reduced the cycle count by 30% or so. The processor was an Analog Devces Sharc. It had two data buses and two ALUs, so you could basically make two read/writes from memory and two arithmetic calculations per clock cycle. We’d write lines of code that looks like this:
r1 = r2+r5; r3=r6-r7; dm(i6) = r2; r5= pm(i3);
Everyline of code would be followed by a line of comments explaining the line. It was painstaking work, but It’s how I learned to be methodical and linear. It was also a whole lot of fun to listen to your code after you finished it.
If there is one thing you learned along the way that you would tell new developers, what would it be?
I still remember one of the first things Robin, the first person to teach me how to code used to say. I still pull it out often. It went something like this.
1) There is a teapot sitting on the counter. How does the programmer solve the problem of making tea? He picks up the teapot and sets it on the stove.
2) There is a teapot sitting on the floor. How does the programmer solve the problem of making tea? He picks up the the teapot and sets it on the counter. The he says “I’ve solved this problem before”
What’s the most fun you’ve ever had programming?
Kevin Moore was one of my first mentors when I started working at Shure fresh out of college. These was a time, when we would stay late every Tuesday night and code together. He was the first one to tell me about XP things like “What’s the simplest thing that could possibly work” and pair programming. Late on Tuesdays we didn’t have any managers telling us to stop wasting time with two people at one computer. We paired together writing the microcontroller code for the DFR22. We had a lot of fun and pulled of a pretty amazing project in something like 8 months.
Up Next
Note sure if they have blogs or not: Kevin Moore, Robin Manker
No Tag Backs
by: eric | July 3rd, 2008 | -2 comments »
Well Micah tagged me, and if I look at these XML request/responses for another hour without a break I’m going to pass out into my keyboard. Here goes.
How old were you when you started programming.
I had a Texas Instruments computer thingy that I got for my 6th or 7th birthday, somewhere in there. It played these educational games, but I noticed one day that if I didn’t put a cartridge in it a blue screen came up with a cursor. It had an instruction book and I would basically type in the programs verbatim, then do little things with it like change a color or a line. Later I had an Atari XE and it did the same thing, so I made the same little guessing game in it just like the one I made on the TI. Realistically I didn’t write anything of use until high school though.
Interestingly, perhaps only to me, my version of Hello World for the iPhone SDK was a guessing game.
How did you get started programming.
I guess that was the real answer. I played with my dad’s computers all the time but didn’t consider it as a career until I was about 16 or 17, when I realized I could probably get paid for it. Up until then I wanted to be a sports journalist. So I went to school so I could found my own game company.
What was the first real program you wrote?
What counts as “real”? The guessing game? Making horizontal lines appear on the screen? I wrote a bunch in Basic and Pascal for homework assignments, and like Micah had one of those TI calculators. The first specific one I can recall was a text-based adventure game I made for a homework assignment my freshman year. It was based on the Haymarket Bombing
What languages have you used since you started programming?
Pascal, C, C++, C#, COBOL, Assembly, Perl (but I won’t admit it), Java, Objective-C, Ruby, Javascript, Lisp, VB, Erlang, and I just wrote Hello World in Smalltalk (Squeak).
I too doubt I could write Hello World in most of those languages, and wouldn’t put them all on my resume. It’s funny because I probably would have when I came out of school, since I didn’t know the difference between “familiar with” and “able to write some code with”.
What was your first professional programming gig?
I started a web design company in college, which employed me and myself. I had two clients, one of whom paid me in Kung Fu lessons.
If there is one thing you learned along the way that you would tell new developers, what would it be?
Find great people to work with. If you’re the smartest person in the room, you need a new room, because if you’re not growing you’re dying. This is tricky when you’re new, since you don’t know a great developer from a tree stump, but take a look at Micah’s tag list. It looks like the list of authors in my library.
I would also tell them they should come to work for me as my apprentice, unless they weren’t any good. Then they can work for Jim.
What’s the most fun you’ve ever had programming?
Working with the team I work with now is fantastic. I also had a great time working Agile 2007 as part of RailsFest, and I’m looking forward to doing the same thing on the Live Aid stage this year.
Up Next
Sadly I don’t know many developer’s who keep blogs, so I’ll just echo Micah’s list and tell Paul, Jim, Doug and Matt they’re next.
Tag! I'm it!
by: micah | July 2nd, 2008 | 2 comments »
David Chelimsky tagged me with this “chain-blog”. I’ve enjoyed reading other peoples’ stories. Here’s mine.
How old were you when you started programming.
Hard to say. I suppose I was legitimately writing code at 9 years old
How did you get started programming.
You might say I was born into programming. At a very young age, maybe 4 years old, my dad (Unclebob) would put me on his shoulders and take on a robot’s personality. He would remain motionless until I ordered a command. For example, if I said “walk” he would start walking. If I said “turn” he would turn. And in a very computer-like-fashion, he would follow my orders to the “T”. After a “walk” command, my dad would not stop walking until I issued a “stop” command. Poor programming on my behalf often led my dad, with me on his shoulders, straight into a wall. I used to laugh with delight as he’d bounce off and walk into the wall again and again until I corrected my programming error.
What was your first language?
At 9 years old my dad taught me Logo. I was drawing circles, squares, spirals, and in general making that turtle dizzy.
What was the first real program you wrote?
In high school I programmed casino games on my TI-81 during physics class. You could play Black Jack, Roulette, Bet on the Horses, play the One Armed Bandit. My friend Jim Maggio even did some pixel art for the slot machine. It was pretty sweet. All the physics students were required to have TI-81’s so my games ended up getting copied over and over. My first open source experience I suppose.
What languages have you used since you started programming?
In chronological order…
Logo, Basic, Fortran, Pascal, Forth, C, C++, Scheme, Java, Python, Ruby, JavaScript, C#, Objective-C, Smalltalk, Assembly.
Whoa! I’m impressing myself with that list. But who am I kidding? I doubt I could remember how to write HelloWorld in half those languages now.
What was your first professional programming gig?
An internship at Object Mentor. I wrote some Java Servlets to automate parts of their website.
If there is one thing you learned along the way that you would tell new developers, what would it be?
Software is not a spectator sport. ie. Just watching people code won’t make you a good coder. Code as much as possible if you want to master your craft. Code at work. Code at home. Code on vacation (WARNING Your spouse may throw your computer off the balcony). Code for fun. Code to kill time. Code while you’re sleeping (I mean in your dreams).
What’s the most fun you’ve ever had programming?
The project the David Chelimsky referred to was mighty fun. But I’d have to say the most fun I’ve had with my colleagues at 8th Light, Paul Pagel, Jim Suchy, Eric Smith, and Doug Bradbury. I have never worked with a stronger team. When it comes to software, I imagine we could prevail over any challenge. Outside of software, our strengths are less impressive….
- We started a basketball league and had a perfect record: 0-10. That’s right, we lost 10 out of 10 games.
- We went on a ski trip together an managed to loose some family members in the mountains, during a snowstorm, at night. They lived.
- Doing push ups every hour of every working day surely made us stronger and earned us an infamous reputation in the office.
Up Next
Paul Pagel, Jim Suchy, Eric Smith, Doug Bradbury, Matt Segvich, Unclebob, Bob Koss, Michael Feathers, Dean Wampler, Tim Ottinger, Chad Fowler, Jake Scruggs, Mike Clark, James Grenning
Tag! You’re it!
Announcing Limelight
by: micah | June 2nd, 2008 | 1 comments »
I’m pleased to announce the open source Limelight project: A thin client and application framework written in Ruby (JRuby).
LimeLight at RailsConf 2008
by: micah | February 4th, 2008 | 0 comments »
Back at RubyConf 2007 I prepared a 1 minute presentation, well… more of a teaser, about an application framework called LimeLight.
What is it? LimeLight is a selfish dream of mine. In a nutshell it’s a light weight ruby framework for building rich client applications. To explain further, know this. I hate building web applications. Not because they’re hard to build or anything silly like that. It’s because they’re so perverted. Writing web apps makes me feel dirty; as though I’ve sunk into a pit of waste and decay where the foundation of my work is a pool of sludge. No matter how hard I may try, the very nature of modern web apps taints my code and leaves me a sour, grumpy developer.
To understand what I mean, consider the trivial little widget on the right here. Try clicking the button and watch the light blink. Simple huh? Can you count the number of languages/technologies used in implementing this widget? And don’t forget the code required on the server side…..
I count 5. That is, in most cases this widget would require about 5 or more different languages. Let’s count. HTML of course. CSS to make it look right. JavaScript. That’s 3, but in most cases you’ve got server-side code which, if you’re lucky, involves Ruby and ERB. Think about it. You need to know 5 difference languages to build that silly widget. Yikes!
I’ll include the code below. Know that I’ve made every effort to make this code as clean and simple as possible. Still, I would need to borrow your hands and feet to count all the things I find distasteful about it. Have a close look. Ask yourself, “Couldn’t there be an easier way to do this?” I say there is.
If you’d like to learn more, I’ll be presenting on the topic at RailsConf 2008. Or you can come back this this blog site later. I’ll be sure to post any exciting progress.
Stop
A Snob
by: eric | September 11th, 2007 | 0 comments »
A little more than six years ago I started my first, and hopefully last, job at a massive cubicle farm. On my first day I was introduced to everybody by my project manager, so nervous and uncomfortable that I barely spoke*. She introduced me first to the admin, who could stop traffic. She said hello with a big smile then chirped, “we’re twins!” Scrambling to get my jaw off the floor and seem cool and confident, I instead managed a pathetic grunt in response. Sensing my confusion she pointed to my shirt and added, “See we’re both wearing green.” This suave ladies man responded with, “oh,” then was ushered away to meet somebody much uglier and less interesting. The admin thought to herself, “what a snob,” and returned to her duties. As Jim has often told me, I make an impression.
Last Sunday I became the happiest snob in the world when I married the still jaw-droppingly gorgeous former-admin. Fortunately for me I also make a second impression. See 8th Light and this blog in two weeks!
*Yes it’s true. I am capable of silence. I just find it overrated.
No really, we do that?
by: eric | June 5th, 2007 | 3 comments »
I’m a bit overdue on blogging, so in lieu of the normally brilliant and insightful commentary on the state of…er something… I usually put here I thought I’d share something that we at 8th Light have started doing.
Push-ups.
Every hour. Yes I realize it’s nuts, but look at a typical day for me. Wake up too late. Rush to get ready. Get distracted by something on the computer (today it was RubyCocoa). Realize that I won’t make it to the gym in time to lift weights. Work too late. Come home, eat, maybe help my future step-children with their homework. Suddenly it’s 10, and I haven’t worked out.
Aha - but I did 150 push-ups today. I think - I don’t actually count. Here’s how the 8th Light Fitness Plan (published Spring 2008) works. Every hour, on the hour, do push-ups. We started at 10 every hour and that was pretty hard once upon a time, now we’re up to 25. Well most of us. Today I saw two of the guys in another part of the building doing them, and I figure that if it caught on amongst 8th Light it can catch on elsewhere. After all we’re not that weird. Are we?
Day Three at Rails
by: eric | May 19th, 2007 | 0 comments »
Well it’s day three and I’m exhausted. As you may have noticed I posted at 3 AM last night, and getting up at 8 AM wasn’t foremost on my list of “things to do today.” I did it anyway and I’m enjoying a talk on Rails helpers at the moment. While my posting last night was late I actually wrote it much earlier in the day so naturally some things happened after I wrote the post, and not all of them involved beverages that should not be consumed by those that are under 21.
Last night’s keynotes said a lot about the Rails community, and almost nothing about Rails ironically enough. The first was Avi Bryant who challenged us to make Ruby as good as Smalltalk. Avi is clearly a bright guy and an energetic speaker, and his opinions are essentially the opposite of the ‘Rails’. While I certainly wouldn’t say I agree with everything he said, the challenge to make Ruby and thereby Rails as fast as Smalltalk is one that we as a community should certainly consider.
The other was Ze Frank. He probably needs no introduction to much of the web, but he didn’t say the words “Ruby” or “Rails” once. He did nearly make us wet ourselves with laughter. I’m going to have to spend some time at www.zefrank.com.
I mentioned that they said a lot about us, as a community, and to illustrate this I want you to think of an ASP conference, put on by Microsoft. Do you think they’d invite somebody from the Rails community to come in and tell them their framework bites? No, of course not. Large corporate-backed frameworks do not accept challenges. They spend their time trying to sell you things to debug their already perfect technology. We, as a group, invite people to challenge us because it requires us to think about and defend our own position. If we’re wrong, we admit we’re wrong. If we’re right than that position must be defensible. We all came from different backgrounds, and came to Rails because we continually challenged our assumptions. Let’s continue to do so.
What Ze Frank as a keynote said about us is simple, we’re fun. I’m sure you’ve been to a big corporate event where a few suits tell some in-jokes or make a skit that’s supposed to be funny, but it’s not because nobody can actually say anything that might upset the big honchos. This is a group that has no problem with keynote speakers dropping an F-bomb, and I haven’t seen a single tie. Man it’s refreshing.
Had a lot of fun meeting a bunch of you last night. Looking forward to that today too.
#

