Archive for the 'Ruby on Rails' Category

A short update

I’m not doing so hot at updating this blog regularly, am I. :) School’s keeping me busy (seems like I say that a lot) but I’ll try to figure out a focus, something that’ll get me writing. (And be interesting to read.)

In the meantime, I think I want to master regular expressions next. I’m familiar with them and have used them often, but there’s a lot of power in them there regexes. In other news, I’ll be coding a family website in Rails over the next few months. It’ll be a good testing ground for my Beyond work. And at work, it looks like this web app I’m working on will be almost all Javascript. Not what I expected, but I’d much rather work in Javascript than ASP.NET. :)

Goodbye, OpenLaszlo

After a month of OpenLaszlo, I’ve had enough. Coding in XML just isn’t my style, I’m afraid. (And yes, I know you do half the coding in JavaScript, but that doesn’t change anything.) I don’t think that means XML-based programming languages are inferior or anything like that — if I spent more time wrapping my head around OpenLaszlo, I could probably feel better about it (or I’d have one heck of a sore head). But I don’t have that kind of time. Nor was I getting enough of a “coolness” factor, the way I do when I work with Lisp. This experiment leads me to suspect that I probably wouldn’t like Flex much, either.

So, I’m going back to the basics. Simplicity is good, and so I’ve taken the app I’m working on and pared it down as far as possible. So far, in fact, that I’m pretty sure I’ll be able to do the whole thing with Javascript, HTML, and CSS, with a web service providing a connection to the server (written in ASP.NET most likely, though I’d prefer Python and may end up going that route), and anything else in Python. I might use MochiKit or Dojo to make the Javascript end easier to code, but I’m not sure yet if I really need it. (Why not Rails? Well, the server is unfortunately a Windows box running IIS, and I’ve heard that Rails doesn’t perform all that well on IIS. I wish I could get the server moved to Linux, but that’s probably not going to happen anytime soon. In the meantime, Python is still very nice to work with, and I haven’t caught wind of any performance issues with it on IIS.)

At any rate, this stack feels a lot better. When I was working with OpenLaszlo, I felt like I was in a straitjacket. Not much fun. Or “open.” (Again, keep in mind that these are subjective impressions; who knows, maybe OpenLaszlo is your style.)

In the meantime, I’m reading Paul Graham’s ANSI Common Lisp and liking it.

Yet another update

It’s been a while since I wrote about programming. Almost a month, in fact. ~sigh~

So, the BYUFHLC is on hold for now due to time constraints at work. (I have to get all the new extraction software done by a month from now when we present it at the ICAPgen conference.) After ICAPgen I should have enough time to finish it, though.

Haven’t coded much Ruby (or Rails) lately. I may start using it for prototypes for this extraction software, though… Considering that we’ll be switching to a Linux server sometime within the next few months, it almost feels like a waste to code the stuff in .NET (not to mention that I much much much prefer Rails), but it’ll have to do. At least I can rest assured that I’ll be able to recode it in Rails five times as quickly. :)

In other news, Matz is coming to BYU to give a colloquium two weeks from tomorrow. (11 a.m. on the 19th in 1170 TMCB, if you’re interested and on campus.)

BYUFHLC

Last week on Top of the Mountains I mentioned my FHLC/UVRFHC mashup (which I’m now calling BYUFHLC). It’s written in Ruby on Rails and is 75% done (I just have to add support for the non-place searches, like surname and such). Here at the Center for Family History and Genealogy, my employer has gotten interested in it, especially with the possibility of packaging it up to deploy at other family history centers.

Which leads to the question: is Ruby on Rails good for that? I mean, I know it’s superior to something like PHP or Perl, and I much prefer it, but what are the chances that those family history centers are going to be able to support a Rails app? It seems like PHP would be a better choice, since it’s guaranteed to be installed and supported. I don’t really want to recode it in PHP, though. :)

Mephisto on Bluehost

Stumbled across Mephisto today. It’s a Rails-based blogging system, and dang does it look good. ~drool~ I am pleased with WordPress, mind you, and it’s treated me well, but I’d really really really love to blog on a Rails blogging app so I could tweak things in Ruby instead of PHP. I like what little I’ve seen of Mephisto, too.

I’m not sure if I’ll be able to install it on my servers, though, because you have to be running Edge Rails (revision 4727), and Bluehost has 1.1.6. Nor do I think they’d upgrade their servers just for me. :) Beyond that, it helps if you can install gems, but I can’t. Time to post to the forums

The other thing is that this is a project I can actually see myself contributing to. WordPress could have got a few lines of PHP out of me, but coding Ruby for Mephisto would be quite fun. If I can get it installed, the first thing I’m going to write is a WordPress-to-Mephisto converter so I can move all my blogs over.

More Rails love

Lately, the need to finish these major projects at work before I switch jobs at the end of August has turned most of my coding time (well, all of it right now) into ASP.NET time. Blech. It’s okay, I suppose, and it could be worse (COBOL, anyone?), but I miss Ruby on Rails. Soon, Ben, soon. :)

