Category ArchiveLanguage



History &Language &Philosophy &Politics &Programming Languages &Science &Software 02 Jan 2008 08:23 pm

Reading List that Inspired Smalltalk

Squeakland has a list put together by Alan Kay for his students that gives background on the ideas behind Smalltalk.

It looks like quite an interesting list.

Humor &Language 11 Dec 2007 08:40 pm

Fun With Words > The Wordplay Web Site

I found what seems like a quite amusing site: Fun With Words > The Wordplay Web Site. I haven’t looked fully into it yet, but I found it searching for a gift, a book on Spoonerisms, Stoopnagle’s Tale is Twisted.

While the site seems to have a lot of things, a review of the book is in order so you know what I mean. That, and because it is amusing.

Remember the story of Prinderella and the Since? It begins “Here is a story that will make your cresh fleep. It will give you poose gimples. Think of a poor little glip of a sirl, prery vitty, who, because she had two sisty uglers, had to flop the more and do all the other chasty nores, while her soamly histers went to a drancy-bess fall. Wasn’t that a shirty dame?”.

This book contains 43 of Colonel Stoopnagle’s fantastic spoonerism tales, including Beeping Sleauty, The Pea Little Thrigs, and The Woy Who Cried: “Boolf!”.

Reichard Lederer said “With whiz and witdom, Keen James entertainingly presents the tips of the slung and thud and blunder in our tough and rumble language. After reading these English terrors and tinglish errors, you’ll finish the book optimistically and misty optically.”

Language &Philosophy &Programming Languages &Software 12 Nov 2007 11:35 am

Document the Difficult Stuff, not the Easy: Rails Tutorials

I found Rails Tutorials pretty handy. They are short and sweet focusing on only one particularly problem per tutorial. I also found some good discussion in the comments of each tutorial. With their help, I finally got my head around how to deal with creating complex relationships of objects and dependent objects so that they are put in the database atomically, and so that they are available for error correction on the form if there were validation errors.

A big part of the problem I was having is that there are a million tutorials on the simple stuff in Rails and ActiveRecord, but very few on doing real work. There are many features of the Rails framework that I have just happened across accidentally, or that I had to scour the net and books looking for examples.

The one particular bug, err… feature, that has been haunting me is how to create an object that has a complex join model, and have all the other objects in that model get created automatically.

It is obvious enough for me to do it by hand. For example, creating a Registration for multiple People for multiple Courses, with other related information like Payment choices and related details to the Registration. When I get back a form, I could pick out each parameter set in my form fields. I could then create each object, Registration, People objects, Payment details, etc.. and then set them on the Registration object.

@registration = Registration.new(params[:registration])
new_payment = Payment.new(params[:payment])
@registration.payment = new_payment;
@registration.people = params[:people].collect { |[], person| Person.new(person) }
@registration.save

But rails should be able to do all this automatically since I already specified the relationships in the model objects. Well, turns out it can. You can use the build method on the model objects.

params[:people].each {|person| @registration.people.build(person) }

However, this doesn’t work for has_one or belongs_to objects, for those you have to call

@registration.build_payment(params[:payment])

Notice that this seems to be some sort of method_missing magic. I haven’t hunted down where this gets handled, but more troubling to me is that I never knew it even existed. I am glad I found it of course, but it is the first time in Ruby I have had the feeling that dynamic features could be bad.

I know the horror stories of dynamic languages and the claims for static typing and so on, but by and large I have not had this problem with Ruby, and I have probably written about 15-20kloc of Ruby now. Not a great amount, but not a trivial amount either given the expressiveness of the language.

Maybe I should have learned Rails by looking at the test suites. Perhaps within that code I would’ve found examples of build_x and that would have clued me in. I don’t know if those tests exist, but still I think that tutorials can be more efficient communication than test suites.

Of course that depends on what tutorials get written. My Request:

When writing tutorials for programmers, just write the tutorials for the hard stuff.

This should be the priority. Assume that programmers can figure out the obvious stuff, and spend your time on explaining the hard, hidden parts of the framework.

Humor &Language &Philosophy 11 Oct 2007 10:00 pm

How Brilliant is Pinker’s Article? Fucking!

Why We Curse. What the F***? by Steven Pinker. Leave it to a linguist to write such a filthy provocative article.

(Via TNR Online.)

Language 16 Jun 2007 10:33 am

NPR : Szymborska’s ‘View’: Small Truths Sharply Etched

NPR : Szymborska’s ‘View’: Small Truths Sharply Etched

I heard this piece on the way home this afternoon. It really caught me by surprise. I haven’t heard any poetry I liked so much since Billy Collins.

You can find out more about her at Wikipedia and there is a site called PoetSeers that has several of her poems.

Language &Miscellaneous &Philosophy &Science 29 Jan 2007 12:08 am

Links to free educational resources

free educational resources online.

(Via jennawrites.)

Language 13 Feb 2005 02:25 pm

Grady Booch’s Reading List

A voluminous list of things to read from Grady Booch’s blog. Interesting to hear the non-technical overview, and then to check out the Excel spreadsheet with all the technical books. He wants suggestions if there are any that he doesn’t have that you recommend.