Latest Articles

How Big Should My Gem Be? One Idea Big.

A large sapphire

If you’ve never built a Ruby gem, go do that first. It’s amazingly easy. And it lets other people use your stuff!

When you do you’ll have to figure out – how much goes into one gem? What should you cut up into new gems?

Here’s how you tell.

What’s the Big Idea?

You want your gem to have one...

Second Time Clean

Isn’t it wonderful when you get to go in and clean things up? The best, for me, is when I’ve learned a lot in a year or two and I get to re-do an old crufty program or a badly-designed page with what I’ve improved at.

For me, lately that’s stuff with Bootstrap and Rickshaw. I’ve also been replacing...

Installing Avdi's Quarto

I’m trying out Avdi Grimm’s Quarto, a system for turning Markdown files into books in PDF, ePub and Mobi format. It’s an awesome idea, and Avdi’s books always look great.

Of course, Quarto has kind of an intimidating “install me first” list. Here’s what I needed to do:

  • I got to skip installing...

Your Mind is a Motorcycle

When I was taking the Motorcycle Safety Foundation class awhile back (it’s awesome!) they said something that stuck with me.

“None of you are good enough to hit your motorcycle’s limits, even with these little bikes. You’ll have to ride for years before you’re hitting the bike’s limits instead of...

You and Britney Spears == BFFs?

Here’s the thing: if you want to meet Britney Spears, odds are good that Britney Spears doesn’t want to meet you.

If you’re Lady Gaga, then Britney Spears probably does want to meet you.

But if you say, “hey, I’m Lady Gaga!” and you’re not, that doesn’t work.

You have to go be Lady Gaga, out where...

What Hooks does Ruby have for Metaprogramming?

Ruby lets you hook in and see (and change!) a lot of behavior of the core language. Methods, constants, classes, variables… Ruby lets you query them all, and change a lot about them.

These are just hooks – things Ruby calls in response to something happening. That’s different from, say, all the methods you can call to find our what’s defined and how – like instance variables, or method bindings, or…

Here’s summaries and links for all the hooks I could find (thanks to Google and StackOverflow!):

Does Ruby Have a Metaobject Protocol?

There’s a semi-famous book, The Art of the Metaobject Protocol by Kiczales, des Rivieres and Bobrow. Alan Kay, the guy who invented SmallTalk and the phrase “Object Oriented”, called it the best book in ten years.

But it’s takes some describing.

What is a Metaobject Protocol?

You know how Ruby has a class called “Class”? And how all classes are instances of it? And how Class is a subclass of Module?

The Metaobject protocol asks, “what if there were more subclasses of Class? And you could make classes from them, instead of plain old Class?”

Also, it includes what we’d now call introspection functions – they didn’t usually call it that twenty years ago when this was published.

But what, specifically, does that mean?

Why Ruby Should Stay a Laughing Stock

Five minutes on the Internet will find you somebody who thinks Ruby shouldn’t exist and is clearly inferior (try it!). Or pick a big tech company, especially an “Enterprise” company. Same thing – you’ll find a Ruby-hater in five minutes if you’re actually trying.

If Rubyists keep doing the right thing, this will be true forever. Let me explain.

What Ruby Rocks At

There’s a set of things Ruby is really good at. I’ll list some of them:

  • Prototyping new ideas
  • Anything web or HTTP
  • Stuff that doesn’t need to be fast
  • Reading other people’s code - Ruby is short and readable.
  • Building tools and libraries, especially DSLs.

There are some other things Ruby is “good” at. Like, it’s good at them but many people think they’re a bad idea. I’ll list some of those, too:

On Hiring a Developer

I got mail from somebody with a vision for an app, wanting to know how much it would cost to build their idea.

This is my advice to him, with a few specifics redacted:

Subscribe to get free ebook chapters and an emailed coding class now, plus videos and articles a few times a month.

Why this specific newsletter? You want to be an expert. Expertise comes from learning the fundamentals, deeply. And that comes from the best kind of practice. I write with that in mind. I won't waste your time.

(Yes, I also sell things. They're good, but I'm fine if you don't buy them.)