Jake Scruggs

writes ruby/wears crazy shirts

This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

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.

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.

This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

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 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.

This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

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 (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.

So there have been a bunch of metric_fu releases since I announced 1.0.0 on this here blog. It's now up to version 1.1.4 and we've added:

  • Flog, Flay, Reek, Roodi, and Rcov now have graphs over time (thanks Édouard Brière).
  • Cool, dare we say 'Awesome,' templates for the metrics (thanks Nick Quaranto and Edouard Brière).
  • Flog report now tracks average Flog score per method and the average of the worst 5% of your methods.
  • MetricFu now works with Ruby 1.9.1 (thanks to Robert E. Rouse for his help).
On to the pics:

flog

main metric_fu

stats

saikuro

roodi

reek

rcov

flay

churn

Homepage
Google Group
Github Repo

Enjoy!

This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

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.

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.

This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

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.


"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
.

This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

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.

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.