Notes on Language Enhancement

You will have noticed by now that no new classes were defined in our unjumbler project. So you might be asking, “Is this object-oriented programming or not?” Well, yes and no. Not all jobs require new classes, and the String and Array classes take care of enough of the basic work here that the logic sitting above them can be procedural. There's no pressing need for us to create, say, an UnscramblableString class. You need not fear the OO police. It is your inalienable right to use existing language tools without creating new ones.

However, whenever you come up with a cool idea that might be applicable down the road, it's worth asking yourself —asking, mind you—whether it would make sense to build that new capability ...

Get Sams Teach Yourself Ruby in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.