Posts tagged: ruby

65 posts

Ruby And Its Neighbors: Lisp

It's time for Lisp! Third in our series about langauges that influced Ruby. I've been a little nervous about approaching Lisp because, while I have actually done projects in Lisp, it's been a while. And I assume there's a whole cadre of Lisp-knowers waiting to jump on misstatements. Hi, Lisp-knowers! Let's talk about (lisp).

Ruby And Its Neighbors: Smalltalk

Smalltalk was the second major influence on Ruby's design. A different kind of influence, since almost nothing of Smalltalk's syntax made into Ruby. But many of the details of how objects work are directly inspired by Smalltalk, including the idea that every piece of data is part of the object system.

Ruby And Its Neighbors: Perl

I've been in kind of a writers block, for all kinds of reasons, personal and professional. I started to think about an article that I could write that would get my fingers typing. And I was thinking about how the answer to "where did this Ruby feature come from?" is often "Perl". And then I realized that Perl has vanished so completely that there's probably a large group of Ruby developers that don't know much about it.

Better Know A Ruby Thing: Method Lookup

## Notes and Corrections Before we get fully started here, a couple of notes on [Better Know Singleton Classes](https://noelrappin.com/blog/2025/01/better-know-a-ruby-thing-singleton-classes/), which, among other things, got mentioned on Hacker News, giving me comments there for the first time in years, maybe for the first time ever. One Hacker News comment suggested that...

Better Know A Ruby Thing: Singleton Classes

