|
Monday 9-21-04 Well, ThoughtWorks has offered me a job and I have accepted. These last few weeks have been pretty busy as I resigned my teaching position (after the school year had started - unheard of!) and handed it off to a band new teacher. I start working with ThoughtWorks on October 4th. I need to ask some more questions about the confidentiality agreement I had to sign before I’ll know if I can continue this blog. I’d like to thank everybody who emailed me with encouragement and job leads and corrections and whatever. |
|
Wednesday 8-18-04 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 chating 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. |
|
Tuesday 8-17-04 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. |
|
Sunday 8-15-04 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 number to them. This is one of the tricker parts for the first time XPer. The numbers are unitless and do not coreespond 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 time 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 need 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. |
|
Saturday 8-14-04 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 Jefferies 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. |
|
Friday 8-13-04 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! |
|
Thursday 8-12-04 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. |
|
Wednesday 8-11-04 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. |
|
Tuesday 8-10-04 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. |
|
Monday 8-9-04 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. |
|
Friday 8-6-04 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. |
|
Thursday 8-5-04 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. |
|
Wednesday 8-4-04 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 revalation, 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). 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 scroll down to the bottom of the page (the May 2004 entry). 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). |
|
Tuesday 8-3-04 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 |
|
Monday 8-2-04 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. |
|
Friday 7-30-04 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. |
|
Thursday 7-29-04 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… |
|
Wednesday 7-29-04 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. Luca 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. |
|
Tuesday 7-27-04 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. |
|
Monday 7-26-04 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 probelm, 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: |
|
Thursday 7-22-04 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 . |
|
Wednesday 7-21-04 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. |
|
Tuesday 7-20-04 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). |
|
Monday 7-19-04 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 it’s 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. |
|
Friday 7-16-04 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. |
|
Thursday 7-15-04 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 ticks 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. |
|
Wednesday 7-14-04 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 I… (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.) …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. |
|
Tuesday 7-13-04 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. |
|
Monday 7-12-04 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. |
|
Friday 7-9-04 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. |
|
Thursday 7-8-04 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. |
|
Click on the logo below to get back to the front page. |