Rails Documentation

Is the worst fucking thing on the planet. I’ve actually googled for stuff, clicked on it, and gone to redirecting cybersquatter pages, it’s so goddamned bad. Maybe I’m spoiled. The bulk of the professional development I’ve done has been with PHP, though I was pretty heavy into Perl, Tcl and other such languages at their time. Compared to any of them, Rails documentation is, hands down, the absolute worst.

Half the time I feel like they’re being too goddamned clever for their own good. But the ‘sensible defaults’ that they espouse aren’t documented anywhere, so how the hell am I supposed to know what they are? What seems sensible to me might not be sensible to you. I’ve found myself drilling down into source code more times than I’d like to count to try and figure out what’s going on. That is total and complete fail. It’s lucky that it’s so powerful and cool regardless, or I would’ve left it in the dust a million years ago.

Maybe I have to be more…loquacious in PHP. That’s fine. At least I know what to do and how to do it. 70-80% of the time I’m working in Rails, I have no friggin clue how to tell it how I want to do something. Then when I find out, it’s always something like – type two magic words into the right file, then Rails reads your mind. Awesome. I just hate that sickening feeling during that not-20-to-30 percent of the time. I feel helpless.

Then when you do find documentation, it’s all stories. “So here’s what active record aims to do, here’s different ways you can make it do things, blah blah blah.” I like my programming docs terse. I look it up, it tells me what that does. But the documentation, especially, just seems all jumbled together and awful. Or the other thing I’ll find is the opposite granularity – “Class Foo::Helper::Doodad::fwipple::dingus has methods ‘get’,’put’,’set’,’be’,’execute’. The source code to method ‘execute’ is: …….” That doesn’t help either. That’s why it’s called DOCUMENTATION. Not fucking SOURCE CODE. I feel like it’s some kind of ‘hipster’ framework – if they actually explained it to you, and regular unhip people “got it”, then the hip people would all switch to using Scala.

And, embarassingly enough, I only just ‘got’ the yield command in Ruby. That’s just sad, man. Though I don’t see the difference between a yield and an anonymous function, but I guess I’m just not that bright.

I assume it’s one of those things where as soon as you buy into it 100%, completely, and spend time just soaking in it, then you’ll fully understand. But I don’t like having to commit to that level of buy-in. I’ll continue to fiddle with it, and even choose it as a framework in whichever contexts it seems right for, but I’ll always look slightly askance at it – perhaps until I’ve been so steeped in it that I can’t look at it objectively anymore. But until then, fix your fucking docs Rails, it’s horrible.

Recent Acquisitions

1)
First off, my MacBook Air was not really mine. It was my prior company’s. That, plus the various thermal issues it had were getting to be too much for me. It’s performance was…well, a little laggy, and it had no hard drive space. That’s a whole bunch of bullshit I used to justify my company buying me a new MacBook Pro – I convinced the president to get it for me. Since said person is also me, that was not too hard.

And going from MBA to MBP – wow. The weight difference is enormous. This new bad boy is heavy. And the performance differences are pretty striking too (so much faster); but I think a lot of that is just the graphics card. I can’t really max out the CPU’s now, by doing anything ‘conventional’. The bigger display ‘feels’ more subjectively comfortable – more spacious, not so cramped. And not having to worry about hard drive storage for a while will be nice too. I can feel it getting pretty warm on my knees right now, as it’s been busy installing lots of stuff. Gonna have to be careful; don’t want to fry the Boys. edit – I think this is Spotlight doing indexing shit. ‘mds’ seems very busy. Perhaps it’s running across all the various files I’ve been installing. I wanted to get the RAM boosted to 4GB, which I think I will still do, but we’ll have to wait until it shows up at the Shop.

And thanks to everyone who staged a near-intervention to prevent me from getting a 17-inch MacBook Pro. I tend to pretty much go whichever way I’ve decided to go regardless of what anyone says; but when, like, 5 people all tell you “don’t do that, it’s stupid” even I have a hard time ignoring that advice. I got the 15, as advised, and am quite happy with it.

