
Earlier in the year, I found myself in the middle of a great tragedy: the harddrive in my aging 12” powerbook decided it was time to say farewell. Now, I’m not certain, but I’m going to assume the main reason it left us, was to be with the superdrive which had also passed away about 8 months prior.
Clearly the only way to survive this whole affair was to sever all ties to the powerbook, and rebound with a new laptop. Clearly.
Since my primary development environment is VisualStudio.NET, I’d pretty much decided that my next computer would probably be a windows… Unfortunately, once I started shopping around, none of them met my small list of requirements:
It seems that if you’re looking for a laptop from HP/Dell/IBM, you can’t get these things. Hardly any PC laptops have DVI out, and the ones that do tend to be those 17” beasts.
And then there’s the new Intel-based Macbooks. Core2Duo, DVI out, 13” widescreen… but could I really run VisualStudio.NET in parallels? I figured “what the hell”, and plopped down the money to see if it would work. One great thing about Apple machines is their high resale value. I figured, if I hated it, I could craigslist the damned thing, and get back most of the money.
So I ordered one of sexy black ones, with 2GB of RAM and a 160GB disk. It’s been a month now, and it’s going “OK”. The macbook is a lovely machine, but everything you read about fingerprints on the black are no exaggeration—the goddamned thing is a grease magnet. I’ve been using a microfiber polishing cloth to clean it, and I’m to the point of having to do it daily (damned OCD).

