Where have I been...why the lack of posts: a) holidays, b) knee injury playing basketball (that required surgery to repair) has slowed me down, c) recently, I've started to work on a project where ASP.NET using C# was the requirement.
So, I haven't been working in Rails for a few weeks and it's been a few years since I've used ASP.NET or C#, so I've had to jump back into it a little to refresh myself.
Now, look, I'm not trying to start a religious war here: ASP.NET and Rails each have their own benefits and drawbacks. However, I would like to say this: for simple web sites Rails is so much easier.
Here's a simple example: I've got a URL stored in the database, such as http://www.mysite.com/foo/fee/foh.htm and I need to get the foh.htm (which isn't stored).
ASP.NET with C#
public string FileName
{
get
{
char[] delim = { '/' };
string[] a = this.Url.Split(delim);
return a[a.Length - 1];
}
}
Rails with Ruby
def filename
self.url.split('/').last
end
I'm sure I'm not the first person to make this comparison. I just felt compelled to speak out about the many moments during the day where it takes me several minutes longer to do something with ASP.NET and C# than Ruby and Rails.