My Stuff
My Amps

Add this feed to a running copy of BottomFeeder

Linux World 2006 Speaker

Thursday, April 13, 2006

Nintendo and Casual Gamers

James Robertson talks about the market that Nintendo is after and it's the causal gamer. I must admit they get all of my gaming money (which isn't much). I'm probably what they consider a casual gamer. I don't play that much and when I do it's just to have some mad fun to clear the mind. Nintendo has the best "fun" games. Bar none, my favorite games ever are the Mario and Donkey Kong off-shoots (Donkey Kong Country, Mario Kart, Mario Bros, Wario, Yoshi, etc). Plus, I like carrying my games with me. The PSP peeked my interest when it came out, but I really don't enjoy racing real cars, shooting people, or robbing people. I want escape. Nintendo gives me that and fun in spades. Besides, the DS touch screen and on-line play is awesome. I dare anyone not to get addicted to Mario Kart.


Wednesday, April 12, 2006


From Blabbermouth comes this funny bit of news about MiniKiss vs. TinyKiss. It does't get much stranger:
Robert W. Welkos of the Los Angeles Times is reporting that Joey Fatale, the 4-foot, 4-inch New Yorker who heads the all-dwarf KISS tribute band MINIKISS, is denying published reports that he tried to sneak past security last month at the Hard Rock Hotel and Casino in Las Vegas to confront a rival band leader, 4-foot "Little" Tim Loomis of TINY KISS, for allegedly ripping off his idea for such a group.

Loomis, a former drummer for MINIKISS, was performing with TINY KISS, which includes three little people and a 350-pound woman, on St. Patrick's Day at Beacher's Madhouse, a Las Vegas variety show, when the incident occurred.

Show host Jeff Beacher told The Times on Monday that Fatale "tried to sneak in saying he was TINY KISS" and had to be escorted from the premises. According to the New York Post, Fatale's lawyers sent a legal cease-and-desist letter to the show trying to shut down the act.

Loomis told the Post: "[Fatale] came out here [to Las Vegas] and tried to cause trouble, so I had him 86'd from the Hard Rock. The impression I got was that he was looking for a fight. He'd been threatening me over the phone."

But Fatale disputed the accusation, telling The Times: "This whole thing about me going to the Hard Rock with my gang — that didn't happen. What happened was, I went there because somebody told me [TINY KISS was] doing the show that night…. Nobody escorted me out of there. I went there by myself to approach them as a gentleman."

Fatale says he has "nothing to say" about Loomis, except, "He's a nice guy." And, he added, "This is all a big publicity act for the guy at Beacher's."


Sunday, April 02, 2006

Revisiting Old Code And Private

I've been looking through old code as of late and well, it''s...EMBARASSING! There I said it. Does anyone else do this? I was looking at my Thesaurus project (my Squeak version and soon-to-be Java version) and was appalled at a lot of the code. So, I spent sometime refactoring and getting the code back into shape. My Thesaurus project in Squeak was a quick excursion into writing Morphs and that code was fine. What made me crinch was my parsing code! For one thing, I put all of the code for parsing into one class. It was doing all sorts of stuff with the HTML elements that it had no business doing. The first order of business was to move all of the low-level HTML traversal code into a new class. This made the parser much more readable and took away the noise inside of it. The next order of business was the actual traversal code. I made some huge blunders in my implementation of the depth-first/breadth-first algorithm. I knew the first problem was when I couldn't even understand what I was doing!

Here's the original code:
elementsIn: anElement do: aOneArgBlock depthFirst: aBoolean
| left children |
left := OrderedCollection with: anElement.
[left isEmpty]
[| next |
next := aBoolean ifTrue: [left removeLast] ifFalse: [left removeFirst].
(aOneArgBlock value: next) == false
ifFalse: [children := OrderedCollection new.
next elementsDo: [:each | aBoolean ifTrue: [children addFirst: each] ifFalse: [children addLast: each]].
left addAll: children]]

YUCK! What was I thinking with two checks for depthFirst or not? Here's the new code (which is a new class by the way!):
pvtDo: doBlock depthFirst: isDepthFirst 
| searchQueue dyadic |
dyadic := self pvtCurryForContinue: doBlock.
searchQueue := OrderedCollection withAll: self pvtChildren.
[searchQueue isEmpty] whileFalse:
[| next continue |
next := self class on: searchQueue removeFirst.
continue := [next addChildrenTo: searchQueue depthFirst: isDepthFirst].
dyadic value: next value: continue]

Now, you might notice some weirdness like the #pvtCurryForContinue:. All it does is to call the continue block by default if the block only accepts one argument. Otherwise, it let's the block continue through. Here's it's implementation:
pvtCurryForContinue: doBlock 
^doBlock numArgs == 1
[[:each :continue |
doBlock value: each.
continue value]]
ifFalse: [doBlock]

This is my functional programming training shining through. This code is much cleaner and easier to read than the one before.

This was just one simple example. I used the Thesaurus project to refactor to see how enforcing private members in Smalltalk would feel. So far, I found a lot of breaches of encapsulation that I had not noticed in the heat of development. Even with categorizing methods as private and with comments, I still broke the boundaries. The pvt at the beginning makes it obvious and Squeak's compiler tells me immediately when I have done something wrong.

After the refactoring, I felt my design was much cleaner overall. So far, I'm enjoying using pvt at the beginning of my private methods. It makes me get into the habit of "telling" my objects instead of "asking" which I generally do well. But, it helps when I'm weak in the rush to get something done or simply not as focused as I should be. The public protocol is obvious and minimal. Plus, if I have too many pvt methods, I start looking through my methods to break the object down further.

  • For even less conditionals and such, check out the packages Distinctions and ReferenceFinder in Cincom's public repository...

    By Andres, at 11:54 PM   

Metalheads Against Racism

This page is powered by Blogger. Isn't yours?