VisualStudio in parallels is also “just OK”. I’ve run into a number of weird issues with the Parallels Windows XP installer, where it appears to set permissions on the disk weirdly, and VS just can’t seem to cope with it.
I've also had a number of issues regarding disk corruption with the parallels disk image (not bootcamp)… maybe this is related to the above problem.
Parallels doesn’t like to sleep. If i just close the macbook while parallels is running, there's a 75% chance that the mac book won't make it into sleep mode, and also won't seem to wake back up. If I suspend Parallels before sleeping, it seems like there’s about a 40% chance that Windows will bluescreen on resume. I’ve finally learned to just shut Windows down all the time now, which is kind of a bummer.
Parallels is also just not as fast as I want it to be. When checking out the main Presto solution, there’s a number of web applications, web services, an instance of SQL Server, some device simulators, etc. that all need to be running. It’s do-able, but it feels like it’s running at the speed of my old 1.4Ghz windows desktop. Not awful, but after having everything in the Mac OS X go so fast, it’s a bit of a let down.
I’m finding that my natural work habits now are to run only VS in parallels, and run everything else (Mail, IM, browsers) in the mac OS… which I reckon is fine, though it's not quite what I expected.
Well… So, it looks like I bought into the hype. I’ve now completed rewriting this weblog from C#/ASPNET to Ruby on Rails.
It’s kinda funny, I guess, that I spend time writing, (and rewriting, and rewriting, and rewriting) this weblog when I never actually write in the damn thing. So it goes.
I reckon it’s become an interesting project for me these days, and a good practical exercise when working with a new language or a new environment. And, since I’ve written the damn thing at least half a dozen times now, I’ve learned a lot about what it means to build an effective administration UI, what it means to keep the data in the DB portable (because I assure you that in a couple of months I’ll be looking at rewriting this in smalltalk, python, or lisp), and how helpful it is to fully separate your logic from your presentation.
Anyway… back to the subject at hand: some of my perspective as a C#/ASPNET developer on Ruby on Rails, and how porting this blog to ROR went. There’s a number of things about ROR that I really like, so let’s let the glass be half-full, and start there.
Now, after all that praise, let’s talk about what doesn’t work well from my perspective…
All in all, it's been an interesting experiment. I’m not sure I’d ever choose ROR for a “real” development project (I still have lots of questions about fcgi, and some of the more “backendy” things that rails does) but for building internal tools, or (like this case) a simple blog, it seems pretty slick.
I imagine I’ll tinker on modifying this weblog app a bit more, and then try and rebuild one other side projects in rails—an online photo album
One of the things I've been toying with as of late is moving the distinctPixel.com hosting from their (*ahem* bloody expensive *ahem*) dedicated Windows 2000 server(s) to a more budget level unix hosting solution. $300/mo vs. $9/mo is an amazing difference—and one that I just can't quite seem to overlook. Of course, the big hurdle in doing this is that I completely lose the ability to run ASPNET, ColdFusion, and MSSQL Server 2000… the three platforms that I've always written to.
"But Barclay!", you cry, "You're forgetting about PHP, MySQL (it's got stored procedures now) and RubyOnRails! And hell, all the cool web 2.0 kids are using ROR!"
Alright… Alright. I'll take a sip of your koolade.
So, I took the plunge. I installed PHP5, MySQL5, and ROR 1.2 on my aging 12" powerbook.
First, let's start by talking about the distinctPixel.com site. It is is extremely simple: mainly an exercise in templating, with a small amount of DB access (the news section on the home page—which is 4 years old, and the portfolio section), then a little disk access and session handling (for client downloads) and reading and writing a signed cookie (when you're logged in). Not rocket science.
So, I decided to rewrite it in PHP and MySQL.
First thing out of the gate: The interaction with the MySQL class was so fucking ridiculous that I ended up writing a wrapper object to make MySQL operations a little cleaner and more object oriented (not to mention readable). Of course, once I finished writing this, I stumbled up a whole separate MySQL Improved class… what the fuck? This was starting off on a bad way.
So, I did what any good little developer would do, and I went to the documentation. Now, perhaps comparing PHP's documentation to C# is unfair. Microsoft has a gizillion dollars, and can pay lots and lots of professional techwriters to come in and do really solid docs. PHP's documentation, however, seems downright amateur. Often times the threads at the bottom become exercises in pissing contests. I actually found myself using google rather than their docs, where I would find the answer that I was looking for squirreled away in someone's blog.
The rest of my implementation went about the same way. And don't even get me started on session handling in PHP. Seriously. It's fucking retarded.
It feels like they've (Zend, the PHP contributors, or whomever) crammed so much into PHP that they've forgotten to make sure the platform makes sense. It has support for sockets, but the XML parsing is ridiculously lame. How does that work?
Someone needs to come in with a pretty sharp knife, and take a serious look at what needs to be depreciated, and then just start cutting old shit out. Short tag syntax (= >) shouldn't be an option, it should just be. Make A MySQL class, and kill both the old lame one AND the MySQLi class. Yes, it's gonna break people's form applications, but so it goes. Cruft is nobody's friend.
They should also seriously take a look at all of those string methods, and their terrible naming conventions. A bunch of them are str_foo() while the rest are strfoo(). Come on, guys… this screams rookie!
Anyway. Enough of my bitching. It's written… it's done… And it's unlikely that I'd ever choose PHP as a platform again.
I'll attempt in the next week or two to start porting this site (distinctPixel.org) in ROR, and will let you know how that goes…

