Week 3, Wednesday

April 8, 2009 at 7:36 pm (Java, Ruby, Week 3) (, , , , )

My apologies for missing yesterday to anyone reading on a daily basis, but I ended up staying home from work and sleeping most of the day on Tuesday. I did get some reading done, but my programming work yesterday was negligible.

Today, however, my illness seems to be receding, and there’s quite a bit to write about. I spent a couple of hours on Java and Tic-Tac-Toe this morning, mostly re-organizing my packages in a way that (I think) better satisfies the package principles in Uncle Bob’s Agile Software Development, Principles, Patterns, and Practices. It took me longer than it should have to get an Ant task back to running the main program – ever since I created the initial packages, that task had been broken (failing with a NoClassDefFound error). I probably spent close to an hour trying to get the classpath where I thought I needed it, but eventually was able to make it work by scoping my “main” class (TicTacToe) down as my package structure was laid out: trptcolin.main.TicTacToe. Now, something tells me this is a hacky way to do it and that I should be able to just specify the classpath and the class name, so I’d be happy to hear any confirmation or denial of that sentiment!

Originally, I had the interfaces and abstract classes for my players, views, and controllers in the same packages as their implementations and subclasses, but then I started to think that because the implementations are likely to change, I wouldn’t want to require each package containing an implementation to ALSO contain a duplicate of the interface. It seems better to have the interfaces pulled up with the main application code, at least at the moment. So I did that, and along the way did some work to ensure that Git saved the file history, which is starting to feel more unnecessary the more time I spend doing it. I think I may start letting IntelliJ do this kind of file-moving work (from package to package), and let Git go ahead and believe that the files have been deleted and created again.

I made my first (small) steps toward a 3-D Tic-Tac-Toe game: I pulled public methods from my Board class into an interface, which I can now implement in a BoardIn3D class the way I already have in my (newly named) BoardIn2D class. Luckily, I don’t have to render the board in 3-D; the display will just be 3 vertical slices of the board in console mode. I love the IDEA of rendering 3-D, but I’d have been scared to try it, especially since I can’t imagine a good user interface that would allow someone to get at the center cube. And speaking of cubes, I have some methods and variables I’m definitely going to need to rename now that 3-D is a possibility (“squares” isn’t going to work anymore).

Eric and I got some more stories done on our Rails project, and I’m enjoying the constant testing we’re doing. It’s a really disciplined approach, and I know the end result is going to be a great product (that’s pretty easy to maintain). He also got a ton of work cranked out yesterday, and I was able to get the bug fixed from Monday with one of our Apache conf files. Note to Passenger users: Passenger runs as the owner of environment.rb, so the log files (and directory) should be writable by that user. Now, ours were both root-owned, so I’m not sure why that didn’t work, but it led me down a path to change the ownership to the Apache process owner, and that finally got logging to work in a staging environment for our app (and subsequently showed me what was going awry with the Apache conf file).

Advertisements

Permalink 2 Comments

Week 2, Wednesday

April 1, 2009 at 10:10 pm (System Administration, Week 2) (, , , , )

Last things first: I had some delicious Chicago-style pizza this evening, my first since moving to Illinois. I won’t name names, but it was at a well-known place, highly recommended by some friends back in Georgia. I got some hot tips at work this afternoon about some other places that are supposed to be better, so I’ll be excited to try those once my wife and I finish all of our leftovers!

OK, on to the fun stuff. Eric and I worked on some more stories for the project we’re on. I actually had a decent amount to contribute today, because we did a lot of deployment-related stuff: SSL, payment gateways, Apache/Passenger configuration, and generally setting up a new Ubuntu slice to run Rails. My last job involved a lot of this kind of thing, so I was relatively comfortable, especially compared to yesterday’s mostly RSpec/Cucumber work. I had forgotten a lot of things, though, especially regarding Apache setup. We were both talking today about how we needed to go home and experiment with different Apache config commands to get more familiar. The big stumpers were VirtualHost, NameVirtualHost, and a lot of the mod_rewrite syntax (RewriteCond, RewriteRule, etc.) – nothing a few hours of thought and Q&A with Google couldn’t solve for us today, though.

It was nice having more to contribute, but at the same time it was frustrating when I couldn’t remember the syntax for things I know I’ve done before. It sure is a lot easier to copy a file from another project and replace a few lines than it is to recreate it one from scratch – but I’ve been interested in system administration stuff for awhile, so it’s good for me to know and practice.

My wife’s mother is in real estate – meaning she fixes up and sells or rents houses. For awhile starting out, there were certain things she didn’t know how to do, like laying bricks for a fireplace. So she hired some guys to come out and do the job, but she stood there with them and watched them do the job, asking questions and absorbing the information until she knew how to do it. When she needed a brick fence later on, she layed the bricks herself (and saved a lot of money, of course). This strikes me as a great model for software developers who work alone or on small teams with skill holes. Just hire somebody to come in and do the job, but learn from them. Chances are you won’t be as good as them at it when they leave, but you’ll be a heck of a lot better than you were before.

I know some companies can afford to have distinctions between/among system admins, database admins, and developers, but I think with software craftsmanship, and smaller teams in general, it’s important for the tech people to be able to get everything done, top to bottom. And for me personally, I love the idea of having the necessary knowledge and skill to produce a great product alone or with a pair.

I can see why people say that demonstrating a task or skill for someone is a great way to learn it, because I’m motivated to get more solid with my sysadmin knowledge, even though I felt like it was almost good enough today. It’s just a matter of prioritizing at this point. My stack of books to read is getting taller and taller, but I can only learn so much at once!

Permalink Leave a Comment