My apprenticeship at Object Mentor in the summer of 2004
15 May 2004
Prologue for the prologue: In 2009 I revisited my original Object Mentor Apprenticeship posts from 2004. Since then I’ve merged the commentary and the originals. All of the posts about “My Apprenticeship” contain my original 2004 content and have indented 2009 commentary. Additionally, I apologize for a dumb “Larry the Cable Guy” joke arriving from the past shortly.
It’s the 5 year anniversary of my 3 month apprenticeship at Object Mentor so I thought I’d revisit my original blog posts about my time there. Why? Well mostly because I used to collect LaserDiscs and really enjoyed listening to a director’s commentary on something they had done many years ago. These days commentary tends to be done either right after the movie is made or because there’s a financial obligation and it kinda cheapens the whole thing – I’m hoping I can at least do better than “Larry the Cable Guy.”
Anyway, this first post was written in May of 2004 before I actually started working at O.M. And since it was the first post I think I did a pretty good job setting up my background. I should point out that I was a high school physics teacher at the time and so I was giving up my summer in a desperate gamble to get a new job. Most people, when I told them I intended to become a programmer without going to college, thought I was nuts but were nice enough to nod and smile. I was pretty sure it was a long-shot myself but I had just started teaching “remedial physics” which is physics for kids who don’t know algebra and have problems with calculators so I was ready to try just about anything.
And I did. Anyway, without further ado, here is my first blog post ever:
I’m going to be spending the summer at Object Mentor learning various programming languages, agile software development, and all sorts of other stuff. In return for dealing with me, they get free labor. All the monkey-work that would be a waste of a good programmer’s time will be handled by me. No, I’m not exactly sure what that will be. Should be a pretty exciting summer.
First I should talk about my background and where I am now as a programmer. Probably the first computer I ever used was a TRS 80 in grade school. I was part of some sort of gifted pull-out program and I wrote the usual things a 4th grader would (10 print “Jake is cool.” 20 goto 10). During the 80’s, when I was in junior high, I got my parents to buy me a TI 99 4/a and I learned Basic. I spent a fair amount of time writing programs. Extended Basic could do sprites, but was so slow that I could never get any decent video games to work because the computer never caught any collisions. All my lasers passed harmlessly though their targets.
Getting a compiler so I could write something faster cost just about as much money as the whole computer, so I was stuck with Basic. Pretty soon I got bored with it and moved on. In high school I got interested in physics and later, in college, I decided to become a physics teacher.
Now here it is 20 some years later and I’m back learning to code. Where’d all the line numbers go? And what’s an Object?
About November of 2003 I started working through Eckel’s “Thinking in Java.” Good, but tough for someone who doesn’t know C. In January I started taking an Intro to programming in Java class at a local community college. This was pretty helpful, but also pretty easy. It gave me good footing in what modern programming is all about.
Since I wasn’t going to start at O.M. for about a month and I was anxious to learn something, Micah (Micah Martin – the guy who will be looking after me during my apprenticeship) gave me a project to work on: Design an unbeatable Tic Tac Toe program.
My first pass at this went like this: A TTT board is basically a 3X3 matrix (array), so how about empty spaces being 0, X’s are 20, and O’s are 1? This way I can multiply all the numbers in a row (or column, or diagonal) to see if there’s a win (any zero’s will make the product zero, and 3 X’s or 3 O’s will produce a distinctive number). So checking for a win is easy. So is checking for offense or defense. Add up the row (or column, or diagonal) and a potential win will be either 1+1+0 = 2 or 20+20+0=40. So the computer can block wins, or win itself if it sees the chance. But, there are some ways to set up two winning moves at once, so I needed a series of conditional statements to handle the first few moves (kind of like in a chess program when the computer is “on book” – playing out well researched moves). If there were no preset moves, offense, or defense, then the program made a random legal move.
Well, it worked, but the code wasn’t very elegant. Here it is: (Note: Future Jake moved the code to GitHub. The “first_pass” dir contains the code I am referencing here.) Micah had me clean up the code lots and add the ability for the computer to play itself. He also wanted the human to be able to chose between X or O. Since I wrote the program with the Human always being O, this was a pretty big re-write.
After we got that cleaned up, he had me look up the minimax algorithm and use it to make the computer move. Basically minimax has the computer create a game “tree” with each possible move being a branch. The leaves are the end points: win, lose, or draw. Winning is scored +1, losing is scored -1, and a tie is (kissing your sister) 0. The computer picks the maximal score if it is the computer’s turn, but it picks the minimal score if it is the opposing player’s turn (based on the assumption that the opponent will play perfectly, and that he/she/it wants to win). Now if the board is empty, the computer has to look at around 40,000 moves. So the first move takes awhile. But the cool thing is that now the computer not only doesn’t lose, but it can set traps for the other player. Neat.
This algorithm uses recursion to construct the game tree, and that was pretty new to me (I had used some trivial recursion before, but nothing this involved) so this re-write took a fair bit of time. Here’s the code: (Note: Future Jake moved the code to GitHub. The “second_pass” dir contains the code I am referencing here.)
Doing all that filled up the month before I started nicely (keep in mind I was still teaching full time, so this was free time work).
Isn’t the part where I talk about multiplying or adding up the TicTacToe rows weird? Where the hell did I come up with that? I seriously have no idea.
12 Jun 2004
I just wanted to point out that I’m not editing my original posts except where explicitly noted so all of this is really what I typed up after a day of coding. In this installment, I talk about my first day at Object Mentor as an apprentice. It’s interesting to note that the “David” I refer to is actually David Chelimsky – lead developer of RSpec. Of course Micah Martin is Bob Martin’s (Uncle Bob) son and the guy who took a chance on me for the summer.
Today was my first day at Object Mentor. It took about 90 minutes to fight through traffic in the morning, so I think I’ll be looking into some sort of mass transit.
Micah is on vacation in Branson, MO (he’s been really nice to me, so I probably shouldn’t make fun of Branson… much) so I walked in not really knowing what I would be doing. I was introduced to Susan and Telisha (secretaries), Lowell (seems like someone who’s been with the company for awhile) and David. David will be working with me until Micah gets back, but David was only hired a week ago and he has been attending one of OM’s classes for that week. So although he’s an experienced software developer, he doesn’t know a lot about the internal working of the company. I guess we’ll be learning together.
We got me logged into the network and David started to explain what my project was going to be. Apparently there is this testing program called Fitness which has a wiki (a community run, although moderated, website which can quickly be updated) which is written in Java (a programming language). But there is also an OM wiki which is written in Python (another programming language). So I’m to translate the Pyhton stuff into Java stuff. I think. Since this isn’t David’s project he wasn’t super clear on the details.
But I have only heard of Test Driven Design (which is what the Fitness program is all about) so we had to back up at this point and give me a little intro. The Bowling score intro. So if your goal is to write a program to score a bowling game based on the pins knocked down during all the rolls, you could just start coding. But that would be silly. According to TDD, you should first write a simple test of the program, which will of course fail because there no code yet. Then you should write the simplest possible code that will enable your program to pass the test. So we started with a test for all gutter balls: The score should be zero. So I wrote some code that would enable the scoring program to pass that test. Then we moved on to a test for always knocking down 1 pin, the score should be 20. Fine, I got the code to pass that test. Then I ran into some trouble.
Before I go into that, I should explain why TDD is good. Or at least the short version ‘cause there’s whole books on this subject. Simply put: TDD forces you to write simple working code. Simple is good because you want your code to be readable after you walk away from it (the maintainability thing). Working is good for obvious reasons. As your code gets more complex, you’ll need to go back and change things which will inevitably cause something unexpected to break. If, after every change, you run the tests you will find out about problems sooner (before they get buried in all sorts of other changes all of which could potentially be the problem) and the test will tell you exactly what’s not working which is a tremendous help in debugging. Cool huh?
But I have no idea how bowling is scored. Which is a bit of a problem. Strikes and spares are weird. And that last frame… So I ran into difficulty. David went back to his class while I struggled with the strike and spare thing. And it was hard not to start worrying that I was in over my head. I found myself thinking “Look, this isn’t that hard so why can’t you do it? Hmm? Maybe you don’t have a future as a programmer. Maybe they’ll realize their mistake in taking me on and get rid of me. Or worse, they’ll be polite and assign me inordinately simple work so as not to tax my feeble brain.” Yes, I know this all seems silly. But it was my first day and, frankly, I have a lot riding on being able to become a developer so it was hard not to feel a little panic. After a while David came back, saw I was struggling and gave me a hint. After that I got it.
Somewhere in there Lance (salesman) came in with his niece. In between making plans for the Agile/XP universe conference he mocked his niece for not being able to manage a turnstile on the ‘L’. She ignored him. I ignored both of them as I was wound up in my impending failure as a developer.
But I worked through that, as previously discussed, and we moved on to the “so you don’t know Python” part of my day. David showed me how to download Python and set me to work figuring out a Python tutorial. This took up the rest of the day. Python is weird. Yes I know everybody loves it, but those “for” statements and their use of “lists” are intelligible but strange. I think I might try re-doing my TicTacToe program in Python as a learning exercise. But that depends on how ambitions I am this weekend. My wife’s play is opening Friday (more on that elsewhere in this site) and then there’s all those videogames I just bought (T.H.U.G., Pandora Tomorrow, and True Crime: the Streets of L.A.). Tough choices.
Wow. I forgot that this was the first time I was seriously introduced to TDD – and from David Chelimsky no less. What’s funny is that TDD was still pretty new to him. Also, I started on a Friday because finals had wrapped up on Thursday (and I had graded them in a rush). I didn’t even take a day of summer vacation – that’s kinda crazy now that I think back on it.
Also, also, I really did freak out of my mind when David gave me that bowling problem (which, btw I now know is a classic example of TDD) because I totally had no idea how to score a bowling game. And I was way too scared to ask. And later I was ashamed that I hadn’t asked earlier. Eventually I had to just suck it up and confess that I had no idea. David was really nice about it.
14 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Today I took the train to Waukegan, and then unfolded my bike and rode the last five miles to OM.
Good news:
An hour to do some work on the train.
10 miles per day should help me lose some weight.
Bad news:
My commute now takes about 2 hours.
There’s a lot of hills.
Now that I’m using Python, I tend to indent everything.
Speaking of Python, I spent some time this weekend translating my Tic Tac Toe program into python. Most of the stuff is pretty easy. But it still took a fair part of today to complete the translation. And when I say complete, I mean it compiles, not that it runs. I’m having trouble printing out the board (my toString method won’t cooperate) and I haven’t quite got the hang of making complicated calls in python.
This morning I met Paul, the other apprentice. He’s been working with OM for about 3? years now. He’s finishing up a Computer Science degree at DePaul. During lunch I asked him what he though about apprenticeship vs. college and he had this to say: ‘Computer Science’ what a joke of a degree.’ Hmm. How so? ‘I learned more from watching Micah program in a day than I learned in my first year.’ Strong words. When I pressed him as to why he feels that academia can’t teach CS, he had two points: One, CS is so new and evolving that how to teach it is continually way behind the curve. Two, it just doesn’t work unless you have someone right there to help you. As a teacher, I can agree with the second statement. One of the reasons home schooling routinely kicks public school’s ass is because you just can’t compete with the Teacher/Student Ratio. I’m a way better teacher than just about every home-schooler, but who cares when I’m divided by 30 or even 20.
For awhile Paul and I did some pair programming (my first pair programming experience, aww), sorta. He’s way farther along than me so I was only able to contribute a few things, but even so I feel reasonably good that I could do something besides sit there. Unfortunately, we ran into a pretty sticky problem just about right away. While looking at the OM wiki code(written in Python) we found that none of the tests would pass. This is a huge problem because the whole TDD thing requires that you keep checking if the code works. Well it doesn’t. Except it does: The Object Mentor wiki is alive and well as we speak. So something’s wrong with the tests. It seems that the tests create some temporary files when they start and then delete them after a given test is run. Problem is that the files it creates are read-only, so it can’t delete them. We spent a few hours trying to figure out how this could be so, but we were flummoxed. Unfortunately nobody was around who had ever worked with the code (David just started, Lowell is on the business side of things, and others were involved in teaching a class). So we spun our wheels for awhile. At first it was kinda cool asking Paul what various code was for, but after a time he and I were getting more and more frustrated looking at code that really should work. And when you can’t test, you can’t do TDD. Eventually Paul started coding ‘blind’ – as he put it. But by then the day was over and I had to get back on my bike. Man my ass hurts.
This was the first of 3 different summers that I rode my bike excessively to work. Every summer I was convinced the extra exercise would help me lose weight and yet it never did. I guess I ate exactly the right amount of extra calories to keep the weight on. Awesome.
Paul, in the above post, is Paul Pagel. He later went on to co-found 8th Light with Micah Martin. We spent a lot of time that summer pairing, but he was so far beyond my abilities at the time that I felt bad about holding him back. I spent a lot of my days with him thinking “Well, I have no idea what he’s doing right know but I just made him stop 10 minutes ago and explain everything so I can’t really do that again… Can I?” It’s tough when wildly dissimilar levels pair – in an ideal environment you should try to avoid complete mis-matches but that’s easier said than done. One of the nice things about Obtiva is that we often have more than one apprentice at a time and there’s always someone who just graduated from an apprenticeship so our apprentices get some exposure to pairing with someone close to their level.
I still have the foldable train-friendly bike, but I probably haven’t ridden it since that summer. Wanna buy it?
15 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Rough day.
There’s only so long I like to stare at a mountain of code which doesn’t work and I don’t understand. Paul was frustrated b/c we still couldn’t figure out why the tests of the OMwiki were failing. We sent Micah an email and his reply was pretty much, ‘Oh yeah, I’ve run into that problem before. I don’t remember the solution but it’s one tiny thing that causes the whole suite to fail.’ Nice. Well, Micah’s on vacation so that’s fine, but it’s maddening to know that one line of code may be preventing you from even getting started. Welcome to programming.
We spent the morning banging our heads against this wall, then, having accomplished just about nothing, we went to lunch. Paul thinks John Kerry is crafty for being spineless. I think he’s just spineless. We both think he stands a good chance of being elected.
Later we stared at OMwiki some more. It’s kinda depressing but I still don’t have a real good grasp of ‘this’(in Java) or ‘self’(in Python). I asked Paul for an explanation but I only sorta understood the answer. Paul sez we’re trying to use a ‘Visitor’ pattern on the OMwiki code, like is used in the Fitness wiki, but I only have a tentative grasp of the ‘Visitor’ pattern. It has something to do with avoiding a big conditional method by creating a lot of smaller methods ‘ each of which will translate some different bit of wikiLanguage into the appropriate Html. The cool thing about wiki pages is that you type in certain commands and the code (which we are working on) automatically sets up links, or makes things bold, or does other cool formatting things. At some point, Paul figured out that the vcs (version control system) check-in function was making the files read-only (if you recall, that was our big problem from the beginning). So he commented it out and the tests all passed. Whoo. We’ll need to put it back in as soon as we know how to do so (and not bring it all down around our ears), but for now we can work on the wikiWidget (the module that translates user text into links and stuff) and actually be able to test it.
During a free moment, I download TextPad and the Python plug-in that lets it color code python script. Good program ‘ way better than Word Pad. Unfortunately, my Tic Tac Toe program will compile but it won’t run. Actually, for a time it wouldn’t do anything. I’d type in:
python TicTacToe.py
(from the command line) and … nothing. No syntax errors, but no game either. I had to take the ‘main’ method out and put it on its own. Now, of course, there’s all sorts of run-time errors. I keep trying to call methods with no parameters like:
print aBoard.toSting()
and Python keeps telling me I passed it 1 argument. Hmm. I’m working on that one. I’m also having trouble with my program seeing global variables such as the TicTacToe board (myBoard). I kinda wish I could spend some more time working on Tic Tac Toe with David before I look at all that OMwiki stuff in Pyhton. I’m not much use if I can’t even execute a simple toString call.
One last thing: Just to complete my day, I missed the train home by zero seconds. Zero, you say? Yep. I just made it but the asshole Metra guy said ‘no bikes’ and let the door shut in my face. For the record: the bike folds up and goes in a bag (which is perfectly Metra-legal). So I sat around for another 62 minutes waiting for the next train.
Get ‘um next time, tiger.
I can still remember missing that train. Some days there was wicked wind coming in from the lake and it would add about 10 minutes to my bike ride – this was the first time I discovered that. I was peddling my ass off to make that departure and checking my watch every 5 minutes. And then to make it just in time only to be shut down by some jerk. Ah, memories. I’m pretty sure I shouted obscenities for a full minute.
As to my problems with Python – It’s funny to see me talking about how I don’t understand Python’s ‘self’ and then wondering what’s this weird extra parameter that’s getting passed along to all my methods. If you’ve never programmed in Python you have to declare ‘self’ as the first parameter of all methods. Which can be a little confusing to those new to the language.
I love, btw, that our big solution to the problem of the tests that wouldn’t pass was to comment them out – not very XP. We did spend a bunch of time trying though, so I guess that counts for something.
16 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
The first part of the day was more crazy python code. I was asking Paul some more questions about the Visitor pattern and at some point, while he was describing some aspect or another, he said ‘It’s kinda like a linked-list.’
This happens a lot. Somebody at OM explains some complicated thing with another complicated thing and I have to take a deep breath and say ‘So, what is a linked-list?’ At which point paper comes out and drawings are made and I realize that I hadn’t really understood arrays until then. I’m so behind the curve in terminology it can be overwhelming. But, I should add, this is a thousand times better than being bored in my Java class. From way too slow to way too fast in one month.
Total immersion is supposed to be a good way to learn a language. I hope so.
We (and when I say we, I mean 95% Paul) did make some good progress on the OMwiki widgets. We’ve got the widgets successfully passing 5 or so tests. But the wikiWord widget is giving us problems for reasons I don’t understand. Something to do with a class/method we can’t call from where we are.
I, however, finally got my Tic Tac Toe to program to run without giving me some crazy sort of error. Whoo! That success was tempered by the realization that the program now plays very poorly. Wha happen? One of the big problems turned out to be Pythons’ way of sending the object as an argument (the infamous ‘self’) We ran into that problem a lot in our OMwiki project. Many methods have to take in self and then, to address one of the object’s variables, you have to write self.myVariable instead just saying myVariable.
On the way to the train today my bike’s gear shifter wire slipped out and the bike defaulted to 3rd gear. Hills became interesting after that. The good people at Rapid Transit (Excellent bike shop) fixed it in 5 minutes for free! Everybody reading this (all 5 of you) should go buy something from them right now (corner of Wolcott and North in Chicago). Later, Bryn and Tina came over to my pad and we indulged in some drunken video game funness (in the interests of full disclosure, we played: ‘The Simpsons: Hit and Run.’ You know that one level, where you have to use the Globex Supervillain car to demolish all the free laser gun stands, and then get back to KrustyLu studios before time runs out? That’s the level we couldn’t beat.)
“The Simpsons: Hit and Run” is/was one of those truly great games I still think about from time to time. I wonder if I still have it… Damn! I must have sold it when I got rid of my original Xbox to that guy I met though Craigslist – he was buying the Xbox and most of my games for his 7 year old son. Only later did it occur to me that I had a number of Grand Theft Auto titles mixed into that bundle. Oh well, that kid’s gotta learn about graphic violence someday.
The ‘Linked-list’ moment still stands out in my brain because just before telling me “It’s kinda like a linked-list,” Paul had this great look on his face like he had finally thought of a super easy way to explain this concept. He was so clearly pleased with his analogy that I felt just awful fessing up that I had no idea what he was talking about. The weird thing was that, as a teacher, I was totally used to this situation – just on the opposite side of the learning curve. But that was my job that summer: To get my mental ass kicked every day, learn from it, and come back for more.
17 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
You know what? I had fun today. Imagine that. Yes, some of the day was spent looking at the OMwiki pyhton code which still confuses the hell out of me, but I learned how to extract methods in Eclipse. I know I’m not the first person to say this but, the ‘extract method’ thingy is way cool. It makes it sooo easy to slice large pieces of crazy code into much smaller, friendly, bits. Almost fully automated creation of methods. Neato.
The other fun thing I did today was getting my Python Tic Tac Toe to not only run, but to play perfect. It takes forever, though. David and Paul say it shouldn’t take that much longer than Java, but it does. If the TTT board is empty, it takes about a minute to make a move.
Yet more fun, I’m doing a TDD (Test Driven Design) re-write of Tic Tac Toe in Java. I’ve hidden the original code away and I’m writing the tests first using the Junit plug-in (this program works with Eclipse to make running tests easy). When your test passes, you get a green bar. Failure is red. It’s amazing how addicted you can get to seeing that green bar.
Humbling moment of the day: I’m eating lunch with Paul and I’m describing my Tic Tac Toe program. Somewhere in the conversation he casually mentions that He, Micah, and Chris (former OM employee) each wrote their own chess programs awhile ago. For fun.
Yipes!
If you don’t play chess, lemme tell you: It’s scary complex. It took Paul six months. Paul’s actually been working for OM for about 4 years now. He spent the first 1.5 years working year round when not at school. But then he settled into just working when he’s off school. Paul’s thinking of getting a Master’s in Math.
No Micah today, but he should be in tomorrow. Paul has made some good progress on the OMwiki widgets so I feel much better about the project than I did Monday or Tuesday.
Writing a chess program for fun – still blows my mind. I believe they had their chess programs play each other. I aspire to someday be that geeky.
There was a time I thought I would never go back to a non-refactoring IDE, but I’ve been using TextMate for a few years now. Although, one of the guys at work uses RubyMine and I have to say that it’s coming along quite nicely. I’ve had my heart broken with Ruby IDEs so many times in the past that I don’t know if I’ll ever love again.
18 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
I arrived this morning to find that the Martins are back in town. Bob seems like a good guy. I didn’t talk to him much, but working next to someone all day can give you a good impression of a person and Bob seemed easygoing and fun. He also was trying to quote some obscure line from a classic Star Trek episode (you know the one where the crew of the Enterprise have been captured by an alien being (again) who wants to learn about humanity (as always) by having them play out some bit of 19th or 20th century history (this time it was the shootout at the OK coral)? Well, I do.) so that gets put in the plus column. Micah took a look at our project. Then he asked us what we thought the project was.
Uh oh.
‘Er, to change the OMwiki python code so that it operates more like the FitNess wiki?’ Well, not really, as it turns out. What he really wanted was for us to translate the OMwiki pages into FitNess wiki pages so they could kill off the old OMwiki and have it be re-born with all the added features of the FitNess wiki. ‘Oh.’ We said.
So we start over.
One very cool thing about today is that Micah offered to let me sit in on the C# course that he’s teaching next week. I was worried that I might slow the class down because I’m an absolute beginner (I know it’s a Java knock-off, and that’s about it), but that’s who the class is for. Excellent.
Paul and I started writing the wiki conversion program – TDD style of course. There will be no coding without a failing test. After a few days of Python’s super easy file writing techniques, we had to stumble around with Java’s roll your own types. Basically, Python is a higher level language than Java so it does a lot more for you. Yes, I grudgingly admit that Python has advantages over Java – There, I’ve said it.
When I first started re-reading these blogs post I thought to myself: “Funny, I don’t remember that we spent a lot of time fixing up the old Python wiki…” Yeah, that’s because we didn’t – We burned a week working on the wrong project. I felt so stupid. However, it’s an important point that when XPer’s start going on and on about having an onsite (or highly available) customer you should probably listen. I’ve seen this situation many times since: Only person who knows what they want is totally unavailable and so the developers work on their own only to realize that they totally misunderstood the requirements. The awesome thing is that Object Mentor makes its living teaching people how to be Agile/XP and they still made the classic off-site customer mistake. This isn’t to bash on them, but merely to say that when the major stakeholders are unavailable (or perceived to be so) then you’re going to waste a lot of development time.
Also, Uncle Bob is a nerd’s nerd. One time someone was using an old-school dial up modem in the office while he was around. Just from listening to the “scree scraa scraa” noises it made, which he casually heard from across the room while working on something else, he diagnosed some problem or other.
21 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Long bike ride in the rain this morning. Only got scary when those 16 wheelers zoomed by throwing a few gallons of water at me and my wiener bike. Micah was teaching the C# class today and lots of it was familiar b/c Java and C# are pretty darn similar, but it was cool to review TDD best practices while working with someone who didn’t know about ‘em. I was paired up with one of the paying customers (‘Tony’) and we managed to figure out M.S. Visual Studio. It’s kinda like FrontPage in that it tries to force you to do things the Microsoft way. The refactoring tools are pretty crappy – no extract method option (which is my new favorite thing)! So Tony and I had to do our own refactoring which was a good exercise. C# does have a cool decimal class which gives you arbitrary precision up to 26 places. This is very cool for money programs, because, as we all know, that guy (Richard Pryor) in that Superman movie used the rounding errors to steal money from banks and we can’t have that. Anyway, I feel like C# isn’t going to be to hard a transition, but it should be said that today was only the beginning.
I was sleepy all day today because we had this late-night cast party at my pad this weekend. Laura’s cast came over and brought their friends. All in all it was about 25 people. I’m glad my landlord (who lives below me) wasn’t home because there was lots of loud music and dancing. Right in the middle of Micah’s lecture he looked over at me and caught me in this huge yawn – for the record it was the sleep deprivation and not the class.
In Tic Tac Toe news: My program is now passing 11 out of 11 tests! And the methods tested include minimax and makeTheComputerMove. Now all I gotta do is figure out how to test the human interface. Hmmm.
Yeah that bike ride was kind of a harrowing adventure each morning. The only road that went directly to Object Mentor was a four laner that got lots of traffic. Could be pretty scary.
22 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
More C# today. I was working with two paying customers: Tony and Jeff. Watching those two bounce off each other was a riot. Jeff kept wanting Tony to type faster and Tony got even with Jeff by adopting an Asian accent (Jeff’s Asian). Jeff wasn’t super impressed with either TDD or refactoring so he kept advocating shortcuts, but Tony kept telling him to slow down ‘Cowboy.’ Why ‘cowboy,’ I don’t know but it was pretty funny.
We wrote a checkbook program today and we got to use polymorphism. A checkbook can take in deposits or checks, but both are really transactions. So we wrote an abstract Transaction class and then had the Check and Deposit classes inherit from it. It passed the tests, but I need to look it over because by the end of the day we had given in to Jeff’s demands and started just doing what he said. Things went kinda fast after that.
In the category of strange but true: I solved not one but two puzzles today. Normally I end up visualizing the person who offers the puzzle as a more gasoline soaked combustible version of themselves. But today things were different.
You should stop reading now if you don’t like puzzles. You have two lengths of rope that will each take 60 seconds to burn. The rate of burning, however, is not constant. So one rope may burn through 90% of it’s length in 5 seconds and take 55 seconds to consume the other 5%. The ropes are not identical. While one may do 90% in 5 seconds, the other may do the first 90% in 40 seconds. The only thing that is sure is that each will take 60 seconds to burn all the way. You have a box of matches, but no access to a timer. Your goal is to use the ropes to measure 15 seconds.
Fun fact: The two guys worked at a place in my old neighborhood where I got arrested and thrown into jail. Lemme give you some advice about getting arrested – always carry 100 dollars on you in cash so you can bail yourself out. Most non-terrible offenses have a thousand dollar bail, but they’ll accept 10%. The ‘jail’ was a bit of a let-down as it was really just a room with a locked door and a pay phone. On the plus side I got to call my Dad from ‘jail.’ Remember that old ‘Was not was’ song ‘Hello dad, I’m in Jail’? Well I do.
23 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
More fun today with ‘Cowboy’ and ‘You Cowboy.’
We got to a point where I was totally lost. Finally. Monday and Tuesday were all about picking up small things and differences from Java. Today we got into some full on Polymorphism and it was cool/confusing. Cowboy and You Cowboy were all over it and, unfortunately, I was driving (had control of the keyboard). Cowboy started talking a mile a minute while You Cowboy had some helpful suggestions about topics unrelated. I had just about no idea what I was typing. I don’t think pair programming works very well with ‘pairs’ of three – sometimes there is too much going on and rational thought is impeded. Later I was able to catch on and here’s what was happening: The CheckBook can take in Deposits and Checks, both of which are children of the Transaction class. Today’s big task (amongst others) was to give the CheckBook class the ability to step through all the transactions and reorder them. That meant the CheckBook had to inherit from the Enumerator class and the Check class needed to inherit from Enumeratable. And there was much Overriding and passing of classes and the casting – don’t forget the casting. In fact, just thinking about it makes me want to look over the code again. I’ve got to get M.S. Visual Studio installed on my laptop. Instead, I’ve been having fun using OM’s super-fast mini-computers. They have these cute little Dells with flat panel screens that can fit four to a box in shipping crates. Pretty handy if you need to haul a bunch of computers to a conference (like, say, the XP/Agile Universe conference August 15-18 in Calgary! Whoo!).
I got another puzzle right today. What’s up with that? If you want, here it is: You are in a room with three switches. In another room, not visible from your room, are three lights. Each light is controlled by one switch. All the switches are off now. If you leave the room to check on the lights, you can’t come back (the door locks behind you, poison gas steams into the room, dogs are released that shoot killer bees out of their mouths when they bark, etc.). You can play with the switches as long as you like but when you go to the other room you want to be able to know which switch controls which light.
Remember: Penn and Teller say that people who love puzzles must die.
Oh ‘Cowboy’ and ‘You Cowboy!’, your antics still amuse after all these years. Not so pleasant memories about casting classes into other classes. That whole statically typed thing seems like such a fad in hindsight. I shouldn’t really trash talk about Java and C# though. I think half the reason I react with aversion to them is that I was a mediocre programmer back when I was in static land. When I was in Ruby I really came into my own as a programmer and so I associate Java and C# with the times in my life when I sucked and Ruby with some actual competency and satisfaction.
Also, I love the part where I was impressed with the flat panel monitors – this was 2004 when only the serious would shell out tall green for a 15 inch monitor with thousands of colors and a 1:50 contrast ratio.
24 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
You Cowboy has taken to saying ‘sankyou’ when Cowboy helps him out. Cowboy replies with an even more Asianized ‘sankyou’ and we move on. You Cowboy is also fond of saying ‘RefRactor’ and ‘Ohh Cowboy’’ (with this sort of world-weary sigh that’s just perfect) There were times when I couldn’t code because I was laughing so hard. A quality experience.
The pattern that established itself is this: Micah introduces some concept in C#, such as event handling, and we stare at him confusedly. Then we do a project involving said concept. I get really confused, while the Cowboys trade barbs. Eventually we figure it out. And Cowboy checks his eTrade account. Repeat cycle.
Incidentally, ‘delegates’ are really cool. They are methods that you can pass around. I have this problem in my Tic Tac Toe game where I keep having to cycle through all the spaces in the board. So my code is littered with things like this:
for( int row = 0; row < 3 ; row++)
{
for(int column = 0; column < 3 ; column++)
{
[[some function or other]]
}
}
The functions in the middle do all sorts of different things. I think that with a delegate I might be able to have just one place where that nested ‘for’ loop happens, but with an assignable method inside. Which would be cool. Except that TTT is written in Java and delegates are in C#. Micah thinks that using ‘runable’ will work, but David thinks it’ll be tricky (David thinks it’d be a snap to do in Python – always with the Python). Anyway, I’m gonna try.
When pairing goes well it’s like hanging out with your friends all day, getting work done, and getting paid to do it.
To be totally honest I never did try to use Python or ‘runable’ to solve the TicTacToe repeated code problem. I did later learn Ruby and blocks which solved the problem quite nicely. As my friend Pat Farley once said: “Ruby is great at removing the duplication where you’re doing the exact same thing repeatedly but all the words are different.” I had to think about that one for a week before I got it.
25 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
We finished the C# class today with an exercise devoted to Threads. In case you have some operation that will take lots of time (like, say, writing to a file) you can send it off on its own while the rest of the program continues on its own way. This is called MultiThreading and it’s pretty cool. We designed a thread that scans a directory (folder) every second to see if any text files have been placed in it. If it finds any, it moves them to another folder. We forgot to kill the thread when we were done with it, so the test kept running after we thought it was done. When we tried to manually place some files in the forbidden directory they automatically moved away. Because the cowboys and I are nerds, we created a whole bunch of text files and tired to jam them in the folder before the program could catch up. Alas, the program was too fast for us.
Micah’s gonna be gone next week so the apprentices will be on their own.
The really weird thing about that week was that, up until that moment in my life, I truly sucked at puzzles. Somebody would start in with “You and three friends are walking through the forest and each of you has a prime number of hotdogs…” and I’d get lost and start to panic. I’d be thinking that everyone knows the answer to this but me and they are finally going to find out that I’m a fraud and the dumbest guy in the room. So I’d spend most of my thinking time worrying about how much time was left before someone figured it out and then what if they announced that they had got it but didn’t tell me the answer and I had to keep thinking about it knowing that someone had beat me to it and it was probably obvious and… Etc., etc., etc.
The weird thing about that week was that I solved every puzzle without getting crazy. It was like after I got the first one I could relax and think about the problem. It’s a constant surprise to me how many things essentially boil down to confidence and comfort. If people feel comfortable in a situation they will perform exponentially better than they will in a tense environment.
28 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
In the morning I installed 40 meg or so of windows ‘critical security updates’ and after lunch I installed MS Visual Studio. Then I went home.
But seriously folks, that was a fair chunk of my day (2.5 hours alone to install MSVS). Paul and I paired on the OMwiki conversion (to FitNesse) project. I can’t say that I’m understanding much. We had this big problem were we couldn’t use the ‘get’ and ‘set’ methods, but I’m still not sure how we solved it. We did manage to get the conversion program to move all the files to the FitNesse wiki and emulate the FitNesse file structure. But we didn’t actually convert the individual pages to FitNesse wiki text yet. I’m so out of it that, when I saw the program run and the files appearing, I thought somehow Paul had finished the conversion right under my nose. I’ve really got to stop him more often. He understands soooo much more than me I just can’t keep up. Micah made a large scale drawing of the program on the whiteboard, but I’m having trouble applying that UML diagram (which I mostly understand, despite my lack of UML training) to the code we are producing. Tomorrow I need to look stupider and feel better about it. This staying quiet and trying guess what’s going on isn’t working so well.
The funny thing is that, as a teacher, I know that students must take an active role in learning. Which is quite hard if they’re way behind. I’ve seen it before – when a student gets lost in a class (maybe they missed a few weeks or just took a mental vacation) they tend to shut down instead of asking a lot of stupid questions. Maybe I should drive the keyboard for a while. That ought to be seriously embarrassing.
This is one of about 10 posts where I say something like: “What the hell happened today – I need to ask more questions.” Part of my role at Obtiva is to say this to our apprentices: “Yes I know you feel like a complete idiot and it seems like you can’t take one more day of not knowing what the hell is going on, but believe me that I’ve been there and it will come. Don’t be afraid to look stupid early instead of confessing at the end of a week/month/year that you have no idea.” Easy to say, but hard to do.
Also the computer I was using was this Dell Inspiron laptop which was about 2 years old at the time and very slow. Installing Microsoft Visual Studio nearly killed it. I think I actually still have it in the other room - I keep meaning to throw it out but it’s hard to let go of tech stuff.
29 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Well, I didn’t drive today, but I did make some progress toward figuring out what was going on. We built a few custom widgets that would translate wiki text that was problematic. For instance: Putting three single quotes around something
’'’something’’’
makes it appear in bold, and two are italics, so 5 should be both italics and bold, right? Not exactly, the FitNesse wiki was only catching the first 3 single quotes. So we used a regular expression (what’s a regular expression? A bunch of symbols, which kinda look like swearing
”’’’’’(.+?)’’’’’”
or
^#[^\r\n]*(?:(?:\r\n)|\n|\r)?
that look for patterns: like a word or words surrounded by five single quotes) to build a custom widget to catch just such a case.
Susan’s computer started making this squeaking noise about a week ago. Now it makes a pretty constant background variable squeak/whine. And the parts aren’t due in until next week (It’s the fan on the processor that’s making the noise, so we’re a little hesitant to douse it with WD40). Paul sez ignoring it is an exercise in concentration, but I read somewhere that periodic high pitched noises are the hardest to ignore (easiest are low pitch, constant noises).
“I didn’t drive today” – read that as I spent all day watching someone type. Which is not a fun day. Chalk that up to the fact that we were doing regular expressions and I had never seen one before. I’m decent at RegEx’s now but I think I avoided them for years because of my first experience. Nothing like resolving to get more involved and then falling out of the frying pan and into the fire to dampen the old spirits. And then a whining computer in the background for extra torment. I’m surprised I didn’t just type a single four letter word to sum up June 29th 2004.
30 Jun 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Things got much better today. Much to my embarrassment, I drove the keyboard for a few hours. I’m slow, I can’t type very well, I don’t know IntelliJ (the slick Integrated Development Environment (IDE) that Object Mentor uses for writing Java code), but I banged out a few tests and made ‘em pass. The problem we were having is that you can attach files to wiki pages in the Old OMwiki. But in the new, FitNesse-centric, wiki we want to put all the files in one area and have links on the pages. This is mostly just a matter of changing the file structure, but it does have the added advantage of being able to link to files from more than one wiki page (well, you could probably do that in the old wiki, but solution would be inelegant). So we wrote a program that checks the folder (of the wiki page) for files and then creates a link to them at the bottom of the page. And it worked.
Mostly.
Some of the files had spaces in them which made our wiki widgets quit while only part of the way through the file name. But, in the plus column, we were able to completely transfer over all the wiki pages and have them look pretty much the same. Right now Paul and I are working on a program to grab all the filenames with spaces in them and cut out the spaces.
The eighties music was off today (which is good because I was getting a little tired of ‘Tainted Love’) , and Paul played some Beatles on his desktop-sized laptop.
“The eighties music was off today” – huh? I don’t remember this at all. Were the Object Mentors crazed 80s fanatics?
I’m still scared about pairing with people I don’t know, oddly enough. I’ve been doing this pairing thing for 5 years now and yet I still get wound up at the prospect of sharing a computer with another programmer – what if they’re better than me and I feel bad? Almost 100% of the time my fear is completely unfounded and I end up having a great time and learning a bunch. The only time I really hated it is when I let the other person type too much – then I just feel like a loser. No matter what the skill difference, each pair should spend about the same amount of time driving.
01 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
There’s just one problem with our conversion program: the Double Dash (cue the dramatic music). In FitNesse, two dashes in a row (–) mean strikethrough. But in the old OMwiki, two dashes had no meaning. A fair amount of people use two dashes to separate their thoughts ‘ as you might expect. So our pages were getting translated with lots of text ‘struck out.’ Okay, so all we had to do was write a program that looks through all the wiki pages and replaces two dashes with one. Which, it turns out, is not as easy as we thought. The proper way to do this is with regular expressions (mentioned in the previous post), but neither Paul nor I understand them too well. So we looked around for the regex (regular expression) book at OM, but somebody had probably taken it home for some light reading. With that option crossed out we started to build a series of nested if statements. After getting about 5 if’s in, Paul turned to me and said ‘If Micah sees this code, we’re telling him that YOU wrote it.’ Fair enough. Well, the problem with nested ifs, as you might know, is that it’s hard to keep all those conditionals straight (if this, but not that, and this, that, and the other, wait! No, not the other. Or, uh, let’s start again.) so we quickly got lost. Then we gave up. It was just too messy to keep track of how long the string of dashes were. We wanted to change two dashes in a row, but no other length was to be affected. So we started looking up regexs on the web. An hour or so later, it was time to go.
Incidentally, I made my train with only a minute to spare. Really, really, big wind today.
Here’s the weird part: I just figured it out while on the train. Using Java’s API (a guide to all the classes and methods in the Java library) and some tutorials I downloaded off the web, I talked the ‘matcher’ into finding dash strings of any length. If the length of that string was two, I replaced it with one dash. If not, I kept the string the same. Nice.
Gotta say, I feel pretty good about being able to contribute something to this project.
So mark down July 1st, 2004 as the day I felt like I really might be able to become a programmer. Since starting at Object Mentor I had contributed almost exactly nothing except for the occasional “You spelled that wrong.” But on that hallowed day I actually figured something out before Paul. Maybe I wouldn’t have to go back to teaching high school remedial physics and hating Sunday nights because of what Monday promised. Heady thoughts.
Interestingly enough Jay Fields wrote a blog post about the “Spellchecking Pair” a few years later. He makes some good points about matching the levels of programmers but:
A. That’s not always possible.
B. I’d feel pretty bad if I was a junior guy on his team when he wrote that post.
C. Inexperienced devs already feel like they are worthless – try not to make them feel worse.
Still it’s important to talk about the problem – you want to bring developers along but sometimes the impedance mis-match can really frustrate both developers. I generally err on the side of “pairing increases the long term health of the project,” but of course their are exceptions. It’s just that the exceptions have a nasty way of becoming the rule.
02 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
We did use my code in the wiki conversion program. And while it was good to finish up that project, this meant we had to start working on the State Map Compiler. A program first written in 1993 in C++, then later re-written in Java in ‘98. No tests, very long methods, and the documentation gives lots of examples in C++ (which I don’t know much about – it seems like Java, but it most definitely is not.) The point of the program is to take in a simple statement of a ‘state machine’ and output source code that implements the state machine in either Java or C++. We are going to be adding a C# output option to this program.
Now, at this point, you might be wondering: ‘What is a state machine?’ Well, let me attempt to regurgitate the turnstile example. A turnstile has two states: Locked and Unlocked. If you try to pass through a turnstile when it’s locked, you’ll get quite a different response than when it is unlocked. A coin will cause a locked turnstile to become unlocked, but won’t do much to an unlocked turnstile. A lot of software engineering problems can be thought of a nothing more than a dressed up turnstile with a few more states. So it’s handy to have a program that takes in some information about a finite state machine and then outputs the basic code that you can build your implementation around.
Also, it’s pretty interesting to be working on a compiler. Software that writes other software (that, ultimately, will be translated into byte code, and then the byte code will be translated by the virtual machine so that the real machine will know what to do – quite a process).
Not a bad explanation of a state machine for guy who just learned about them that day: Good job distant-past-jake. I think ended up using a state machine pattern in my code submission to ThoughtWorks later that year.
I later worked on a huge java project that would generate something like 15 classes for every one written class. I soon got very tired of generated code (“Hey, why did my changes go away? Oh, it’s a generated class… (next line said forlornly) Guess I better go dig through the xml pit for what to change.”)
06 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Fun things you learn when Micah returns: Your tests? – don’t really test what they should. The regex expression you labored over? – can be done a lot better. All the time it takes to run your program? – is because your program is doing 20 more operations per file than it needs to. All that polymorphism stuff you vaguely grasp? – you don’t know at all.
All part of the learning process.
Other than that it was a pretty good day. I got back from Vegas last night and was pretty tired (Cirque de Soile’s ‘O’ and ‘Mystere’ are amazing. Stop reading this blog and go see them now). Before Micah knocked some sense into our heads, Paul and I spent most of the day working on the State Map Compiler. Writing tests for this thing sucks. The output is basically one long string (which is what a program is) so the tests are mostly comparing lots of strings. All the excitement of: missed spaces, absent newline characters (‘\n’), and improper capitalization.
A recurring theme in any apprenticeship program: The mentor checks in with the apprentices and points out all their mistakes. Since I was writing this blog in hopes of getting a job I edited out a lot of these revelations so I didn’t look like quite such a dumb-ass but, in truth, this probably happened every few days (if not daily).
Fun side note: Laura (my wife) and I went to Vegas that time because she had successfully completed a sticker program. After having our millionth conversation about how she needs to clean up her study, car, office, etc she suggested a sticker program (You know the thing where every week, if you complete the task, you get a sticker in a cell on a table?). I thought she was kidding, but it turns out she wasn’t. So we created the “Super Fun Sticker Program for Increased Cleanliness” which lasted 6 weeks if I remember correctly. If she got all the stickers then we went to Vegas and saw some shows. After I tell this story people either tend to think I’m a terrible husband for subjecting her to some sort of behavioral experiment or a very nice husband for encouraging her quirkiness.
07 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Most of today was the State Map Compiler. We got it to work, but almost all the work was being done in a 600+ line class. Armed with a bunch of passing tests, we proceeded to brake just about all of them in the refactoring process. But, and this is important, we only broke one test at a time. The goal was to offload a whole mess of functionality into a bunch of other classes. By the time we got back to a refactored green, we had about 100 lines in the controlling method and much more readable code. Whoo!
Then it was time to do a real conversion of the OMwiki to FitNesse. Previously Paul and I had used a copy of the OMwiki files for practicing purposes. Today we shut down the OMwiki and ran our program on the wiki pages. Due to an unfortunate use of a backslash in a program designed to deal with Unix, our conversion program created a few thousand extra files. Sigh. You see, the Unix system uses forward slashes to denote directories so it sees backslashes as just another character. All those directories we thought were being created became strangely named files. And all the real files got dumped in the main directory. Too many files to delete, oddly enough. The ‘rm’ command stands for remove in Unix-speak. But apparently it has a limit as to how many files it can address. We actually had to write a program in Python just to delete the files. Then, on our second try we saw the resurgence of the strike-through (double dash) problem. Apparently there had been some changes after I left yesterday, but we went back to an earlier solution and that worked. As I had to dash out the door to make my train, everything was working on the new OMwiki site except for an unfortunate spelling of refactor (as ‘refacator’). I’m sure they’ll be able to fix that one without me.
Anyway, I’m putting today in the win column.
I’m not really sure why we couldn’t have just copied the files, ran the program, got it up and working on the new wiki, and then shut down the old wiki. That would have involved too little stress I suppose.
As to the State Map (Machine?) Compiler, I think that may have been the first time I was able to see the power of having a comprehensive test suite so you can refactor at will. More and more I work with developers who’ve had testing forced on them and see it as a necessary, or perhaps unnecessary, burden. I really don’t get that – I find a well tested application very satisfying.
08 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Today Paul and I set up the conference room for next week’s class by making sure IntelliJ, FitNesse, and M.S. Visual Studio were installed and current on the mini computers. It’s gonna be a full house for the TDD (test driven design) class – six computers with 2 people at each.
Then Micah gave us a choice: one of us could try to track down a mysterious file on a computer about to be re-formatted and the other was to figure out Word Press and install it. I chose Word Press – it’s a program that can be installed on a server so that blogging (weB LOGging) is quick and easy. We are setting up a blog so we can start the site www.butunclebob.com where individuals can object to Uncle Bob’s (Bob Martin, founder of Object Mentor is often referred to as ‘Uncle Bob.’ I don’t know why either) frequent declarations (like: ‘Debuggers are bad’ or ‘Comments should not be used’ ) and then Bob can respond. But the servers are Linux based, so I needed to install Linux on an old computer they had lying around. Linux is an operating system( like Windows, or Mac OS) favored by nerds. Long have I wanted to get my hands on this O.S. ‘ it’s in all the great nerd literature like Crytomonicon or, uh’ hmm. Maybe something by Coupland? Anyway, the nerds favor this O.S. because, although it’s not the most user-friendly of file systems, it is very stable and secure. Linux servers don’t crash as often as windows servers but even when they do, it’s not too hard to get them back up and running.
So I installed Red Hat Linux, and then I installed it again because I did it wrong the first time. Yargh. After that I downloaded My SQL and PHP. These are programs that Word Press needs to run on a server. What they actually do, I’m not sure, but I’ll have to look into that later because, by that time, I had to go.
Wow, first day using linux. These days it’s easy to forget that I wasn’t alway in love with the *nix based operating systems, but there was a time when I was a windows developer. I remember getting placed on a Rails project and trying to get it up and running on my windows laptop – I think it took about a week. Eventually I gave up and dual booted Ubuntu. After that I made the switch to OSX.
I love the part where I explain that Linux is more reliable than Windows and what a ‘blog’ is. Who did I think was reading this? As if me explaining every 20th technical term was going to make this blog any easier to read. Actually I didn’t even think of those original posts as a blog – It was just sort of an extension of the little stories I’d been telling for years on my crappy website.
Also, take note of today’s date and keep track of how many days it takes me to install WordPress. At the time their website boasted a “5 minute install.” I might have gone a little over that estimate.
09 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Revision: the State Map Compiler C Sharp version isn’t done. It doesn’t actually work, as Micah showed us. I feel pretty bad about it because we should have tried the things he tried before showing it to him. The SMCC# produces code that’s meant to be part of a larger program. We really should have written the larger program to make sure it works. Bad apprentices. Bad!
On the positive side, I’m becoming a lot more familiar with how this SMC thing functions as we plow through it again (and again, and again). After looking at some UML with Micah we decided to re-design how the C# version of the SMC is written to avoid using inner classes. Which is good because they were confusing me.
David and Paul have suggested that they start writing an ‘Anti-Jake’ blog. Treachery! We shall speak of them no more.
Tonight I’m going to a ChAD meeting (Chicago area Agile Developers). It’s starting at 6:30 at the Loop-area DePaul campus, but my train doesn’t arrive until 6:25. So I’ve got 5 minutes to get off the train, unfold my bike, and peddle my ass on over to Jackson and Wabash.
Last night I bought my airplane tickets to XPAU (eXtreme Programming Agile Universe) which is being held in Calgary this year. I’m pretty excited about going ‘ should be a great chance to learn a bunch and maybe meet somebody who will offer me a job. (stop laughing – it could happen). The crazy part is that I have to be back to start my teaching gig the morning after the conference ends. At 8:30pm Calgary time, I get on a flight to Las Vegas, NV. Somewhere around midnight I get on another plane which takes me to Chicago. Arriving at 4:30am. Yipes! I guess I’ll sleep a few hours at the airport and take a cab to school. The alternative is taking the ‘El back to my home in Chicago, and then getting in my car almost immediately (gotta beat that traffic) to go back to school. That first day is gonna be a little bit crazy. Luckily, it’s only a day of meetings – no teaching required.
Yeah, you should probably run the code before you declare it done. “But all the tests pass” is not an excuse. In fact, it’s an insult to your test suite.
XPAU is now just called ‘Agile.’ I’m speaking at Agile 2009 in August in Chicago, it’s going to be weird going back there after all these years as a presenter.
12 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Today was a day of unintentional diversions. Paul and I came up with an idea of how to test an area of our state map compiler that had been eluding us. We would build up an input file, in the tests, and then send that input file into the SMC which would create an output file that we could read and check to make sure it works. If we had been designing this SMC thing from scratch using TDD, we could have made it easier to test, but since large parts of the program are a legacy, we had to resort to the building/writing/reading file method. But the parser in the SMC program doesn’t like to be called twice, so a fair amount of the day was spent figuring out how to get around that for multiple tests. The other part of the day was spent writing a bunch of tests that had to be thrown out because there’s a quirk of the program that given the same input, you may get different output. Everything will be there, but the order is not guaranteed. This is one of the problems with using a list, things may not come out in the order they were added. So our tests, which assumed a certain order, would randomly fail. Great. Luckily, there was only one test that really needed our new method of building/writing/reading so we could move all the old tests back to the old way (we called the program directly to set variables) and, in the one straggler, we re-wrote the test so that order was unimportant.
Pretty much the same thing was going on in the office. The email wasn’t functioning and everybody who knew about the mail server was either out of town or teaching a class. Then Quickbooks started malfunctioning and things typed in by one person were not available to someone else in the system Nobody was sure if data might be getting lost – this had the effect of chilling productivity in the office.
In short, everybody’s 9am plans never even got started.
“If we had been designing this SMC thing from scratch using TDD, we could have made it easier to test…” How many times over the last five years have I run into this exact same problem? Too many to count – lack of test leads to untestable code which is very often unmaintainable code.
Oh distant-past-jake, why didn’t you just loop over the list you were trying to test and see if the things you wanted were in there? Ah well, a testing technique I would soon learn the hard way
.
13 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
What was supposed to take a half hour yesterday actually did take 30 minutes today (after we got yesterday sorted out). Email problems turned out to be mostly a matter of restarting Outlook a few times. With the SMCCSharp compiler taken care of, I could go back to my other project: getting Word Press, MySQL, and PHP running on the Linux box.
Although Micah and I had downloaded, installed, and successfully used Mozilla (a web browser – like Internet Explorer) I couldn’t find it today. Paul came over and he couldn’t find it. And he’s been using Linux for years! It was somewhere on the hard drive, but after wasting about an hour looking for it I decided to stop throwing good time after bad and just re-install Linux (for a third time) and this time make sure I installed almost everything. While that was chugging away, I used my laptop to look up Word Press, MySQL, and PHP. Word Press claims you can set it up in five minutes. The hidden assumption is that you know how to use MySQL and PHP. Here’s what I knew about MySQL as of this morning: It’s a database. Here’s what I know about PHP: it’s a scripting language. I did, despite my ignorance, manage to get an local Apache server up and running using MySQL and PHP. I even got to look at some sample databases using the local host (what all this means is that I set up the computer to be a server and then I had another part of that same computer start talking to that server using Mozilla – kinda weird but real useful when you want to get all the bugs out prior to opening your server up to the world wide web). After digging around on the internet for awhile I still wasn’t sure how to get a basic database up and running. I’m pretty hopeful about tomorrow because David found a book in the OM library entitled ‘MySQL and PHP for Web Development. Which sounds more than a little helpful.
Somewhere in the middle of the day, Paul said that he thought our SMCCSharp compiler might have some bad dependencies. Hmm.
I remember, during one of my first days at Object Mentor, being flabbergasted that David had a server running on his laptop. Weren’t servers huge things that hosted cnn.com? How could he possibly have one on that little laptop? I’m pretty sure I kinda didn’t believe him when he mentioned it in passing. Now here I was a few weeks later setting up a server my own self. Crazy talk.
4 days since distant-past-jake started the 5 minute WordPress install – how long will it take? Stay tuned.
14 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
The problem with a ‘five minute install’ is that if you go beyond 5 minutes, you are screwed. A five minute install is doing a lot of things behind the scenes. If those hidden processes fail, then you don’t have anything to look at. The configuration file for Word Press is very simple: You tell it the database’s name, the user’s name, the user’s password, and where to look for the server. Once you’ve verified that the database does exist (by messing around in MySQL), the user has access, and the password is correct then only the server is left. Which is quickly crossed out by accessing the database through the server (which is running on the localhost). Now what? There’s really nothing else to change.
After banging my head against this all day (Well not actually all day. When I arrived this morning the power was out and so I had no access to the Linux box. When the power came on, there was no internet until a number of things were restarted. Most of the mess got sorted out by 11am.) I have come to the conclusion, with Paul’s help, that this Appache/PHP/MySQL bundle I’ve been using (which is called Xampp) may not be working correctly. There’s also the issue of MySQL being installed in two places on the machine (I didn’t know it was already there) so Word Press may be trying to access the wrong place. Or there’s the fact that .php files aren’t being recognized as PHP files unless I specifically run them by typing, for example: php install.php All this leads me to believe that I probably am going to have to uninstall Xampp and set up Apache, MySQL, and PHP the old fashioned way.
I better not have to re-re-re-install Linux.
Here’s a bit of weirdness: Last night I woke up at 3:43 in the morning. As I blearily stared at the clock I thought “3:43, that should be public static.”
Paul mentioned that he isn’t allowed to use most of what he knows in his college programming classes. If he writes tests, he has to strip them out. And if he were to use a Visitor pattern and his professors didn’t understand it he would be marked down. So he spends 9 months out of the year having to ignore what he learned in the other 3. That’s not cool. Speaking of the Visitor pattern, it looks like I’m going to get to take a class at Object Mentor in advanced object programming and patterns. David is scheduled to teach this class, but since he’s only taken it once, he wants to teach Paul and I first so that he can get his moves down and spot potential questions. Good for him and me because, although I’ve heard people talking about patterns in the office, I’ve only used the state machine pattern and not much else.
I wonder how test-friendly colleges have gotten in the past 5 years and if you make students write tests will they learn to hate them? I know a lot of students would ask me to teach them something about Quantum Physics because they had read a cool article or seen a ‘Nova.’ However, when they actually had to study about quarks and weak forces they were decidedly less enthusiastic.
So which one of the potential problems I outlined with the 5 minute install do you think is really the cause of its failure? The 2 databases? Xamp? The .php files not being recognized? An unsuccessful install of Linux? And how many more days before the 5 minute install draws to a close?
“public static” – funny.
15 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
So I downloaded and installed Apache – which wasn’t too much trouble. But MySQL was a different story. When typing in the bizarre list of commands to install it, I made a slight typo which took a little while to track down. But, even worse, I ran into the same problem as before – MySQL would run but Word Press couldn’t find it. After a lot of messing about I finally figured out that Linux had installed MySQL automatically and that was causing conflicts. Which I couldn’t figure out how to resolve. Before I installed PHP I decided to look and see if it was on the hard drive. I found the documentation, and when I typed in PHP at the command line something happened. But I couldn’t find where the files where installed. If this were windows I would have some idea how to go about looking for things. Add/Remove programs can tell you what’s installed. The find function in Linux doesn’t seem to work as well as windows. This is all part of the big problem here: I don’t know Linux yet and so all my usual tricks do not apply. Thursday ended with Word Press’ ‘five minute install’ as yet to be completed. It’ll have to wait ‘till Monday because tomorrow I’m heading downtown to get a passport. In theory, you only need a birth certificate and a driver’s license to travel to Canada, but I have these visions of my flight taking off as I try to convince some large man that I really am a U.S. citizen. Best to be sure.
Turns out most Linux installs come with Apache, PHP, and MySQL – this supporting of common developer tools was weird to me coming from Windows where if it’s remotely useful it must have a heinous install and cost a lot of money.
Why was I going to Canada? Because that year’s XPAU (Extreme Programing Agile Universe (Now just called Agile as in ‘Agile 2009’ - have I mentioned that I’m speaking at it?)) was in Calgary that year. Object Mentor used to organize XPAU, so it was a pretty big deal for them. And me. I think this might have been the last year Object Mentor was running the show.
16 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Today I rode my bike into the city in search of a passport. City Hall: Big, confusing, lots of stairways leading to locked doors. First goal: Get a birth certificate. Long line, filled out misleading paperwork wrong, but accomplished. Second goal: Get passport. Not so fast, Mr. man, this office is closed inexplicably for an hour starting… Now. Kill time, eat pizza, come on back. I was waiting at the wrong place! Even thought the sign above the door clearly said ‘U.S. Passports.’ But the real passport place is upstairs in the same room where you apply for city jobs.
Silly of me.
For all those of you who like to complain about yer passport photo, I’d like to point out that you probably didn’t wear a bike helmet in rain and let your hair dry in a pizza parlor before you got your photo taken. Did ya? That taken care of, I paid the nice lady $160 ($85 for city and federal fees, $60 because I want the passport sometime this year, and $15 for the photo) and peddled my soggy self home.
I remember being pretty worked up about asking Object Mentor for a day off so I could get my passport. They were very cool about it. On the other hand I was working for free that summer. And by working I mean floundering. They were probably excited to have a day where they didn’t have to listen to me complain about a ‘5 minute install’ all day long.
19 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Today was the first day of my Advanced Object Oriented Design (AOOD) class. David’s teaching Paul and I in order to make sure he’s familiar with the material and can teach paying customers next week. After covering the usual X.P. verses Waterfall stuff and briefly touching on how good OO design can keep your code loosely coupled (in a tightly coupled design each class depends on several other classes, which in-turn depend on a few other classes and so on. The bad news is that changing one class means that you have to change every other class that depends on it. And since everybody is holding hands with everybody else, that could mean hundreds of changes for each modification. No me gusta. Loosely coupled code has objects that, through interfaces and clever structure, can be changed without having to track down bunches of dependencies) we moved on to some UML (Unified Modeling Language – a way to get a global view of the code you are about to write). Which is cool because although I’ve been looking at and trying to draw UML for a month or so now, I could really use some formal training. We used UML to design a state machine that strips code of its comments. In a few languages (mostly C derived) two slashes mean that the rest of the line is a comment and should not be read by the compiler. Or anything between a slash and a star and then another star and a slash is a comment. For example:
Not a comment // comment all the way ‘till the end ‘o the line
Not a comment /* comment */ not a comment
So we wrote out a bunch of UML and it was pretty interesting. I like all the cases where the object loops back to itself – I don’t know why I find that cool, I just do. After working on that SMC for a week or so I had a pretty good foundation in State Machines but it was fun to try out my ideas on something new. Later we had to make a UML diagram for a cash register. There were a number of user stories which we had to accommodate. Knowing something about teaching, it didn’t come as a great surprise that this exercise was supposed to be a bit of a failure. The were multiple dependencies and inversion violations and single responsibility problems as far as the eye could see. And this was after an hour’s work. But the point of the class is to get us to be able to use design patterns to eliminate (or at least minimize) these problems. It’s basically a patterns class. Patterns are the idea that many programming problems boil down to the same idea and that there are well thought out ways to deal with these common problems.
Oh, and I’ve got a potential solution to the Word Press problem. The install.php file needs to be run by the server. In other words, I need to request the file from Apache which knows to execute .php files. Interesting. This was nowhere in the installation notes, but I guess they probably assumed that anyone trying to set up a server would know how things are done with servers. I didn’t have much time today to try out this idea (which Micah came up with) but maybe tomorrow. Although, with the class this week I won’t have a lot of extra time.
Weird that I just had dinner with David (Chelimsky) and his lovely lady friend Flor and now I’m writing about him teaching me a class. David and I actually live in the same condo complex in Rogers Park. This happened more or less by accident. David currently works for Articulated Man and I for Obtiva -- we’ve never worked together professionally but have remained friends.
Did you see that part about how you’re not supposed to run the install.php file through the command line but by hitting it through a web-browser? I didn’t know at the time that Apache would just figure the rest out and the people who wrote the instruction manual probably didn’t think they had to point out something so basic. A common problem when I was getting into software was that no explanation was basic enough for the likes of me.
20 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Second day of A.O.O.D. and I’m getting pretty good with UML. Today we discussed the various principles of software development: Single responsibility, Open/closed, Liskov, Interface segregation, and Dependency inversion (Which, all together, spells S.O.L.I.D. - you can learn things from XPAU mouse pads).
Paul an I spent an hour or so trying to design an system that could take in information about a bunch of different types of employees. Then, after we designed a system with enough interfaces and uses of inheritance to avoid violation of the principles, more user stories were added and we had to refactor. It was an initially frustrating, but ultimately fun project to take a system and make it do something new without, hopefully, coupling the classes together too much. I think we got it, but we’ll find out tomorrow morning if we did.
Bob said he liked my blog, especially the bit where Micah came back after a week, looked at out project and asked us what we thought we were supposed to do. Apparently this is a pretty common experience in software – after a few weeks the customer looks at what you’ve produced and either realizes that what you did isn’t what s/he asked, or what they asked for isn’t what they really want. One of the big points of XP is trying to make this conflict between intent and execution happen earlier rather than later. There’s always going to be changes to the system, but big ones need to happen early (changing the look and feel of the GUI – not so bad, changing a 2-D side scroller into a 3-D first person shooter? Little bit more difficult).
I still have one of those ‘S.O.L.I.D.’ mouse pads - I don’t really need it for my optical mouse but I have it. Also nice to have an Uncle Bob (Martin) sighting. People often ask me about all the Object Mentor employees I must know, but most of them were off teaching classes at the client site or doing agile/xp coaching during the summer of 2004. I mostly hung around with David, Paul, and Micah that summer and had shorter interactions with the rest. The same thing happened at ThoughtWorks were people would assume I knew this, that, or the other person who worked there while I did. But often person ‘X’ was in Texas while I was in New Jersey and our interaction was limited to possible bumping into each other at a company function.
21 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Our payroll UML diagram (from yesterday) had some needless complexity but, other than that, it was fine. Well, mostly fine.
Lots more patterns today. Many of the patterns boil down to the server-client relationship. Let’s say you have a laser scanner object that can scan a bar code and identify a product. There’s also going to be a sale object which gets a message from the scanner and then does some sort of sale stuff. Well now the scanner has to have code that knows about the sale and the sale might even have code that depends on the scanner. This system is now tightly coupled. But if you stick and interface between them, you can have them both know about the interface and not each other. Therefore swapping out the scanner for another one doesn’t affect the sale code. And changes to the sale don’t affect the scanner object. Patterns can be way oversimplified as the proper placement of interfaces. Too many and you’ve got needless complexity. Too few and the code is tightly coupled and hard to maintain. All these patterns have trade-offs so the big deal is not just knowing how to use them, but being able to figure out if they’re necessary/will help your project.
My project for the afternoon was, of course, banging my head against the Linux box. Apache keeps insisting that I don’t have permission to run the install.php program, but everybody has permission to use it. Hmm. At least Micah had some trouble when he tried to figure it out. I’m always a wee bit worried that the thing that’s been bugging me for days is only 30 seconds worth of work for a pro. So I went back to prowling through the httpd.conf file (a set-up file for the apache file server) for things to change or adjust. The day ended with Micah and me pretty stumped.
The big message I took away from Object Mentor that summer was that although patterns are cool and can help a lot, they add complexity. It’s a complexity/coupling trade-off. A message that has stayed with me. Just today I was looking at some code that could have been refactored to be more DRY, but way less intentional and I had to make a call as to wether the project would be better served by adhering to one principle or another. That’s the thing about writing code that is meant to be understood by humans: The hard part is not learning the language, patterns, or principles, but knowing when to use them and where.
22 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Finished up the patterns class today and I have to say that David did a pretty good job. With new material, not much teaching experience, and Paul and I firing questions at him he was able to get through the class rather easily. Sure there were some confusing slides and weird-ball patterns, but the cool thing about OM giving him this week to flesh out the course is that he can make note of the problems and then talk to Micah or Bob to straighten things out. Next week he does it for real with paying customers and I think he’ll do fine. I, however, need to write more code. This Word Press/Linux/MySQL/Apache/PHP adventure I’ve been on has been very informative but sorely lacking in full-on coding. I need to remember to ask Micah (or Bob, or David, or Paul) for some advice on a side project to make me a better programmer. If any of you are reading this and feel like emailing me an idea, feel free. Life without cool little software projects is less fun.
Tomorrow I’ll be heading up to Michigan to see my folks and hang out at the cottage. There are some pictures of my last trip here.
The cool little side project from Micah will turn out to be not so little.
26 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Word Press is up and running! I had a bunch of ideas when I arrived, but before I got too far I said to my self: ‘Self, maybe you outta try starting Apache, MySQL, and run install.php from Mozilla just one more time’ Well, I wouldn’t be telling ya about it if it hadn’t worked. Of course when I say it worked, I mean that the install actually started but not that everything was fine from the get go. First I gave it the path that the wordpress folder was in, but not where the files were. So everything failed, but did so is a way that I could see that every place it was looking was missing a ‘/wordpress’ so I fixed that. Then I tried to look at it on another computer but I was getting a screwed up version of the site. What wordpress really wants when it asks for the location is something like this: “181.783.13.1/wordpress” Eventually that’ll be something a wee bit more user-friendly, but it’ll do for now. Finally the install went smooth. Excellent.
So why did this take forever? Here’s the Reader’s Digest version: Red Hat Linux automatically installs MySQL, PHP, and Apache so when I attempted to install XAMPP (which is a bundle of the three) things got a little nutty. Same problem when I tried to install MySQL, PHP, and Apache separately. But all this might have been fine if I had known that the way you’re really supposed to run install.php is not from the command line but by typing in install.php in a browser pointed at your sever (which, for me, would be http://localhost/wordpress/wp-admin/install.php). Over a week went by with me trying everything I could think of but it didn’t matter because every time I typed in ‘php install.php’ I got the same error telling me that: maybe MySQL isn’t running, maybe your server isn’t running, maybe you set up the password/username are wrong, or maybe PHP is configured wrong. Not one of those things actually turned out to be the problem, but I did learn lots about Linux, MySQL, PHP, and Apache in the process.
In response to my request for a side-project, Micah has suggested that I join the club and write a chess program. This may keep me busy for awhile.
The weekend in Michigan was fantastic. My former boss gave me ‘a bicycle built for two’ (are you thinking of the HAL 9000? I am) and it’s been rusting in my backyard for 9 months. On Friday, I took ‘er apart and crammed it into my Saturn (no easy feat, mind you. but nothing some WD-40, the wrong tools, and a whole bunch of swearing couldn’t fix). Father and son were able to put the tandem back together in Michigan and it’s a whole busload of fun! The brakes are a little dicey and the tires might be leaking, but everyone’s your friend on a tandem. Cars slow down to look, kids laugh and point, people wave and say nice, friendly things. Riding along the lakeshore with my wife was quite the time. Here’s a picture:
So I started the 5 minute install back on July 8th and now, a mere 17 days later, it is complete. By the way ButUncleBob.com (the blog I was trying to set up) had a good run from 2004 through 2006 but has since been retired/mothballed.
27 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Today I worked on cleaning up Word Press so that it looked nicer and behaved better. Alex King was nice enough to hold a contest for the best Word Press skins and publish the results here:
www.alexking.org/index.php?content=software/wordpress/styles.php
For now, ‘But Uncle Bob,’ is using the ‘Dark Fire’ skin. I also spent a fair amount of the day figuring out the various features of the program so that I can teach Micah when he comes back. Once you get it working (and, if the server has already been set up for you, that is not too hard) WP is a nifty little program. Tomorrow I think I’m going to wipe the Linux box, reinstall the OS, and put WP back up because the first install was so crazy that I’m not completely sure I can repeat it without wasting a whole bunch of Micah’s time (Micah’s off in Philadelphia this week coaching some company called Primavera) .
Somewhere in the middle of all this, it has occurred to me that there is a fair amount of irony involved in blogging about trying to set up blogging software. But the bigger question is: now that I know how to get WP up and running will this blog become a Word Press blog?
Probably not.
Not that I hate the program, but I’m not interested in its advantages. Right now I type my post in MS Word, then do a little cutting and pasting via TextPad, and upload with an FTP or Web-based file manager. Upgrading to Word Press would allow people to post comments, or let me set up a list of users who are allowed to post, but I don’t much care about that. If somebody wants to comment they can email me. Also, I’m not sure about how long this blog will last after August 18th (the last day of XPAU and my last official day with OM). After that I’ll either have found a new job in software development (Interested in hiring me? Send an email and we’ll talk.) or I’ll be back teaching physics to teenagers.
David’s Advanced Object Oriented Design class is going well this week – one of his students speaks Portuguese and so does David! What are the odds? It’s a worldly class, other class members are from Italy and India. There was a little trouble the first day when they turned up their noses at the complementary Crispy Cream donuts. One student even when so far as to pejoratively call Crispy Cream’s ‘So very American.’ Look, you can take shots at our foreign policy, but insulting our donuts is asking for trouble.
Hostilities, thankfully, were avoided.
What? Still talking about WordPress? Boring.
It’s funny that I’m talking about entering the blogging world while a fair amount of my colleges have abandoned serious blogging for Twitter. In my quest to be continually 2 years behind the times I’ll be announcing my Twitter mash-up website soon. Via stone tablet.
But seriously folks, I am indeed on the Twitter where I am known as jakescruggs. I recently spent a bunch of time tweeting about the movie ‘Bolt.’ Seemed like a good idea at the time.
28 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Not a whole lot going on today. I messed around with Word Press. Paul continues to remove the html from FitNesse. Which is more like storing the html inside methods so that the chance of a typo is reduced – if you have to constantly add in a bunch of cryptic strings then you probably will mistype somewhere which can cause hard to find problems. However, if you make a method that adds in a html tag, then either every instance of that tag works or fails. The IDE will tell you if you’ve entered the method correctly, thereby reducing the chance of a typo causing a troublesome error.
Susan and Ellen are pretty swamped under the pressure of getting XPAU up and running. David’s having a good time with his class, but they’re working him like a red headed stepchild.
I got to meet Micah’s wife Angelique and their cute-as-a-button son today. Luka responds to French, because Angelique was born in France. We all had a good time watching him toddle around OM. ‘Don’t put that in your mouth’ seems way cuter in French.
My Earthlink DSL is down at home. I sent the Earthlink crew a long email detailing all the things I tried. They sent me back a standard response that asks if I’ve tried shutting down the computer and modem and then restarting. Of course, I mentioned that I had already done this in the initial email. Sigh.
Earthlink? I forgot that I had DSL for awhile – it was terrible. Now I have RCN and it’s terrible. For awhile I had Comcast and it was terrible. There’s a theme here… Is moderately fast and reliable so hard to figure out? This morning I spent 10 minutes waiting for a 10 meg podcast to download. It still had ‘25 minutes’ to go when I had leave for my train.
I saw Luka a few months ago – He’s still very cute. And he has an iPod touch.
I want an iPod touch. Luka has a portable game machine/music player 10 times better than all the audio/video equipment I owned before the age of 25. Oh to be the child of a nerd with money.
29 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
So I was doing one last re-install of Word Press, just to make sure I understood everything that could go wrong – But apparently there was one more thing. I just couldn’t sign in from my laptop when I pointed it’s browser at the Linux box. I know I had the right login and password because it worked on the other machine. After spending too much time messing around in the Linux terminal, I went back to my laptop, deleted the cookies associated with that website, and everything was fine.
Cookies are a problem.
The chess program is proving to be an interesting problem. Everything wants to know about everything else. Must… Manage… Dependencies…
“Everything wants to know about everything else” I fight this battle every day. And I continue to fight cookies and other browser state tricks. State is the enemy.
30 Jul 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
IntelliJ IDEA 4.5 just came out and there’s a been a flurry of emails about how it lets you analyze your code. The Martins (Micah and Bob) are trading barbs about whose code is more redundant. Paul looked some 10 year old code he was working on and it had hundreds of repetitions. I’ve only just installed 4.5, so I haven’t had time to try the new features. Dare I analyze my old projects?
The pawn is killing me. My chess program takes the pretty obvious tact of having a ChessPiece interface from which all the pieces inherit. Bishops, Knights, Rooks, don’t really need to know about the ChessBoard. You can just give them their move and they’ll tell you if it’s legal. The ChessBoard will do a check to see if any pieces are in the way of a move. But the Pawn – What a jerk! Pawns can move two spaces on their first move but not on their second. That’s not too bad – I’m using a state pattern to take care of that. But they attack on a diagonal if and only if there is an opposing piece for them to take upon that diagonal square. Also they can do this weird en passan thing if another pawn passes them by making a two square move, but only on the next turn. It’s crazy insane. So now I’m faced with the possibility of passing in not only a ChessBoard, but a LastMove to all the ChessPieces even though only pawn really needs it. Well, actually, the King also needs to know about the board for castling, but I’m trying to fight one war at a time. I’ve been thinking about creating a special moves class which would check for pawn diagonal attacking and en passan and other things. But that’s pretty ugly too as the pawn logic is going to be in a number of places. Hmm.
Of course all this is a little silly because the rules of chess haven’t changed in over 200 years are aren’t likely to change any time soon. I could, in theory, couple the code as tightly as I want. But the whole point of this exercise (for me) is to learn something about managing dependencies so I’m going to pretend that the rules may change.
Some sort of program that analyses the quality of your code? Is this the birthplace of metric_fu? Not really, just the beginning of a thought that really didn’t mature until much later.
I love that I’m trying to keep knowledge of the board away from the pieces. I really spent a bunch of time drawing UML diagrams and thinking about dependencies before writing any code. If nothing else, it was good practice thinking about design.
02 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Word Press has been successfully installed on the Object Mentor servers and ‘ButUncleBob.com’ should be available for blogging in a few days. So head on over there sometime soon and pick a fight with Bob Martin about some XP practice or other.
The install, as usual, was a bit of a problem until we realized that since PHP and MySQL were installed separately, we had to run a program to make them talk to each other. Said program was downloaded, installed, and then everything went smoothly. Nice.
Micah has now officially charged me with making a chess program to compete with his creation. Baby steps, Micah. First I gotta get it to let two humans play each other. After some discussion I’ve given up on my ‘special moves class’ because it’s way more of a maintenance nightmare then the problem it’s supposed to solve (letting ChessPieces know about the ChessBoard). I also want to finish my TDD version of Tic Tac Toe. The Land of Linux was fun to visit, but it’s good to be back writing some tests and makin’ ‘em pass.
Yeah, I kinda stayed away from Linux for awhile after that first experience. It’s all summed up here in a nice and cute sorta way but there was a few weeks there of coming in every day and feeling like my operating system was out to get me. I literally knew nothing about using ‘Nix OS so every problem was hampered by the fact that even the simplest of things (like using ps and grep to find out what was running, or the ‘which’ command, or where command paths were stored, etc.) was a herculean task in the face of my limited abilities.
03 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Other than a little bit of time spent with Micah explaining Word Press to Bob, I was able to code all day. Whoo! Some hints from Micah yesterday and a lot of trial and error today led me to finally get the hang of testing methods that rely on user input from the keyboard. When the program is really running, I pass in a regular old keyboard InputStream (System.in) to my userInput method. However, in a test, I can load up a ByteArrayInputStream with all the values I want entered (separated by newlines, of course) and then every time a function I’m testing calls for a user input it gets my preset values instead. Which is pretty darn cool.
Of course this took a large chunk of the day to get it working exactly how I want. Java IO can be a wee bit tricky. The rest of my time was spent applying the finishing touches to my long-neglected TDD Tic Tac Toe game. Should be ready for prime-time tomorrow.
Speaking of tomorrow, I’ll be taking a class with James Grenning: Test Driven Design and Refactoring. Unit testing has been interesting, but I’m itching to see how FitNesse extends things. Since the paying customers want the class in C#, there’s a good chance that I’ll revisiting Microsoft Visual Studio. We gotta get Jet Brains’ add-on installed soon because life is unpleasant without refactoring tools
When I applied to ThoughtWorks I used the trick I learned above in my coding submission to test input from the command line. Later on when I got hired I asked to see what people said about my code and one of the comments was “Some of the things he tested would never fail.” First of all – the anonymous reviewer was right. One can reasonably assume that core Java IO will work and so it doesn’t have to be tested in your application. But second – it was pretty cool to see that I had tested way more than a ThoughtWorker thought was necessary.
04 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Good news! With Jet Brains’ ‘Resharper’ plug-in installed, Visual Studio is way more fun. Not as cool as IntelliJ, but it’s getting there. As you might have guessed, the TDD and Refactoring class is being taught in C#. The first day was weird for me: I realized that a few months ago I would have been way overwhelmed but now I was following along with ease. I wasn’t some sort of huge revelation, it’s just that while James was writing a bunch of UML on the board I not only didn’t have that sinking feeling UML used to inspire but I knew what pattern he was going for before he finished. Cool. The course is shaping up like this: Basic refactoring and Unit tests today, tomorrow should be test-first programming with refactoring (always with refactoring), and I suspect we will get into FitNesse late tomorrow or Friday.
A few minutes ago I finished up my TDD re-write of Tic Tac Toe and I’m including a zipped version of the source code here (tests are included, of course) [Future Jake note: the files can be found on Github at http://github.com/jscruggs/tic-tac-toe/tree/master in the third_pass_tdd directory]. Feel free to open it up, run the tests, and give me some feedback. It’s a text-based game so don’t expect a gui or anything fancy. I use a minimax algorithm to make the computer choose the best move. If you want to know more about my history with the Tic Tac Toe program, you should look at my may 2004 post.
How do I feel about writing TTT test-first verses without-a-net? I gotta say that the tests make everything more sane. With TDD, I could focus on one problem at a time without having to be driven crazy by weird bugs and mountains of suspect code. During my first non-test version of minimax I had this bug where when I asked the computer to move it filled in all 9 of the spaces. I spent days staring at code before I realized that I was passing a reference to the board instead of a value (so the board got changed as the computer tried checked of the possible moves). Of course I didn’t find this bug until I had written enough code to make it run, so I was stuck looking at everything. When I wrote the minimax test-first, I focused on just the minimax method and the test. That’s it ‘ any problems had to be somewhere in those lines of code. Which made it lots easier.
Now you may object that having written TTT once, it was easier to write it a second time. Yes, but when I re-wrote TTT in Python, without tests, I still had tons of problems with bugs (see blog entries 6-14-04 through 6-17-04).
Once again I have posted my early bad code to github so you can see it in all its splendor. And that action gets at one of the reasons I’m re-visiting these posts: To point out that everyone came from somewhere. When I was getting started in teaching and programing I often made the mistake of lionizing those above me (without even thinking about it) instead of realizing that they were just people like me who hard worked hard to get better.
05 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Well, knowing more about mocking objects would have helped a lot when I was writing my TDD Tic Tac Toe. Mocking Objects was, of course, one of the subjects of today’s class. The whole day was devoted to TDD (the first day we were refactoring existing sample code) but I was pretty familiar with most of it except for the mock object pattern. Which seems like a big part and just goes to show that sometimes it’s nice to have someone explain something to you even though you think you already understand it.
I’m working with a possible future intern: Matt. He’s at DePaul and might be helping OM out in the fall (he has to work around his class schedule). Matt’s been taking a bunch of non-computer classes this summer so he’s a little rusty in the programming department. And he keeps wanting to write code without tests. However, I remember my first day at OM when I couldn’t even get a simple bowling score program to work (yes, they try that one out on everyone). It’s hard pairing with somebody who knows a lot more than you. Can be intimidating.
Five years down the line I’m still learning something about testing every day. I’m giving a talk entitled “What’s the Right Level of Testing?” at Agile 2009 and Lone Star Ruby Conf – in it I discuss the difficulties of balancing testing, team moral, velocity, assurance, and code quality. After looking over my slides I have to say that most of the teams I’ve been on have gotten it wrong more often than right. Which is all the more interesting because I’ve been working at the test-friendly ThoughtWorks and Obtiva. Testing is hard (but seems deceptively simple) and it can easily be over or under done.
06 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Last day of the TDD and refactoring class today. We started with an intro to FitNesse, which is acceptance testing. The basic idea is that while unit tests are concerned with the inner workings of the classes and methods, acceptance testing is after more global behavior. An acceptance test tends to simulate the actual operation of the program. What you do is enter some data in a table that the user might enter. Now this table is in a wiki which is being served by FitNesse which may be running locally or on the company server. Then, when you push the button (on the wiki page) that sez ‘Test,’ FitNesse parses the wiki text and feeds the data from the table into your program. And then it checks the output against the table you created (on the wiki) with the expected output.
Which sounds a lot like a unit test – just applied to a larger scale. And it mostly is, but with the added benefit that it’s easier to write a test in a wiki than to learn java, or C#, or whatever. That means that the customer can write the acceptance tests and you can gets busy making them pass. Which is pretty cool.
The tick of Fitness is that you have to write a bunch of interface code between your natural language wiki tests and your code – In that way it’s kind of like cucumber. But anyone wishing to write Fitness/Cucumber tests has to learn to think a bit like a programmer because you can’t write just any sentence and have the magic computer turn it into a test. We programmers often forget how hard our job is until we see non-coders attempt to do what we do every day. Often a team will try to adopt an acceptance testing framework because the tests look so easy to write but that is deceptive – computers can’t really read natural language yet and so writing acceptance tests as a non programmer can be frustrating because the cucumber or selenium or fitnesse or whatever tests look like sentences but a slight deviation from the form produces a cryptic error message. Ultimately I think they are worthwhile but you have to have a serious commitment from the people writing the tests to learn how write the tests.
09 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
XPAU is only a week away and most of the things that need to be shipped have been shipped. So Monday was the calm before the storm. Micah had a hundred or so neglected emails to answer and some odds-and-end work to do. David and Paul were pairing on the dot Net FitNesse project (making FitNesse work with C#). And I have been asked (dared) to write a chess program by Micah.
Before I get into the intricate parts of chess software, I should mention David’s correction of my previous post. On the subject of acceptance testing vs. unit testing, he says that it’s important to point out that the customer owns the ATs and developers own the UTs. A developer can have loads of passing UTs, but it’s the ATs that the customer ultimately cares about.
On the subject of Chess, I’m finding that just getting the computer to moderate a game between two humans is a more interesting problem than I thought. The main culprits are the pawn and the king. Here’s a list of king behavior the computer must enforce: kings can move one square in any direction (including diagonals), they cannot move into check (a square that is threatened by an opposing piece), they can castle ( king side castle: move two square to the right and have the king side rook move two square to the left. Queen side castle: king moves two squares to the left and the queen side rook ends up on its immediate right.) but only if the king hasn’t moved yet, the rook hasn’t moved yet, there are no pieces in the way, the king isn’t castling out of check, or through a space that would be check, or into check. A little bit conditional, eh? I’ve got all that programming done except for the moving the rook part. In my design, pieces can tell the board object if a given move is a legal move and then the board can use that information to decide whether to move the piece. The problem is that if the king castles, I have to have some way of telling the rook to move. I could program that into the board object, but then some of the king’s logic is stored in the board object. This is very bad programming form. Latter on if I, or somebody else, wants to create some sort of chess variant where the king moves differently this person won’t think to look for part of the information about the king in the board object. So if they try to change how castling works, the board will keep trying to move the rook and that could cause all sorts of hard to find bugs. And I would have to go sit in the bad programmer corner. I’m thinking about creating a ‘move’ command that can be issued to the pieces which, in most cases, would do nothing but in the case of the king and the pawn (which can turn into another piece if it reaches the back rank and has this weird way of taking another pawn without landing on its square called ‘en passan’) would do some additional things. What bugs me about this is first that it’s dummy command for most of the pieces and that it doesn’t really do what it says. ‘Move’ won’t make the pieces move (the board takes care of that), it’ll just get them to perform the actions of certain special moves. I need a better name.
Also there’s the problem of checkmate. Check isn’t so bad: I wrote an algorithm that looks at all the opposing pieces to see if they threaten a given square. Now checkmate might just seem like looking at all the possible moves of the king and seeing if they also put him in check, but it’s a little more tricky than that. There’s two other ways to get out of check besides moving out of the way: you can take the piece that is threatening your king, or you may move one of your pieces in front of the king to protect him. Both of which are interesting programming challenges.
Yes the Acceptance Tests should be owned by the customer. However, the developer often writes the Acceptance Tests because while the customer technically owns them he or she doesn’t have the technical ability to make sure the tests do what the customer wants. This can lead to trouble if, for example, the customer wants to make sure a user can be created, logged in, change their profile, and logout. A developer writing that test might be tempted to just go right at the database to create a user (which really doesn’t click through the app the way a customer would) and while the test would appear to be testing sign-up that page could be busted without the test failing. Getting a good Acceptance Test framework up and running, maintaining it, and making sure it tests what you care about is a daunting task and takes way more effort (and hardware) than most clients realize. The out of the box solutions that record clicks are either inflexible (you can’t do loops or have variables or assert what you want), proprietary, slow, or (usually) all three. And custom solutions take time and precious developer resources. In short, automated acceptance testing is hard and needs a fair amount of resources.
10 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Well, I got the king’s weirdo move logic straightened out. And the pawn’s. But now I’m looking at my ChessBoard class and I’m unhappy. ChessBoard does a lot stuff and I’m beginning to suspect that all the chess pieces are going to have to know about it. Why, you ask? Lemme tell ya: In order to figure out if there is a checkmate I have to first figure out if the king is in danger. No problem: did it already. But checkmate means that the king not only is in danger but that there is no way to get it out of danger on the next move. One way to get out of check would be to move the king. So I need a findAllLegalMoves method in the king class. But to find all the legal moves, the king will have to know what pieces are on the board. Another way to get out of check is to take the piece that is threatening the king. I got that working earlier today. But the last way to get out of check is the killer. One of the king’s men can shield the king by getting between it and the threat. So now I need to look at all the king’s men and see if they can move into a blocking space. Of course, this means that all the piece objects need a findAllLegalMoves method and to do that they need to know about the board.
A UML diagram of my chess program would now have lots and lots of arrows heading towards the ChessBoard class. Which is terrible design. A small change in the ChessBoard would now mean that I have to change all of the chess pieces. How to break up this dependency nightmare? More interfaces acting as firewalls between my objects. Micah suggested I need to look at which methods each piece uses from the ChessBoard and create a different interface for each. So the king and pawn might each have their own interface with the ChessBoard, but the rest of the pieces would have a different and thinner interface (less methods). That’s a pretty big bit of refactoring so I better have at it.
Yeah. The chessboard stuff again. I find it kind of sweet that distant-past-Jake would spend all this time trying to arrange the dependencies so as to make the classes loosely coupled. But it’s also kinda ridiculous. Maybe a game like Go would have been a better candidate as its pieces don’t need to know too much but Chess, with it’s complicated rules and numerous corner cases, is very hard to tackle. Chess is like a business that’s been running for a few hundred years – any interesting problem is some sort of crazy exception to the general rules. So it was a good portent of things to come but a rather frustrating last project at Object Mentor.
11 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
I successfully broke the connection between the ChessBoard and the Pawn and the King. Pawn has its own PawnChessBoardIntereface and the king has KingChessBoardInterface. Each of these interfaces are pretty thin, so I’m back in a more comfortable place, design wise. I’ve also figured out a way to keep the rest of the pieces from needing to know about the ChessBoard. Instead of creating a FindAllLegalMoves method for each piece object, I’m going to look at the type of check the king is in. The king can be attacked straight on, diagonally, or it’s a knight attack. If it’s a Knight attack, this particular attack can’t be blocked so I don’t have to worry about trying. With diagonal or straight attacks I can find the squares between the king and the attack and then check to see if any of the king’s men can move to one of those squares with my, already created, isItALegalMove method. But I still have to create a method to find those squares between the threat and threatened.
David left his laptop power adaptor at home, so he mentioned a trip to CDW to get a spare. Paul, Micah, and I immediately perked up and jumped on that bandwagon. Micah’s wife called a little on and I overhead this little snippet of conversation: “Well I’ve already got lunch plans at, uhh, CDW.” We are nerds.
David is working on dot Net (he’s to be Object Mentor’s dot Net expert) Asp now. Asp is a scripting language, like PHP, but it’s Microsoft’s baby. Visual Studio has this Asp GUI (Graphical User Interface) creation tool which is WYSIWYG (What You See Is What You Get). But, as with most WYSIWYG stuff, you only sorta get what you saw in the tool. The idea sounds pretty cool: by dragging and dropping you can create a web-based GUI in a few minutes. And what it mostly does for you is give you a good start – there’s a bunch of manual code editing after the tool finishes. So David is messing around with it and he keeps checking the changes he’s made in Internet Explorer. Then he decides to check the results in Mozilla (an alternate browser): Guess what he sees?
Nothing. Absolutely nothing. And the stuff he’s asking Mozzila to do is totally stuff Mozilla can do (little boxes where you can type in data: A web form), but Microsoft has rigged it so that its product won’t work with competing browsers. Micah tried to open up the page with Safari, but still no go. He thinks there’s a way to get it to work on other browsers, but the point is, that by default and design, Asp has way decreased compatibility on non Microsoft products. Not cool, man.
As I was new to computing this willful disregard for other browsers was shocking to me. Now I just sort of accept it. Many of my readers probably develop web sites and know this, but I would estimate that supporting IE6 and IE7’s non standard behavior eats up 10-20% of any development team’s capacity on average. There may be weeks where you are only burning 5% on IE but then some huge hairy IE6 bug will come rolling in and you’ll lose a week of a developer’s time. Microsoft will tell you that if their browsers strictly interpreted html, most of the internet would be broken. They’re probably right: There are a lot of old webpages out there that have some busted html that only works in IE. But supporting them means making crazy problems for people who want to follow the spec.
12 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
My Birthday today and the guys at OM were kind enough to buy me some pizza. Later on tonight I’m going to have a quiet little get-together at my favorite restaurant: Club Lucky.
Tomorrow is my last day at Object Mentor’s Gurnee location. Saturday I’ll be heading up to Canada and XPAU. Paul (the other OM apprentice) and I will be sharing a room at the Hyatt Regency. But here’s the fun part: The last day of XPAU is Wednesday and my job as high school physics teacher starts back up on Thursday. So I’ll be catching an 8:30pm flight from Calgary on Wednesday that arrives in Chicago (via Las Vegas) at 5am Thursday morning. Then it’s a cab ride to work and meetings that start at 7:30am. Let’s hope some sleep happens on the plane.
I’m pretty excited about XPAU, although I don’t know what I’ll be doing exactly. Basically Paul and I are Micah’s goon squad and any person or technology that gets in his way will be dealt with shortly. However, Lance mentioned that he might also need some help with a project or two he’s working on so I’ll probably be pretty busy. In between duties for OM I’ll be attending as many non-tutorials as possible. And trying to network (shudder).
My good friend Ken Hlebek (we went to high school together, fer cryin’ out loud) will be attending and presenting. Something called ‘Being Extreme with Eclipse.’ Ken is the guy who was kind enough to introduce me to Object Mentor and, since he lives in Oakland, CA., I don’t get to see him that often. Even when he does manage to get back to the Chicago area, he’s inundated by visits from and to family (big, big, big family) so I still don’t see him. Should be fun to catch up.
Weird how this all started: I get frustrated with teaching so I call an old high school friend and he puts me in contact with a guy he’s met once or twice. How this all leads to a new career seems improbably at best. But it does prove a point I’ve been trying to make about private schools forever: You’re not paying for a better education, you’re paying for the friends and connections your kid will make at the pricey school. Most people are shocked to learn that private school teachers make much less than their public school counterparts. Even at high schools that cost 30K per year. Almost all of them leave as soon as they can for a public school. So why doesn’t that experience and talent turn a private school into a terrible place? Well, 2 big reasons: First, people who spend 30K per year on education are generally smart, have raised their kids to value education, and care about what happens in the school they are paying so much for. And second, if you go to school with the children of such parents you will have connections to important people for the rest of your life and they will pressure you to do better in school. As a teacher, I’ve seen the same kid do well in a class of students who cared about school and then do terrible in a class that was indifferent. We all want to believe that we’re beautiful snowflakes of individuality but the truth is that the people around you influence your progress way more than we’d like to believe. I had a friend whom I could call to help me out and that’s how this all started. Now it’s true that I still had to do the work when I got the opportunity but without that opportunity I would have probably had to face years of night classes to get a degree in CS. And faced with that colossal amount of work with no certain outcome there’s a pretty good chance I would have just started showing more movies and phoning it in as a teacher.
13 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Last day in Gurnee. The Object Mentors decided that pizza wasn’t enough for my birthday, so they took me out to one of those fancy Japanese steakhouses. Ya know, I’ve never actually been to one of those knife-flying, death-defying, make-it-all-on-a-grill-while-you-watch restaurants. A good time was had by all.
It’s been a good summer. I’ve learned tons about class design principles, patterns, pair programming, test driven design, and a whole bunch of intangibles. Without a doubt the coolest thing about working at OM was being able to lean over and ask David, or Micah, or Paul, or James, or – Look, everybody sitting next to me had great ideas about programming and, as cool as all their classes are, working with great programmers is a much better way to learn.
Speaking of Object Mentor’s classes, I’ve been meaning offer up my critique – from a teacher’s point of view. What I like, and what most non-teachers usually screw up, is the commitment to lab work. If there’s a lot of material to cover you can seem to cover it quicker with more lecture and less lab, but that’s a big mistake. Just because you throw a slide up on the screen and yap about it does not mean that anybody had any idea what’s going on. In my experience, 40-50% of the class are thinking about something besides what I’m talking about at any given moment. So it’s crucial to have the students work out the presented ideas in the lab. First, because it forces them to talk to each other and fill in the gaps where somebody was distracted by thoughts of girls, or candy, or shiny objects. And second, because if a student knows they’re probably going to put the presented ideas into action they pay just a bit closer attention. The lab, in this case, is writing some code. Because OM is XP, they do all code writing in pairs. Which is very cool. One person can get stuck, but two can tackle ideas that would confound either individually. So the classes don’t bog down when a few people are way behind and others have zoomed ahead. The groups tend to keep everybody moving along at the same pace (well not exactly, but it’s much better). Which is probably a good argument for pair programming in the non-classroom: Nobody gets lost. I tell ya, I miss it when I have to work by myself. There’s nobody there to keep me from doing something stupid so I waste lots of time running down a blind alley when a pair would look over my shoulder and say ‘What the hell are you doing that for?’
Well I gotta pack for XPAU – next post will be from Canada!
There are many times in life where you can go faster short term but you have to pay more on the back end. Sometimes it’s worth it (startups coming to mind), but I worry that once you’ve compromised your ideals once it’s hard to know where to stop.
14 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Travel day today. Flew to Phoenix, AZ (4 hours) and then to Calgary (3 hours) plus 1 hour for lateness and layovers is an 8 hour trip that should have taken 3 (Chi to Cal). And there was a fun little dash from gate A11 to B7 (which are much farther apart than you might guess using your knowledge of the alphabet) because my first flight landed late.
Check in at the Hyatt Regency was easy and gorgeous. The conference space is really nice too. Micah, Paul, David, James, Justin (Micah’s younger brother), Bob, and I spent some of Saturday night setting up the ‘XP for a Day’ Tutorial space. There’s gonna be 3 teams of 4 (2 pairs each) working on ‘Hunt the Wumpus.’ So we needed to link all the computers up, set up FitNesse, and get CVS working. James has been nice enough to let me sit in on the tutorial, so I’m excited to see how much functionality we can add to ‘Hunt the Wumpus.’ Which is an old text-based game from the late 70s early 80s. You walk around a cave trying to shoot the Wumpus with an arrow. But if you go into to room with the Wumpus, he eats you. And there’s pits to kill you and bats to randomly transport you. Some functionality has already been done, so we’re going keep the project going.
Later we ate at the James Joyce bar and Bob talked about almost killing himself with carbon tetra chloride, high voltage transformers, and all sorts of other experiments he did when a child. I told some physics teacher stories. Ron Jeffries talked about the perils of rainwater management. We tried to get David to do some magic tricks (he was a magician in another life) but he politely declined.
Yeah, it was a pretty heady atmosphere at the eXtreme Programing Agile United conference. Bob knows everyone in the community so hanging out with him means you get to make a fool of yourself in front of some heavyweights. Ron Jeffries was tons of fun chat with – that guy has some stories to tell and man can he tell em’.
15 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Every time I think I understand FitNesse I’m wrong. After a day of using it for Acceptance Testing I know a lot more about it, but I’m going to assume there’s more. But this is jumping to the end, I’ll back up.
At the beginning of ‘XP for a Day’ Micah and James (the teachers) split the groups up and we started the planning game. James, the customer, had a bunch of stories written on 3X5 cards that he wanted implemented in the game. For example: One was a magic arrow that you could fire that would turn if it hit a wall (you specify the direction it will turn when you fire it). Another was a GUI for the game. And another was shooting regular arrows that would kill the Wumpus if they passed through the room he was in. Another was a randomly generated map. And so on. After James introduced the cards the time had come to assign numbers to them. This is one of the tricker parts for the first time XPer. The numbers are unit-less and do not correspond to a set amount of time. But the are a measure of how much time the task will take. Huh? Lemme ‘splain: Take all the cards and arrange them from easy to hard. Some are the same level so they will be a pile of easy, a pile of hard and a few piles in between. Now let’s call the features in the easy pile ones. What does one means? It doesn’t. But now we have a reference. All the other cards are defined in terms of the easiest ones. Is this task two times more difficult or three times more difficult than the simple ones? Unfortunately, since most programmers have a background of spending lots of time on design we spent too much time arguing over the points on each card. But it was a good learning experience. Then we guessed how many point we thought we could do in one iteration (1.5 hours in this mini-XP version). My group had no idea, but everybody else said 4 and we went along with the crowd. How many did we finish? 1 point. And here’s where I take a bit of issue with the class. Learning FitNesse is a day in and of itself. None of us were that familiar with it (I had used it in the TDD class I took, but some problems still were beyond me) and so we spent most of our iteration trying to figure out how to get the acceptance tests to work. Leaving precious little time to code.
Which is everybody’s biggest fear about TDD – that the test will slow you down. And I think one iteration will always be sacrificed to figuring out FitNesse or Junit (which we used too, but most were familiar with it) or whatever. The second iteration went much better. Now that we knew how to set up fixtures and get them to work, we were able to hit our target velocity much better. My personal feeling is that this needed to be two days if FitNesse will be new to most of the student (as I suspect it will be). If it has to be one day, then maybe unit test will have to be enough. Regardless, I learned a bunch and felt the class was a qualified success.
The problem with having students work on real things is that often they get hung up on something that shouldn’t be the focus of the class. I had this one week long physics project where the students would plan how to launch a spaceship and have it reach Mars. The first step is drawing a scale model of the solar system out to Mars. Most of the kids spent the better part of the first day just trying to figure out a scale so you can fit all the orbits on the paper. I had foolishly assumed that such a task would take a few minutes because it was easy for me.
17 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary.
Got up late, hustled downstairs to get some breakfast, only too discover that I didn’t care much for either of the Keynotes that morning. Some Microsoft guy was gonna talk about Visual Studio and M.S. agility. Hmm. I had already chatted with the guys at the Microsoft booth about the new Visual Studio and here’s the scoop: The will be unit testing integrated, but it will be Microsoft’s own version. They did say that V.S. will let other products add on and integrate on their own – but they couldn’t show me that. I will be interested to see if they will allow Nunit to integrate as seamlessly as IntelliJ and Eclipse do. So I wasn’t real interested in that. The other talk was about the future of C++. I’m still trying to avoid C++ until I have to acknowledge its presence, so I avoided that talk and hung out in the FitFest room. And had a good time writing some tests/code/test/code with a Swedish? guy named Carsten. When you carry a torch you can see the Wumpus for many rooms away, but he can see you. He will wake from his slumber and chase you until you are gone from his line of sight. The big problem was that ‘moveWumpus’ was private and only accessed from a method that had to do with arrows. So it took us a while to figure out why this was – the Wumpus wakes up when you shoot an arrow and miss. He then moves to a random room. So we stumbled around with various means of integrating this, but eventually ended up following the already established pattern of having a Boolean variable that is checked by the ‘evaluate’ function. So we checked ‘hasTorch’ in the evaluate method and then wrote an algorithm that looked along the lines of sight. It worked, but it is es muy crappisimo. First the line of sight business is duplicated in the shoot arrow function so we really should pull it out and abstract it. And the WumpusGame class has way too much going on in it. And the commands really suck (the are methods that shoot arrows, and magic arrows, but no way to access those command while playing the game). Unfortunately, both Carsten and I had to go before we could do this refactoring.
I talked to Micah about this latter and he had an interesting point. Even though the code was ugly, we had added way more functionality than last year (where the code size tripled and no new acceptance tests passed). And also the ugly code emphasized the need for sharing knowledge of the system by pairing and switching pairs. Carsten and I sat down and had no idea how anything worked. In order to add some functionality we had to poke around the code for 45 minutes. And then, because we had to leave and couldn’t work with other people, our knowledge of what needs to be fixed and how to fix it walked out the door with us. When we came back later, things had sufficiently changed so that we couldn’t be sure that our refactoring was valid anymore.
Later I sat in on a panel called ‘Is XP relevant?’ Which was mostly an excuse to start a fight. Bob started one by claiming that XP was irrelevant. Lots of people objected to the name ‘Extreme Programming’ because it scares people and others objected to getting rid of it because they think the agile is too watered down a concept too support. There was the same general disagreement about how much it is our job as developers to be polite and sell XP or Agile or whatever. I don’t like selling, but I don’t want to code in a waterfall company.
The big end of the Conference banquette was probably more loud music and dancing than most programmers are comfortable with, so when that started up most heading for the door. Before we cleared the room, there was the announcement of the next year’s conference name: ‘Agile United’ I guess XP is too scary to have in the title. The counter argument is that Scrum and RUP aren’t in the title so why should XP be privileged? Bob has worries that somebody might start up a conference with XPish title and all the unification we’re seeking will be lost.
Bob’s after dinner talk had to do with astronomy – surprise! He talked about how Kepler had a beautiful theory regarding the motion of the planets, but when he looked at the data he found his theory was wrong. So Kepler adapted. His idea was that XP is a beautiful idea, but we must keep looking at the data to weed out the bad parts.
For those who didn’t want to dance, there was charity poker. 10 bucks Canadian gets you $10,000 funny moneys. Then you could play blackjack or poker and for every $10,000 you turned in you go a raffle ticket. I ended up playing pretty well, got lots of raffle tickets, then Micah’s mom gave me her raffle tickets so I won two books. One was a Microsoft ASP book which I gave away, the other was ‘User Stories Applied’ by Mike Cohn. I saw mike Cohen speak on the Managing Agile Projects panel, and he seemed pretty cool (and like he might be able to break me in two) so I’m gonna read it. Not just because I fear for my safety, but also because a number of people said it was good stuff.
Bob is famous for sticking astronomy into any and all talks he gives. At this year’s Rails Conf he didn’t even try to integrate it into the talk. 10 minutes of entertaining stuff about the age of the solar system and then a bit about Smalltalk.
At some point this evening I talked to a bunch of people from ThoughtWorks, including my recruiter Sonia. I had met her though a reader of this here blog a week or 2 back but I hadn’t mentioned it because nothing was for sure. The ThoughtWorks people seemed pretty cool and everyone at Object Mentor said it was a good place to work. I think at some point this evening I made my pitch to Micah for a job at Object Mentor saying that I could be the IT guy for OM while I learned more and could slowly work my way into real work. Ultimately they declined my offer but were very nice about it and said that they just were not hiring at that moment but maybe in 6 months or so we could talk again. I was a bit crushed as I thought working at ThoughtWorks was a bit of a long shot. I had done a few other interviews and most companies were pretty put off by my lack of experience. So with XPAU just about over and my apprenticeship done it was looking like I’d have to teach another year of high school physics. Maybe this was all just a fun/stressful summer adventure.
18 Aug 2004
In the summer of 2009 I revisited my 2004 summer apprenticeship at Object Mentor. What follows is the original 2004 post and then some 2009 commentary. This is the last post of the series.
Last day of XPAU and I’m pretty burnt. I’m typing this from the airport in Calgary where they inform me that they are running an hour behind. This is bad because my connecting flight in Las Vegas is an hour and 20 minutes after I land. So I’ll have 20 minutes to catch my flight, assuming they can keep to their prediction. I don’t have high hopes. I might have to miss work tomorrow.
Which would kinda suck because I need to figure out what’s going on this year. With Rylander and Miller gone, I’m going to need some time to plan with the new guys.
Today I slept in and skipped the morning stuff. Then I hung out in the FitFest room, writing code, and chatting with Micah, David, and Paul. Ken stopped by later and we said our goodbyes. I hope I see him sometime soon. The last address was on the history of the waterfall and agile. The presenter did a good job showing how the originator of waterfall was actually arguing against waterfall and for iterative development. And how iterative development actually has been going for 30-40 years. But it has been marginalized and contained. The hope is that the Agile movement can kill the waterfall once and for all. But, who knows, 40 years from now we might be just another slide in a presentation.
Me and the OM crew went out for one last bite after the conference wrapped. Hard to say goodbye to those guys. Paul and David live in the city so there’s a chance I’ll still see them, but Micah’s way, way out in the ‘burbs so that’ll be tough. Nothing a little effort can’t overcome.
Is this my last entry? It just might be, the apprenticeship is over. Thanks for reading.
I was pretty exhausted and down when I wrote those words. Setting up for a year of teaching takes a lot of work and I had done nothing. I was facing no sleep followed by a mad scramble to get ready for new students.
So what did happen? At this point I had already turned in my code submission to ThoughtWorks and when they didn’t get back to me after a few weeks I thought it was all over. What I didn’t know is that ThoughtWorks is known in the field for having a very long interview process. I had already talked to 2 different people and submitted code so I thought they had enough to make a decision. Sometime near the middle of September they called me in for a day of tests and interviewing. I got job a week or so after that and started in early October. Which meant that I had to leave school with the year just started, but my high school was cool about it and didn’t fine me or suspend my license (which they had the legal right to do).
I guess I could spend some time wishing I had continued this blog while working at ThoughtWorks, but instead I’m just going to be pleased that I managed to document so much of an important time in my life. There were days when I didn’t really feel like blogging after a day of getting my brain crushed by code but I’m glad I stuck with it as long as I did.
I still see Micah, David, and Paul fairly often, btw.