So I’ve been tinkering for the last couple of days with adding a commenting feature to this blog. One of the things that I’m really starting to notice with rails (and perhaps this is terribly obvious) is that while a lot of stuff is really great, you sure do pay for convenience.
Having gone through the Agile Web Development with Rails book as an intro to rails, I had been working based on some of the patterns discussed there. It’s quite possible that I’m the idiot in this situation, but all the same, it’s a bit frustrating. For example in building comments, there are comments, which belong to entries. There’s also a commenter, which belongs to each comment—a simple enough set of relationships.
However as I’m building this, it appears that rails is going SQL crazy. First, it’s making the initial SELECT query to get the entry… that’s fine. And then another query to get the comments for that entry… also fine. But after that, rails decides to make an additional SELECT * query for each comment’s commenter (that's a mouthful).
I sure would have hoped that by using the has_many and belongs_to statements in the models, rails would have been smart enough to have seen this should be a join. Being the rails newbie that I am, I don’t seem to see any real way of making rails do that (outside of writing my own SQL—which isn’t not writing the point of using rails?).
I’ve finally decided to wrap a little of my own logic around it and specifically work with the commenter_id field in the comments table to avoid the extra SELECT statements which (frankly) seems like a bit of a hack.
Let me say flat out: I am no DBA or rails guru. So, maybe none of this really matters since the queries are small (I’ve always played by the rule of thumb to make your DB queries as efficient as possible, and count for as much as possible)…
Maybe the answer is that you can solve all of this by caching, so don’t worry about what kind of SQL rails is using…
And, then again, maybe I’m the idiot who’s missing something really obvious.
Here's something I’ll admit to very few people: I rarely use Photoshop anymore. No, really, it’s true—I’m a professional designer and I hardly use it at all.
Back in 1997, I was invited to Macromedia’s headquarters over on Townsend got to participate in a beta for a new program they were launching called “Fireworks”. The premise was pretty amazing: they were building an image editing program based on the failed Xres that had editable type and vector graphics, specifically for web design.

I still remember, watching the demo thinking: “Oh my god! It has editable text and drop shadows!” I was stunned—just completely blown away.
Now, by todays standards, this is hardly a big deal. But in 1997, (begin old, codgerly voice) we had Photoshop 4, and there was no editable text. Creating a drop shadow meant duplicating the layer, filling it with black, running the gaussian blur filter on it, and offsetting it by hand. Need to fix a typo? You're re-generating the whole text layer… and the drop shadow.
Fireworks made so many of these little things so much faster and easier for building comps. And, at the same time, it's image compression rivaled that of the omnipresent Debabblizer. This meant you could layout your art, quickly edit text and filters during iteration, and then slice it and compress the final assets, all in the same application. It was an amazing time saver.
Starting with one of the early beta versions, I started using Fireworks, and never looked back. It’s been one of the main tools in my chest for over a decade now, and I've turned many other designers on to it's magnificence. Adobe has since bought Macromedia, and last year’s version of Adobe Fireworks CS3 was just OK. Many of the new “features” were crap, (no, please don't generate Javascript or CSS for me, thanks), but I guess it was nice to have an intel-native application for my macbook (it sure didn't seem any faster).
I finally upgraded to Fireworks CS4 this weekend. Once again, there was no good reason to do so feature-wise (no, please don't generate “better” CSS for me, thanks) but I thought I'd give the heavily criticized new Adobe UI a go.
What in the fuck happened here?
This has got to be one of the buggiest applications I've ever—in my entire history of computing—used. How did Adobe, who's QA is usually pretty solid, let this ship? In the 2 days I've been using it, CS4 has crashed dozens of times.
One of the more common crashers I've found is: draw a box, changed the fill to a gradient, and boom, there she goes. A box with a gradient. Seriously.
There are a number of bugs in the “symbols” implementation—something I rely on heavily—where breaking symbols no longer works, resizing symbols can corrupt and lose data in the symbol, and occasionally, things inside symbols move around all on their own. This is bad.
There are bugs with elements forgetting their filter effects: i.e. put a drop shadow on an object, move to a different frame and back, said shadow's properties changed.
And then there's the new type engine.

They’ve apparently replaced the old Macromedia based engine with Adobe code. Unfortunately it’s completely broken. Fonts change their rending on redraw. Type boxes move around without doing anything. And, like you can see above, type displays outside of the type box. This is one of those things that I saw within 10 minutes of using CS4, and judging by the bugs filed with Adobe, I'm not alone.
After a couple of days, I've gone back to Fireworks 8 (which is after MX 2004, and before CS3, if you're keeping track—gotta love those naming conventions), as it seems to be the fastest and most stable version to me.
There’s an open letter from another Fireworks user to Adobe bemoaning the death of one of our most valuable tools, but frankly, I think this is it for Fireworks. Adobe has made a statement here: they're clearly not willing to invest the time or expense into developing or maintaining it any longer.
Like a carpenter with a favorite hammer, I feel an almost emotional bond with Fireworks. I'll likely hang on to version 8 for as long as it will run on my computer… and when it finally does die, it will be heartbreaking.