Anyone remember that?!
Heh, heh. Yeah, back when people used WinAMP... I guess they still might. I switched to WMP (gawd, I know), but then to Songbird when it finally stopped sucking (still sucks a little, to be honest).
Anyway, for newer Rails projects, I've completely replaced RSpec with Shoulda. It's nice, clean, readable, doesn't add anything extra to the Rails folder hierarchy, and best of all, it is filled with sweet-as-hell macros that take a lot of pressure off'a my tired fingers.
For non-Rails projects (I do those too!), they offer a gem, but I haven't used it yet.
It seems like every day that something exciting and awesome happens in the Ruby / Rails area, and everyone moves up to the next big thing... but I think that's because the next big thing is better than the thing you happen to be using at the moment.
A rambling blog from Arron, a scrawny little dork who likes to code. ;)
Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts
Thursday, December 18, 2008
Thursday, May 08, 2008
undefined method 'time_zone=' error?
undefined method 'time_zone='
Got that error?
Run this in your console:
gem sources -r http://gems.rubyonrails.org/That's for bleeding edge developer gems. It was probably put in your gem repository list when you upgraded to Rails 2.0 and then forgot about until now.
Monday, March 24, 2008
Assorted bitches about ASP.NET and Ruby on Rails.
(all text belong is my opinion, not yours. Keep your goddamn hands off my opinion if you know what's good for you, buddy.)
ASP.NET is my wife, Rails my mistress
Little background: people consider me a .NET guru. I'm not, really. I'm just not as stupid as most of the ASP.NET developers you'll encounter in certain environments.
You can get any old average joe to start a new project and fuck it up from the get-go, but it takes a special breed of programmer to go back and fix the fucked-up project without trashing the parts of it that works. So it stands to reason that most of the contracts I get are dealing with fixing the sins of mysterious "precursor" developers.
The Precursors are a race of highly advanced developers, who shun the trivialities of modern day development as we understand them.
For instance, here is some world-revolutionizing code I found buried deep within the bowels of a project I inherited:
Now, imagine an entire project architected more-or-less in the same fashion, and you'll know what most of my work-life is like.
That's half the problem. The other half of the problem is that I've used Ruby on Rails.
Don't get me wrong. I like ASP.NET. We get along fine. But I love Rails. The "run away to France with her" kind of love.
Have you ever been sitting there, hacking away in ASP.NET, watching this block of C# code get longer and longer... then, for a moment -- just a brief, fragment of a moment -- think about how you would have done it in Ruby. That, friend, is a moment of utter infuriation, a moment in which you realize that Ruby + Rails would have been 2 lines of code, max (4 if you have a brain-exploison) and you're on your 20th or 30th line of query-string manipulating twisted logic because the people who created ASP.NET haven't actually used it for any extended period of time outside of the "PetShop" scenario.
That's the only way I can explain why some of the ASP.NET framework is the way it is: they designed first, used second. Designed for programmers by someone else.
ASP.NET: "Making the easy things hard, and the hard things possible."
Yeah, OK. Whatever.
Don't get me wrong. ASP.NET isn't awful. A lot of sites run ASP.NET. Like, uh, MySpace. I just find that when you know what you want to do, you can't just go for it. There's always some stumbling block in your way. It's like being in front of your destination, but walking 2 blocks to the left, taking one block forward, then walking the two blocks to the right to get there. Uncool.
But, that's my opinion. Your mileage may vary, and probably does. I get 45/48 miles to the gallon, though! WOO HOO!
By the way:
CodeSmith, what the fuck?
CodeSmith is apparently some kind of code generation utility. People make templates for it and crap -- shit I've never really cared about until some developer I was working with but not monitoring closely enough ("He's a big boy, what's the worst that could happen?") decided he was going to use a proprietary solution for our project's ORM stuff.
Specifically he used .netTiers, which is free, but since .netTiers can only be used via CodeSmith,
it is essentially proprietary.
I only discover this a month or two later when a million thousand bugs crop up because the developer has left but forgot to update the DAL / etc before he left. Yeah, that's totally my bad. Whatever, though, right? All I have to do is run the generation utility. I download .netTiers, find this CodeSmith thing and then realize it's a closed-source application we didn't have a license for.
Part of that is my bad -- he was jumping up and down going ".netTiers is the BEST!" and I was like, "whatever dude, just get it done." In retrospect, considering the damage he's done, if I could go back and change it all I'd start by throwing my car at him if I thought it would go the distance.
Anyway, CodeSmith has a 30 day trial -- no big deal, we only need to regenerate once for now, and we can migrate to a free solution later: the .netTiers crap is way too convoluted for a project this size anyway.
What happened next totally blew my mind.
OK, OK, wait, alright, first the program hung for about 5 minutes before spitting out a raw exception on what is easily the most base and obvious error you'd expect an application to catch, and display nicely, but the mind blowing happens right after.
BUT RIGHT AFTER THAT
The program's generation suddenly stops, politely informing me that my 30 day trial only works with sample databases.
Yes, you heard that right...
Someone went to all the effort and dedication to make an application run off a 30 day trial, but then restricted the 30 day trial to sample databases, so actually trying it out is impossible.
How. Useless. Is. That.
It took me a few minutes to figure out why they did this: essentially it appears that people use CodeSmith because the guy before them used CodeSmith and the guy before THAT guy used CodeSmith -- generational crap, basically. I've read stories about it and stuff but never walked face-first into it before until now.
For those of you slow on the draw, or not really sure of what I'm talking about:
Imagine downloading a game demo. After installing it, you eagerly double click the icon.
However, instead of being plunged into ZOMBIE SMASHING MAYHEM, the splash screen politely asks you to buy the full game if you're really interested in zombie fun, and then starts playing a low-resolution video of other people playing the game.
Yeah, it's that stupid.
Anyway, I just bucked up and spent 20 minutes tweaking the generated files by hand. We'll be ripping out all the .netTiers stuff and replacing it with SubSonic or w/e at some point in the future no doubt.
ASP.NET is my wife, Rails my mistress
Little background: people consider me a .NET guru. I'm not, really. I'm just not as stupid as most of the ASP.NET developers you'll encounter in certain environments.
You can get any old average joe to start a new project and fuck it up from the get-go, but it takes a special breed of programmer to go back and fix the fucked-up project without trashing the parts of it that works. So it stands to reason that most of the contracts I get are dealing with fixing the sins of mysterious "precursor" developers.
The Precursors are a race of highly advanced developers, who shun the trivialities of modern day development as we understand them.
For instance, here is some world-revolutionizing code I found buried deep within the bowels of a project I inherited:
/* the following code has been anonymized; seeing it in it's true form might be too much for your eyes. */Zen.
public string IsValid() {
/* ... snip ... */
string is_false;
if ((bool)data["is_false"])
is_false = "0";
else
is_false = "1";
return is_false;
}
/* The only consumer of IsValid is buried deep, deep within another function. Here is the relevant bits */
bool is_valid = false;
string result = IsValid();
if (result == "0")
is_valid = false;
else
is_valid = true;
Now, imagine an entire project architected more-or-less in the same fashion, and you'll know what most of my work-life is like.
That's half the problem. The other half of the problem is that I've used Ruby on Rails.
Don't get me wrong. I like ASP.NET. We get along fine. But I love Rails. The "run away to France with her" kind of love.
Have you ever been sitting there, hacking away in ASP.NET, watching this block of C# code get longer and longer... then, for a moment -- just a brief, fragment of a moment -- think about how you would have done it in Ruby. That, friend, is a moment of utter infuriation, a moment in which you realize that Ruby + Rails would have been 2 lines of code, max (4 if you have a brain-exploison) and you're on your 20th or 30th line of query-string manipulating twisted logic because the people who created ASP.NET haven't actually used it for any extended period of time outside of the "PetShop" scenario.
That's the only way I can explain why some of the ASP.NET framework is the way it is: they designed first, used second. Designed for programmers by someone else.
ASP.NET: "Making the easy things hard, and the hard things possible."
Yeah, OK. Whatever.
Don't get me wrong. ASP.NET isn't awful. A lot of sites run ASP.NET. Like, uh, MySpace. I just find that when you know what you want to do, you can't just go for it. There's always some stumbling block in your way. It's like being in front of your destination, but walking 2 blocks to the left, taking one block forward, then walking the two blocks to the right to get there. Uncool.
But, that's my opinion. Your mileage may vary, and probably does. I get 45/48 miles to the gallon, though! WOO HOO!
By the way:
CodeSmith, what the fuck?
CodeSmith is apparently some kind of code generation utility. People make templates for it and crap -- shit I've never really cared about until some developer I was working with but not monitoring closely enough ("He's a big boy, what's the worst that could happen?") decided he was going to use a proprietary solution for our project's ORM stuff.
Specifically he used .netTiers, which is free, but since .netTiers can only be used via CodeSmith,
it is essentially proprietary.
I only discover this a month or two later when a million thousand bugs crop up because the developer has left but forgot to update the DAL / etc before he left. Yeah, that's totally my bad. Whatever, though, right? All I have to do is run the generation utility. I download .netTiers, find this CodeSmith thing and then realize it's a closed-source application we didn't have a license for.
Part of that is my bad -- he was jumping up and down going ".netTiers is the BEST!" and I was like, "whatever dude, just get it done." In retrospect, considering the damage he's done, if I could go back and change it all I'd start by throwing my car at him if I thought it would go the distance.
Anyway, CodeSmith has a 30 day trial -- no big deal, we only need to regenerate once for now, and we can migrate to a free solution later: the .netTiers crap is way too convoluted for a project this size anyway.
What happened next totally blew my mind.
OK, OK, wait, alright, first the program hung for about 5 minutes before spitting out a raw exception on what is easily the most base and obvious error you'd expect an application to catch, and display nicely, but the mind blowing happens right after.
BUT RIGHT AFTER THAT
The program's generation suddenly stops, politely informing me that my 30 day trial only works with sample databases.
Yes, you heard that right...
Someone went to all the effort and dedication to make an application run off a 30 day trial, but then restricted the 30 day trial to sample databases, so actually trying it out is impossible.
How. Useless. Is. That.
It took me a few minutes to figure out why they did this: essentially it appears that people use CodeSmith because the guy before them used CodeSmith and the guy before THAT guy used CodeSmith -- generational crap, basically. I've read stories about it and stuff but never walked face-first into it before until now.
For those of you slow on the draw, or not really sure of what I'm talking about:
Imagine downloading a game demo. After installing it, you eagerly double click the icon.
However, instead of being plunged into ZOMBIE SMASHING MAYHEM, the splash screen politely asks you to buy the full game if you're really interested in zombie fun, and then starts playing a low-resolution video of other people playing the game.
Yeah, it's that stupid.
Anyway, I just bucked up and spent 20 minutes tweaking the generated files by hand. We'll be ripping out all the .netTiers stuff and replacing it with SubSonic or w/e at some point in the future no doubt.
Thursday, October 11, 2007
My first public Rails site!
It's been awhile since I blogged about anything technical, so I thought I'd talk about a site I just prototyped.
It's a Rails-driven site. Top to bottom, its a pretty simple design, but I went through a lot (a LOT) of iterations before I found a design (front/back) that I found acceptable. Thankfully, Rails made this very easy. Ruby is as straight-forward as it can get, and so is the Rails framework. C#/ASP.NET feels a little wooden and artificial now, in comparison.
Speaking of C#/ASP.NET, I didn't really miss it when developing FearlessBlogging. I didn't have a moment where I thought "damn it, this would be easier in C#" or, "How come ASP.NET provides this but Rails doesn't?!"
Then again, the site I ended up deploying as pretty simple. I cut back on a lot of cool-sounding features that really weren't all that useful.
Oh, man, deployment was FUN.
Learning Capistrano before-hand was not. There seriously, seriously needs to be an updated Capistrano 2.0 tutorial for Rails.
I managed to hodge-podge it together from a bunch of incomplete Capistrano 2.0 blog posts and inferring some stuff from Capistrano 1.x, but still, was not the most pleasant of experiences.
After I got everything setup and stuff I could deploy the site with just a "cap deploy:cold" and it worked like a dream. I've updated the site several times since then and its always gone flawlessly. Using XP Pro, SP2, and no bugs reared up, so that was a relief.
Other than that, great experience: A++++, would work with again!
Yeah, I'm a dork.
It's a Rails-driven site. Top to bottom, its a pretty simple design, but I went through a lot (a LOT) of iterations before I found a design (front/back) that I found acceptable. Thankfully, Rails made this very easy. Ruby is as straight-forward as it can get, and so is the Rails framework. C#/ASP.NET feels a little wooden and artificial now, in comparison.
Speaking of C#/ASP.NET, I didn't really miss it when developing FearlessBlogging. I didn't have a moment where I thought "damn it, this would be easier in C#" or, "How come ASP.NET provides this but Rails doesn't?!"
Then again, the site I ended up deploying as pretty simple. I cut back on a lot of cool-sounding features that really weren't all that useful.
Oh, man, deployment was FUN.
Learning Capistrano before-hand was not. There seriously, seriously needs to be an updated Capistrano 2.0 tutorial for Rails.
I managed to hodge-podge it together from a bunch of incomplete Capistrano 2.0 blog posts and inferring some stuff from Capistrano 1.x, but still, was not the most pleasant of experiences.
After I got everything setup and stuff I could deploy the site with just a "cap deploy:cold" and it worked like a dream. I've updated the site several times since then and its always gone flawlessly. Using XP Pro, SP2, and no bugs reared up, so that was a relief.
Other than that, great experience: A++++, would work with again!
Yeah, I'm a dork.
Subscribe to:
Posts (Atom)