In the meantime, the library finally got me Agile Web Development with Rails via ILL. I’ve been waiting a while for it. :) Just reading about Rails makes me happy. (Speaking of which, I must be behind on my Rails blog reading. Maybe I’ll do that for a while today… :))

Another little project I’ll do sometime soon is convert my Perl etext script into Ruby (it takes Project Gutenberg texts and preps them for InDesign by removing extra blank lines, removing newlines, replacing two hyphens with an em-dash, etc.). It can’t be that hard — it’s 15 lines long :) — and it’d be a nice back-to-Ruby project to tide me over until all this work stuff is finished.

Speaking of which, I really, really, really wish I could write this extraction web app in Rails instead of ASP.NET. I could get it done sooooo much faster, and I’d be happier. But the rest of the site is in ASP.NET and I’d have to get the sysadmins to install Rails on the server and it’d probably be too much trouble. ~sigh~ Oh well — only one more month of it, and then it’s goodbye forever to .NET. Period. :)

Why I chose Rails

In response to Andy’s comment, here’s why I’m enjoying the ride on Rails.

Ruby. Once upon a time (and this time happened to be eight or nine months ago), I decided to learn Python. It didn’t take long before I decided I’d never go back to Perl or PHP if I could help it. (In retrospect, I still use PHP on occasion as that’s what WordPress is written in, but someday I want to move all my blogs to a Rails-driven engine.) So when I heard about Ruby, and then Rails, it was clear that Perl and PHP and pretty much everything other than Python had become a non-issue in my mind. Zope and Catalyst and all the others held no allure for me. Django looked intriguing, but I decided to go with Rails because of…

The (well-deserved, IMHO) hype. In reading about Rails online, the people who were extolling its virtues were the kind of people whose opinions I value. There’s a substantive difference between the sort of people in the Rails camp and those in, say, the Java-based camps. It’s the same kind of thinking that I’ve found in the Mac world. So when I found that those kinds of people were really pleased with Rails, I knew almost from the get-go that I would like it.

37signals. It’s their child, of course, but I’d seen their other web stuff (Backpack, Campfire, Ta-da, etc.) and was impressed. Much of what they talk about on Signal v. Noise and in Getting Real resonated with me, too.

Finally, but most importantly, it’s fun. Coding for Rails is bliss. Once I got past the initial hump, it’s been nothing but a joy. Even when things go wrong! The happiness comes from both Ruby itself (a beautiful language) and Rails (metaprogramming, Active Record, etc.). Having worked with frameworks in .NET for the past couple of years, I was blown away by how tight and crystal-clear Rails felt.

Now, I do realize that Rails isn’t perfect. But love is blind, they say, and so far I haven’t found any faults. :) I’m sure the other frameworks out there are great, at least some of them, and if I had any advice to give it’d be this: go with what feels right for you. Rails meshes perfectly with the way I work, so that’s what I chose. I’d recommend it to anyone and everyone, but I’m sure there are people out there who wouldn’t like it, just like there are people who don’t like Mac, etc.

Not dead, just hiding

This next month is going to be a bit of a crunch, with several large projects to finish at work before I leave at the end of August. I guess that’s why I haven’t blogged here lately, but that’s kind of dumb because work is coding and it should spawn more blog posts. Oh well.

So, after working in Ruby on Rails for a while, going back to ASP.NET is paaaaaainful. I can’t wait till I’m done with these projects so I can spend all my coding time using a language I love. Soon, my precious… :P

Salty logins

I’ve gotten a quick prototype of Beyond up even faster than I expected. It’s the bare minimum, but it works, and wow, Ruby on Rails really is as cool as I thought it was. :) Did I really just get it up as fast as that? Incredible.

And now a bone to pick. I’ve tried to install both the salted_login and the Login Engine, and I don’t know why I’m plagued with so much trouble, but neither one works. It’s getting really frustrating. When I try to login with the engine, for example, I get “undefined method ‘password_confirmation=’ for #“. I suspect the engine isn’t really starting after all. But I haven’t a clue how to fix that. ~sigh~ I’ve followed the instructions exactly — several times over! — and yet nothing. But I really don’t want to write my own login code. Hmm…

Well, I’ve struggled with it long enough today. Tomorrow I’ll press on.

On track with the Rails API

On Saturday I spent the whole morning reading through Ruby on Rails API and a number of other resources which have made quite a difference in my understanding. The API was the biggest thing, though. So much of what I had questioned before now makes sense. The main thing for me, I think, was that none the tutorials I’d read mentioned much beyond scaffolding, so I was completely unaware of layouts/partials, helpers, integration tests and fixtures, and so on. It’s so cool! Coming from ASP.NET, which is what I’ve been coding at work for the last year and a half, Ruby on Rails is a breath of fresh air. It’s beautiful. Perfect? No, but it’s more perfect than ASP.NET, at least in my eyes. And integration tests look pretty darn amazing. I’ve never done unit testing before, but I do believe I’m about to be converted to test-driven development. We’ll see how hard it is to get into that kind of mindset…