she swears <i>geek</i> is a term of endearment

DotNet Junky on Ruby Exploration - chapter 3

November 26th, 2007 Rusty

History of Vous Ruby

I’ve investigated Ruby several times. I’ve gone through the online Ruby tutorials and installed Instant Ruby (no longer supported, replaced with Bitnami RubyStack). My first real ruby experiment was to try to create an object-based text file parser to open a text file, look for a reg ex pattern, replace it, then save the file. Sounds simple enough? I was able to get 80% of the way there with very little code. In fact, I did this in iRuby (interactive commanline where you define classes as you go). This was compelling because I can’t imagine doing this in c# without a compiler… Oh yeah, its compiled, need compiler. However, I reached an abstacle as I tried to interact with the filesystem and wasn’t satisfied with the accessibility of documentation while I Googled for solutions. I finally completed my task in c# using TestDriven.net as my execution interface. TestDriven.net, by the way, wins tool plug-in of the decade award for all the benefits its brought me.

As the World Turns (Ruby)

I quickly returned to the warm bossom of my Visual Studio IDE and the C# language. However, the Ruby on Rails 15 Minute Intro kept on haunting me, asking me whether I really needed stored procedures, parameter lengths, data readers, streams, request objects, page lifecycle, etc. It’s not that these things don’t have their place but I couldn’t help but feel as though the cutting and pasting I was doing to create data access and user controls wasn’t somehow repetative. DRY?

Rails for Microsoft Junkies

So I love C# but I wanted to experiment with rails. Monorail, y’all!

I started there. The first thing I discovered was how easy simple things were. That sounds pretty trivial but sometimes I am astounded by how much crap I have to add to get data to a page in Asp.Net without violating every principle of good software design ever captured in a UML diagram. Data in the presentation tier just makes me feel dirty, I can’t sleep at night, I can’t eat. I just won’t do it. Even DataTables eak me out. Strongly-typed datasets? Who thought it was a good idea to take something dynamic and unstructured and compile the ugly thing? Intellisense, I know. I am addicted to it, too.

Of course, monorail is a gateway drug. I used monorail with Active Record to create a simple website. When I defined my business classes and used them exclusively to bring data to the view, I was excited. Then I genereated the schema for the first time. It was a dirty chunk of code in global.asax but it generated a database that was compeltely prepped for persisting every class I’d defined with no more than simple attributes. WOW!

Of course, I am a control freak and didn’t like the 1 to 1 requirement of Active Record so I learned about NHibernate. Many months later, and a significant amount of trial and error, not to mention a significant repository infrastruture, plus tremendous development and advancement by Mr. Rick Caldwell, and we now have abandoned our previous belief that all data accessmust use stored procedures and that ORM was for lazy programmers. It rocks. I LOVE database modeling. It is downright orgasmic to design your class structure according to your domain model and then generate a database schema that perfectly matches the normalized data model that you would have coded if you were required to do that by hand. Watching the sql in Log4Net is also quite entertaining and rewarding. Being able to focus entirely on the business domain and not worry very much about data access is just efficient.

Back on the Rails

For a period of time, rails was shelved in favor of asp.net using NHibernate. Recently I spoke with Mark Jones (blog link forthcoming) and he helped reinforce my belief that there is something very exciting happening on the Ruby side of the world.

He was excited about the Monorail possibilities and inspired me to explore the framework further. I dug into the ajax helpers and compared ashx handlers with controller actions and found it truly a pleasurable way to create a website. It almost forces you into good design. MVC frameworks encourage you to separate concerns. A little good practice and inversion of control is as simple as a one line code change (load from config rather than in code).

…and back to Ruby

I have been excited about a ruby port to dotnet so there must be something in that Ruby community that fosters creativity and innovation.

I am installing the RubyStack now and will begin my now far more enlightened adventure through the language. I now understand that you don’t need to compile ruby, you execute the ruby.exe commandline runtime. It will launch whatever components you need for your app. I can’t tell you how long I’ve been confused as to how exactly to execute my ruby app without visual studio. Where is F5?

I’ll keep you posted

Subversion Client only Package on Windows

November 5th, 2007 Rusty

In searching for a safe, lightweight package for Subversion on Windows Vista, I finally found one.
Collabnet Subversion Client Only. I installed this on Vista and it works great so far. You will have to learn how to use the command-line. There is no pretty GUI. However, if you are familiar with Svn interactions using TortoiseSvn, it is very easy to find the equivalent commands on the Svn Book

I’m posting this because I just made a lengthy reply on a blog that was trashing Subversion. I found it by searching for “Subversion Vista”. I have a Vista machine and didn’t want to risk TortoiseSvn, yet.

Here’s the synopsis: “I’ve LOVED subversion …since ‘05 when VSS was completely crapping out on us. Builds were taking hours to complete just the VSS interactions and maintenance would begin at 7pm and still not be complete at 8 am the next morning. As soon as I discovered the benefit of the “modify merge model”, and how well Svn handles that, I never looked back.
Tortoise Service occasionally causes problems. Its nothing that killing the process can’t correct and it doesn’t tear down the machine. I even use it on our production servers just to make life easy…”

Rusty’s Vista report card: C-

November 5th, 2007 Rusty

I am indeed running Windows Vista Business and I am scared to death to install anything. My first Vista machine was a Dell Inpirion 6400 with 2G ram and Vista Ultimate. It is about 6 months old and has been shelved until further notice. This Dell Inspirion cost us nearly $2G and is useless. It now collects dust on the hardware rack to my right while I work with my new Lenovo X61 tablet running Vista Business. As soon as a patch for Vista comes out, I’ll update the Dell and re appropriate it for a more appropriate user - someone who uses office and iTunes and nothing else.

Rex has the twin to my machine and he received the “blue screen of death” on Friday. It was after I installed Fiddler on his machine. I should really just not touch his Dell. I think it senses my anger and disposition.

I have to say things are much, much better on the Lenovo. (That Dell absolutely sucks!). Apart from a truly crappy screen, it is solid. However, I am being very careful not to install anything heavy (like Visual Studio or TortoiseSvn) on this laptop. I am relying on Remote Desktop and VirtualPC for all my development work. So far, I haven’t mastered the latter. I think I need a more reliable external hard drive.

I’m sure Microsoft will have things nailed down in the next giant update. I can’t wait. I think someone finally just put their fist on the desk and said, “ship it! We’ll use our second tier QA department and patch this sucker in a year.” echk huh, I’m ready…

Lenovo x61 Tablet with Vista

November 5th, 2007 Rusty

My recommendation for all you tech-heads thinking about the X61, wait for an better screen and get one. If things change, I’ll update my recommendation. However, it is a reliable machine that always connects, always launches reasonably fast, and very rarely drops me on my ear. Occasionally, Outlook 2007 dies. That’s about it. On the other hand, I’ve been so careful with it that it is not seeing heavy developer usage. The machine it replaced is a Dell Inspirion 6400 with Vista and I can’t tell you strongly enough to avoid that (or any mid-level) Dell.

Overall, I enjoy my Lenovo. It does what I need and has that utilitarian feel to it. I will continue to amend this post with observations, experience and recommendations.