2)
My iPhone’s battery life has gotten to the point now where I can yank it from the cradle around 8am or so, and by 6pm it’s run out of juice. That, plus not being able to power it down (stuck power button) meant that it was starting to be that time. 3G time. I tried as long as I could to avoid it – this will cost me another $10/mo, and I’m already miffed at having to pay so much and use so little. And I assume something new and wonderful and such will come out next June to make me feel stupid for having gotten this one. But I could wait no longer. Another conversation with The Big Cheese (still me) and my company got me an iPhone 3G. Now, I can’t say if this is my imagination or not…but it feels faster in operation – like, clicking stuff and so on. And, Apple – dudes – it is *not* cool to move my application icons around on restore. Put them back. I have like 6 or 7 pages of applications, and I’ve moved the icons around ‘just so’ in a way that is convenient for me. Moving them makes me unable to use my phone, for the most part. And the whole backup/restore process felt really…creaky to me. I didn’t feel comfortable and happy that all my data was going to get from old phone to new. I was actually surprised when it seemed to have. Of course, I have to reinit the prefs in a lot of my apps – but not all. And that’s at least something.

3)
Rails on OS X. Don’t use the built-in Ruby (/usr/bin/ruby). Don’t go and install ports and use their ruby either (/opt/local/bin/port, /opt/local/bin/ruby). Go and get Ruby Enterprise Edition, install that, and then tell it to install mod_rails with /opt/ruby-enterprise-1.8.6-20080810/bin/gem install passenger . You can hook that into the built-in copy of apache, and it will work really well and use 33% less memory (or so ‘they’ claim…), and fork little worker thread thingees at will, and so on. I’m using it on my personal server and I find it to be pretty great – where I used to manually have to watch little mongrel thingees run and die and then go and restart them. And I have to watch memory usage balloon out for whatever the worst-case scenario is on how many requests will run. And I don’t have to put in funny Apache configs to proxy or tunnel or some other crap I don’t remember. I used the setting on my server months ago, so I don’t remember the awfulness of it, but I remember the sense of relief when I made the switch. Those Passenger dudes keep good care of their little fork of Ruby and their passenger package. It is good. If you get annoyed with those stupid long paths, symlink them to something more acceptable. Also if you want to get rid of it I think you just fling that one silly directory and you’re good to go.

Dive into Mark. Ruby on Rails.

I enjoy reading Dive into Mark. It’s a good blog.

Sometimes I agree with him. Sometimes I agree wit him, but disagree with how he says something. And sometimes, not only do I disagree with something he’s said but I disagree with how he’s said it.

This is one of the latter times.

The level of ad Hominem attacks in the article is off the scale.

Let me distill it down for you. Ruby focuses on ease of development. It does not focus on performance. They’re talking about a site there that has gotten itself to 11,000 requests per second. That’s a lot. That’s a fucking lot. And if you have that, you’re going to be doing some tuning and tweaking and who knows what. I know this from experience. But some dipshit started whining that it was Rails’ fault. Well, maybe it is, maybe it isn’t. I don’t think there’s any kind of web development framework that exists today that you can scale up to that level and not notice some kind of performance degradation. Hell, even if it’s in your own code. I have scaled applications up factors of a hundred times on some of the highest-performing web application servers in existence, and hell yes it strained my database, and hell yes I had to optimize stuff all over the place.

These web-dev guys wouldn’t even have a site were it not for Rails – they’d still be pounding on whatever other language they were working in. Then they certainly wouldn’t have these scaling problems, because they wouldn’t fucking exist! The developer doing the whining isn’t actually whining that hard – he’s talking about what is going on with him, and DHH, if he were smarter, would’ve shut the fuck up. But he didn’t. I mean, seriously, you’re the largest fucking Rails site on the web, and you have scaling problems? OF FUCKING COURSE!!! You’re the largest $BLAH site on the web, you do anything performey, and you will probably be dealing with performance issues. For any value of $BLAH.

It’s all so stupid. Webdude guy answered questions he was asked, DHH stupidly did some kind of counter-spin, and Mark, even more stupidly, is doing counter-counter spin because he’s a Python weenie.

You’re all morons. Die.

Thank you, and have a nice day.