More fun with JRuby (but for real this time)

May 14, 2009 at 10:19 pm (Java, Ruby, Week 8) (, , , , , )

Well, I knew I would see some benefits from my seemingly unproductive work yesterday, but I didn’t imagine that I’d be able to have a patch together today. It turned out that with the knowledge I gained yesterday, along with some smarter strategies, I was able to fix the issue with spaces in directories housing jarred gems that was haunting me. It wasn’t easy, but I tracked my way through the JRuby source and submitted a tested patch to the JRuby issue tracker. We’ll see; maybe it’ll get accepted, or maybe there’s something I haven’t thought of that’ll hold it back. Either way, I gained a lot of confidence, and I’m excited about taking up Charles Nutter’s call to fix RubySpecs in JRuby. Very timely!

I was also in on some meetings with the rest of the development team Micah and Doug are working with. They’re based remotely (Doug just flew back into town after working onsite with them), so we did some teleconferencing using Skype for video chat and Adobe Connect for screen sharing. It’s pretty amazing technology, and while I can’t discount the great value you see from working side-by-side all the time, I’m impressed that it’s so easy.

Micah and I did some CSS and Javascript (JQuery) work towards the end of the day. He’s not a fan of the CSS float attribute, so I had to convince him that it was worthwhile for the layout we were working with. Of course, there are generally multiple options, this case included, but I think we ended up with a good starting point for a screen we were laying out. JQuery’s AJAX capability is pretty awesome. We used JQuery.getScript(), which fetches a script from a URL and then loads and executes it (with an optional extra function parameter to run afterwards). It basically does the work that we would’ve had RJS do in a Rails application, but it seems much cleaner to me. We still have some thinking to do about how the performance is going to be in our particular case (1 web request per second will almost certainly be too heavyweight), but it’s a great start. The other big question mark for our current task is to what extent we’ll be able to test it. Luckily, resident TDD Javascript expert Jim Suchy is going to help us out with that. Thanks Jim 😉

Advertisements

Permalink Leave a Comment

Cleaning XHTML & jarring gems

May 11, 2009 at 9:30 pm (Java, Limelight, Ruby, Week 8) (, , , , )

Back to my beloved XHTML 1.0 Strict and CSS today. I took some code that came from a client as a quick MS Word-generated web page, grabbed the important things, and deleted. And deleted. And deleted. Always a great feeling to get rid of redundancy. Code like this:

<tr>
<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;</td>
<td bgcolor="#FFFFFF">Some Text</td>
<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;</td>
<td bgcolor="#FFFFFF">Some More Text</td>
<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;</td>
</tr>

makes me want to laugh and cry at the same time. Maybe it should start its own Broadway musical. At any rate, it’s a bad laughing and a bad crying, so it had to be fixed.

I got to check out Sinatra a little bit in the process, which was pretty cool. It took me a little bit to figure how to get Sinatra serving up images and stylesheets, but it’s very clear once you know!

set :public, File.dirname(__FILE__) + "/views"
set :views, File.dirname(__FILE__) + "/views"

Public and Views here have similarly-named analogues in Rails. They’re basically what you’d expect.

Micah, Doug, and I worked some more on jarring up gems, and despite some current limitations, we now have a great start on an idea for distribution. If you’re looking for answers on how to do it, check out Nick Sieger’s blog, the best source we’ve found on the topic. Be sure you know what commands and options you’re using, and how they relate to gem directory structure. I had a lot of trouble understanding how gem directories are laid out, and how that related to the jar directory structure, but now I have a good basic idea.

On an unrelated note, if you walk outside real quick to pet the cute new puppy next door, it’s great that you remembered to take your jacket, but it would be best to bring at least one of the following, since you locked the door on the way out: (1) keys, (2) phone, or (3) wallet with ID and spare key. This will avoid embarrassing encounters with neighbors you hadn’t met (although this is one good way to meet people). Not that it happened to me… just sayin’.

Permalink Leave a Comment

To the Starting Line!

March 21, 2009 at 10:40 pm (Pre-Apprenticeship) (, , , , , , , )

I’ll just give you a quick summary of my software career up to this point and how I came to be an apprentice at 8th Light.

I really lucked into my first job, which started out as a part-time XHTML/CSS web development job and grew to full-time. I was a 3rd-year grad student in trumpet performance, worrying about career options, so I answered an ad in the university newspaper, and soon I was off and running. I learned a ton there: cutting up Photoshop mockups into XHTML/CSS, writing small apps in Ruby on Rails, basic Linux system administration, and lots more. I owe them (Plexus) a lot, and I’ll be forever grateful.

In the past year or so I’ve started reading and coding a lot outside of work, and I’ve realized more than ever before how much I have to learn about the process of creating software.  Here are the most important books I’ve read, just to give you more of an idea of where I am: Ruby for RailsLinux: The Textbook (Sarwar), The Rails Way, The Pragmatic Programmer, The Ruby Way, MySQL (Dubois), My Job Went to India, Design Patterns for Ruby, and I’m currently working on Agile Software Development, Principles, Patterns, and Practices, Extreme Programming Explained, and Clean Code.

Frankly, my software development experience beyond that is minimal: I took an introductory C++ course in undergrad, and last year took an online (introductory) Java course and watched online lectures in C and PHP. When it comes to TDD, design patterns, refactoring, object-oriented principles, Agile, XP, data structures, algorithms… I just need much deeper knowledge of these and other areas if I want to become a real software craftsman. And I do.

I heard about software apprenticeship and found the Software Craftsmanship Google Group, where I posted asking for pointers on improving my skills. Micah Martin, one of the founders of 8th Light, was kind enough to invite me to dinner to discuss opportunities (I lived in Athens, Georgia, and he had a client near Atlanta). He told me about 8th Light’s apprenticeship program, which I’d read about, and said if I was interested in talking more about it, I’d need to write a Tic-Tac-Toe game that always won when it could, and tied in all other cases.

I’ll be honest, it sounded really tough, but I was excited about it, so I spent a couple of late nights hacking on it. There was no language requirement, so I used what I knew: Ruby. I knew Micah wanted to see unit tests (with which I had basically zero experience besides playing around with Rails unit test tutorials), so I did my best to write tests first. I actually did mostly TDD until it came to the game AI, which I wasn’t really sure how to handle. At any rate, once I thought I was done (and pretty proud of it, I’ll admit), I sent it off to Micah, who was nice but helped me to rethink some very bad decisions I’d made. Some of these bad decisions were due to my deficiencies in object-oriented principles, some due to my deficiencies in algorithms, and some [cringe] due to my lack of thinking through the knowledge I already had. It was a great lesson in humility and discipline.

Fast forward a bit to my interview in Libertyville (a Chicago suburb): four of the 8th Light craftsmen interviewed and/or pair-programmed with me, and I was really impressed by the quality of code and depth of thinking that these guys were doing. I was inspired to write better code, and I wanted to do it as soon as possible. The official apprenticeship job offer (and immediate acceptance) came on February 16, and my first day of work is March 23. Meanwhile, I moved 834.2 miles from Athens, Georgia to Mundelein, Illinois—whew!

So while I’m not really at the very beginning of my learning process as a software developer, I’m nowhere near the end. I know I’ll continue learning as long as I’m around, but I’m definitely ready to start moving faster.

Permalink 4 Comments