It is time to Better Know what is perhaps the Ruby-iest of Ruby things, a feature that didn't even have an official name for several years, despite being critical to Ruby's Object-Oriented semantics. (It only just now occurs to me that there was no official name _in English_, I wonder...

Object Constellations

[Last time](https://noelrappin.com/blog/2024/09/how-not-to-use-static-typing-in-ruby/), I talked about ways to use dynamic typing to manage objects and business logic in your code. Doing so involves leaning into the object system, going beyond just "one class for each noun" and creating objects to model different states within the business logic directly. In a basic...

How Not To Use Static Typing In Ruby

# How To Not Use Static Typing In Ruby [Last time](https://noelrappin.com/blog/2024/08/what-about-static-typing-in-ruby/), I took a short example and examined in some detail what you would gain by adding static typing to it and what it would cost to use static typing. What I didn't do was explain how I might handle...

What About Static Typing in Ruby?

I’ve tried writing this literally a half-dozen times. And it always feels like it slips out of control and gets too abstract to be useful. So, let’s start with something concrete. And we’re going to wind up splitting this into multiple parts. Probably two, but honestly, at this point who...

Better Know A Ruby Thing: On The Use of Private Methods

Last time around, we got to [Better Know access control in Ruby](https://noelrappin.com/blog/2024/05/better-know-access-control-part-1/), and I started to write my opinion on the use of private methods in Ruby, but my position/argument/rant had gotten out of hand and so I spun it off into its own post. This is that post. It’s...

Better Know A Ruby Thing: Methods and Access Control (part 1)

I’ll be honest, I picked this topic out of the half-dozen or so Better Know A Ruby Things on my to-do list strictly because it’s maybe the only Ruby take that I genuinely argue with people about. To be even more honest, it got away from me a bit as...

Better Know A Ruby Thing #5: Block Arguments

Previously in what what I guess is now “The Argument Trilogy”, we talked about: * [Positional Arguments](https://noelrappin.com/blog/2024/01/better-know-positional-arguments/) * [Keyword Arguments](https://noelrappin.com/blog/2024/02/better-know-keyword-arguments/) And now the trilogy now comes to its inevitable conclusion with ~~“Return of The Jedi”~~ block arguments. In the interest of keeping this thing within the plausible word count of...

Better Know A Ruby Thing #4: Keyword Arguments

Last time on Better Know A Ruby Thing, we covered positional arguments, and now we’re going to move on to keyword arguments. I really did think this was going to be shorter than the last one, and then I got to the conversion between keyword and positional arguments, and then......

Better Know A Ruby Thing #3: Positional Arguments

Ruby has three ways to pass information from a method call to a method definition: positional arguments, keyword arguments, and block arguments. Each of these ways has: * A syntax to declare an argument of that type in a method definition * A syntax to declare an argument of that...

The Pickaxe is out and I am Happy

I am extremely excited to say that _Programming Ruby 3.3_, also known as _The Pickaxe Book_, is now done done, finished, completely available as an ebook, and winding its way to distributors to ship to people as a genuine physical book. The PDF and ePub versions of the book are...

How To Manage Duplicate Test Setup, or Can I Interest You In Weird RSpec?

You have a series of test cases. They cover the same logic with different inputs. In order to get to that logic, there’s some overhead: objects have to be created first. Then there's more logic needed to evaluate the result. What's the best way to manage these tests? You want...

Better Know A Ruby Thing Bonus: Contestants and Nesting

Sorry for skipping a week or two -- I was approving copyedits on the book that is now called [_Programming Ruby 3.3_](https://pragprog.com/titles/ruby5/), because we now want to be proactive about the next release. Coincidentally, the copyedit review does relate to this newsletter. I noticed a particular code sample as I...

Better Know A Ruby Thing #2: Constants

A fun thing about learning Ruby is that sometimes concepts that have the same name as in other languages have different behavior and purpose in Ruby. Today: constants They aren't actually constant. They aren't only used for small strings or magic literals. They aren't even mostly used for that in...

Better Know A Ruby Thing #1: method_missing

Welcome to "Better Know A Ruby Thing". In each one of these, we're going to look at some feature of Ruby language, library, ecosystem, or culture and explain what it does, how it works, why it's there, and any thing else that comes to mind. First up, `method_missing`. If I...

Hi, All, It's a Pickaxe Q&A

I haven't sent out a newsletter in 2022 -- about 10% of people subscribed to this newsletter have never seen an actual newsletter in their mailbox. That seems like it should end, so... hi! I'm Noel. I write books, mostly about Ruby. I write this newsletter, which is normally about...

Redundancy, Terseness, and Code

Most human communication, text or written, is wordier and more redundant than it needs to be, strictly speaking. That previous sentence, for example, would still communicate its point in about a third of the words with “Most human communication is too wordy”. You’d likely still get the idea if I...

Another Refactoring Story: ActiveRecord Lists

I’ve now tried to write this post like three times, and one thing that’s clear to me again is why you don’t see more write-ups of even moderately complicated real-ish problems. It’s hard to get enough of the context across to make the code sensible without being overwhelming. But there’s...

More Ruby Magic

_Hey, if you like this post, you might like my recent books: "Modern Front-End Development for Rails" ([Ebook](https://pragprog.com/titles/nrclient/modern-front-end-development-for-rails/)) ([Amazon](https://amzn.to/37HzR27)) and "Modern CSS With Tailwind" ([Ebook](https://pragprog.com/titles/tailwind/modern-css-with-tailwind/)) ([Amazon](https://amzn.to/3xME2V5)). If you've read and enjoyed either book, I would greatly appreciate your help by giving a rating on Amazon. Thanks!_ When [last I talked...

Refactoring, Part Two: In Defense of Magic

_A quick program note: If you like this newsletter, you might like my recent books: "Modern Front-End Development for Rails" ([Ebook](https://pragprog.com/titles/nrclient/modern-front-end-development-for-rails/)) ([Amazon](https://amzn.to/37HzR27)) and "Modern CSS With Tailwind" ([Ebook](https://pragprog.com/titles/tailwind/modern-css-with-tailwind/)) ([Amazon](https://amzn.to/3xME2V5)). If you've already read and enjoyed either book, I would greatly appreciate your help by giving a rating on Amazon. Thanks!_...

Rails, Objects, Tests, and Other Useful Things

For the first time in quite a while, I’ve been able to spend time working on a brand-new Rails application that’s actually a business thing and not a side project. It’s small. Okay, it’s really small. But at least for the moment it’s mine, mine, mine. (What was that about...

May 9, 2012: The Random Link Post Returns

And now, the return of the semi-occasional link post. I’m going to try to do this at least once a week, but who knows. If you are writing JavaScript, you should be looking at [Justin Searls](https://twitter.com/#!/searlsware) and his JavaScript testing tools. Justin posted the slides for what looks like [a...

July 15, 2011: Stale Links

The problem with sitting on these daily link posts is that the links go out of date. Sigh. Here are some links. # Twitter I found a couple of things about [this InfoQ article about Twitter’s infrastructure](http://www.infoq.com/articles/twitter-java-use) odd. I was expecting it to be a bit more of a Rails...

Aug 30, 2010: Rails 3 has landed

### Top Story As you probably know, both Rails 3 and Bundler went final over the weekend. The Rails 3 release notes [are up](http://weblog.rubyonrails.org/2010/8/29/rails-3-0-it-s-done), as well as extensive coverage on the [Rails Guides page](http://guides.rubyonrails.org/). I'll also mention Jeremy McAnally's [Rails 3 Upgrade handbook](http://www.railsupgradehandbook.com/)http, and Gregg Pollack's list of [great Rails...

August 26, 2010: Some New Stuff

### Book Status RSpec chapter draft handed in to edit. It's going to need a better conclusion. A lot changed in this one, relative to the Lulu version -- this is probably the chapter most affected by my own personal experience since it's original version. ### Links Haven't done a...

August 11, 2010: An Abundance of Options

### Book Status Shoulda chapter fixes made. The next decision is whether to push that as a beta by itself, or wait until the RSpec chapter is also done. ### Also Today is the last day to get early bird pricing for [WindyCityRails](http://windycityrails.org/register/). ### Book Status I did not know...

July 30, 2010: I Always Thought It Was An Animal Native To The Rain Forest

### Book Status Beta 5 came out on Wednesday. Currently trying to figure out how to structure the Shoulda chapter in light of the direction that project has gone in since I wrote about it for the Lulu book. ### Friday Links One significant change in Rails 3 is that,...

July 21, 2010: This Code Belongs In A Museum

### Status Not much to tell, really. Spent some time getting RVM set up, since I think I'll need it to manage simultaneously building the Rails 2 and Rails 3. Now I have a working version of the startup appendix that uses Rails 3 and Devise. I can't speak to...

July 19, 2010: Building a Legacy

### And Now A Word The schedule for [WindyCityRails 2010](http://windycityrails.org/schedule/) just came out. WindyCityRails is Saturday, Sept, 11 at the Westin Chicago River North. I will be running the PM tutorial session on "Testing in a Legacy Environment". I am frequently asked how to start testing on a pre-existing code...

July 15, 2010: An Apple Comment A Day

### Book status Still writing the legacy chapter. Totally coincidentally, Michael Feathers, author of [Working Effectively With Legacy Code](http://www.amazon.com/gp/product/0131177052?ie=UTF8&tag=10prinhell-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0131177052), just wrote on an issue similar to what I'm dealing with right now: [The Bad Code Kata](http://michaelfeathers.typepad.com/michael_feathers_blog/2010/07/the-bad-code-kata.html). I imagine Feathers had a similar problem when writing his book about legacy code....

July 14 2010: The Smallest Thing

### Book Status Still working on the legacy chapter. The sidebar here is that deliberately writing bad legacy code for purposes of using as examples in a book is a little challenging. It's got to be tangled enough to make the point that it's hard to clean, but small and...

July 13, 2010: I Guess It Isn't A Dynabook Yet

### Status Back to link posts today. The [book](http://www.pragprog.com/titles/nrtest/rails-test-prescriptions) is still lurching forward on the legacy chapter. Thanks to those couple of you that asked questions on [the forum](http://forums.pragprog.com/forums/140) and made it look a little less lonely over there. ### Quick Review Quick iPhone 4 impressions, but understand that I...

July 1, 2010: Screencasts and Road Maps

A lot fewer links today. Yesterday, by the way, the most clicked on link was the "Don't do this" like to the method\_missing nil post. ### Book Status Handed another draft of the Rcov and Style/Test Quality chapters in. Expecting that to be the next beta next week, but we'll...

June 30, 2010: The Triumphant Return of the Monster Link Post

### The end of the repair story At the end, a very positive experience with Apple support. The repair was free, done when they said it would be done, and all told, I spent less than fifteen minutes in the store between both halves of the visit. Plus, they replaced...

June 18, 2010: Links Ahoy

I think a link post today... ### Book Status Still working on the style section, for some reason it's going grindingly slow. The plan for beta 4 is the new style chapter, probably the legacy coding chapter. Also on the slate is updating the sample app to use Devise, which...

June 8, 2010: iPhone, iPhone, it's off to work iPhone

### Okay, There's a New iPhone Don't really have a whole lot to say beyond what's already been said. It looks very slick, and if anybody can actually pull off getting people to use video chat, it's Apple. The form factor of video chat from a phone seems at first...

June 4 2010: Okay, here's a link post

Quick links post: Gregory Brown is looking for comments and donations for a [proposal for a Ruby Mendicant University](http://blog.rubybestpractices.com/posts/gregory/025-ruby-mendicant-university.html), basically a rolling online Ruby course. Charles Nutter is interviewed by InfoQ on [the state of JRuby](http://www.infoq.com/articles/state-of-jruby). Yehuda Katz has a long post on [various kinds of extensions in Rails 3](http://www.railsdispatch.com/posts/how-rails-3-enables-more-choices-part-1)...

May 28, 2010: Friday Friday Friday

Short today, but preparing some longer, more rant-y bits for the future... ### Book status Not much forward motion for the next few days, as I have a lot of other stuff to do, including preparing for [Chicago Ruby on June 1](http://www.meetup.com/ChicagoRuby/calendar/12674321/) and doing a bit of touch-up on [Obtiva's...

May 27, 2010: Random stuff today

I think we're going to be even more random then usual today. Here goes: If you downloaded the epub version of [Rails Test Prescriptins beta 3](http://www.pragprog.com/titles/nrtest), then you may have noticed that the promised Cucumber chapter isn't there. The PDF is fine, and I have no idea about the mobi...

May 25, 2010: Betas

### Top Story Beta 3 should be [out today](http://pragprog.com/titles/nrtest/rails-test-prescriptions). The main change in this Beta is the inclusion of the Cucumber chapter, which has been updated both in terms of new tech, and also in terms of conclusions about how to use Cucumber. ### And In Rails news... When last...

May 24, 2010: Martin Gardner

### Top Story [Rails 2.3.6 released](http://weblog.rubyonrails.org/2010/5/23/ruby-on-rails-2-3-6-released), with more changes than I expected, taking it just a little bit beyond a bug-fix release. Follow the link for the full release notes. Things that caught my eye: - Looks like they made an official plugin to give Rails 2.3.6 the default HTML...

May 20, 2010: Fontastic

### Book Status Starting to sound repetitive. Still working on the Cuke chapter, this time focusing on cleaning up the parts where I recommend ways to use Cucumber. Still hoping for a beta early next week. ### Other things This week in Yehuda, there's a very long article about text...

May 6, 2010: The day of promoting stuff

### Top Story I'll mention somebody else's book, but don't worry, I plan on doing it in a totally self-absorbed kind of way. Pragmatic released [Using JRuby](http://pragprog.com/titles/jruby/using-jruby) into beta yesterday, by the core JRuby team. Looks good, interested to see where they go with it. Because I'm me, I can't...

April 23, 2010: Still Alive

### Top Story If you think the top story is going to be anything other than the continued launch of [Rails Test Prescriptions](http://www.pragprog.com/titles/nrtest/rails-test-prescriptions), well, you probably don't know me very well. I may not be a marketing genius, but I do know the value of repetition. I mean, if there's...

April 19, 2010: The Week Begins

### Top Story/Book Status This is the week -- Rails Test Prescriptions should go on beta sale on Wednesday. In a related story, railsrx.com now points to here, railsprescriptions.com also will shortly. I'll be adding some basic about information and static pages here. At some point, I'll probably bring over...

April 15, 2010: The Library of Congress Recommends the Following Tweets

### Top Story As part of the Chirp conference, Twitter and the Library of Congress jointly [announced](http://blogs.loc.gov/loc/2010/04/how-tweet-it-is-library-acquires-entire-twitter-archive/) that the Library will be storing Twitter's entire public archive. I'm sure your expecting an easy joke about how many sandwiches the LoC now knows about in their archive, or about how scholarly...

April 13, 2010: iAd, youAd, weAll Ad

### Top Story iPads. Lots of them popping up in and around work. Probably some more coherent impressions coming later. Wait, once again, Twitter has a big announcement after I start writing this. This time, they are going to start placing ads in the Twitter stream in various ways to...

Notes and Notes

A couple of recent life, the universe, and everything notes: - I realize I've been away from here for most of the last couple of weeks -- a side project has been eating up a lot of time. I should be done with in next week, and back to posting...

My Favorite Monkeys

New post at Pathfinder [on monkey patching](http://blogs.pathf.com/agileajax/2008/03/my-favorite-mon.html).

Shipping!?

Amazon is now saying that _Professional Ruby On Rails_ is in stock! I haven't seen my copies yet, and I suspect Amazon purchases will actually go out next week, but it's a real page and everything. The link to purchase is [right here](http://www.amazon.com/gp/product/047022388X?ie=UTF8&tag=10prinhell-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=047022388X). I've also added a [running list of...

Hey, Free Book Samples!

As I've mentioned here a few times, I have a book coming out, "Professional Ruby on Rails", available later this month. If you'd like a sneak peek, Wrox has put some samples online as PDF files. You can also just [buy the book](http://www.amazon.com/gp/product/047022388X?ie=UTF8&tag=10prinhell-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=047022388X). - [Chapter 1](http://media.wiley.com/product_data/excerpt/8X/04702238/047022388X.pdf) -- This sets up...

Professional Rails Online?

In response to the commenter who asked if there was going to be a beta book. UPDATE: Clearly I should ask about these things before I post. Jim Minatel from Wrox added the following in comments: - There will be a PDF about six weeks after the print book, meaning...

Things I Learned

Some things I learned about Rails and writing while working on this book: - The great benefit of working on a project like this book is that it enabled me to compress about two years worth of research into Ruby and Rails tools into six months. In my case, this...

Two Pathfinder Blog Posts

Two things on the Pathfinder blog. - [Agile Publishing](http://blogs.pathf.com/agileajax/2007/11/agile-publishin.html), on publishing experiences and agile methods. - [Live Ruby: Testbed](http://blogs.pathf.com/agileajax/2007/11/live-ruby-testb.html), an attempt to work through a small test and metaprogramming problem live and on the blog. Enjoy.s

Pro Rails Book Related Things

A few things I forgot to put in the last book update: - The Amazon listing has the book at 600 pages. That's almost certainly optimistic. The contract calls for 400-500. - As far as the schedule goes, I'm currently hoping to turn the complete draft in on October 26th,...

The Rails Edge

I was fortunate enough to attend Pragmatic's Rails Edge mini-conference here in Chicago last week. I have two blog posts up on this at Pathfinder, [the first is made up of quotes from my notebook](http://blogs.pathf.com/agileajax/2007/08/the-rails-edge-.html), and [the second is some general thoughts](http://blogs.pathf.com/agileajax/2007/08/the-rails-edg-1.html). Enjoy.

And Now, A Special Announcement

Sorry for the radio silence for the last week or so, but I was waiting to be able to announce this: Today I started a new job at [Pathfinder Associates](http://www.pathf.com), as a senior software engineer in charge of Ruby on Rails projects. Needless to say, I'm thrilled to be back...

Didn't I Say I Wouldn't Compare Languages?

I posted a version of this to [JJ Behrens' Blog post about Ruby](http://jjinux.blogspot.com/2007/06/ruby-python-programmers-perspective.html), and decided it was probably worth also posting here. I use and like both Ruby and Python, here's why... #### Things I like about Ruby with respect to Python 1. I think Ruby is the only language...

from internet import *

Three posts that caught my eye today. #### Ruby School Gregory Brown over on O'Reilly net [has an article about using Ruby in Computer Science courses](http://www.oreillynet.com/ruby/blog/2007/05/ruby_academically_viable.html), at least in later algorithm classes. It's not a bad argument, but I think it'd be more convincing if the Ruby example was a...

Posting to Blogger via Ruby

TextMate has what seems to be a very nice blogging bundle for programmatically sending posts to your blogging engine of choice. Except that it doesn't work for the new Blogger API. Or at least it didn't the last time I checked. Mostly I just wanted to see if I could...

Rubies in My Coffee

Now two of the big Java IDE's are promoting Ruby language tools as a big thing. IntelliJ has a plugin in early beta, and NetBeans is also making a big deal of their new early beta support. Eclipse has had a Ruby/Rails plugin for about a year or so. This...

Languages I Use

Continuing in the getting to know you kind of vein, I thought I'd ground some of what I say by talking about the three programming languages that have made up the bulk of my professional and hobby work for the past five years or so -- Java, Python, and Ruby....
All Posts

Subscribe to the Dynamic Rubyist Newsletter

Subscribe to the blog via RSS

RSS Feed