Five nouns for programmers
- Reification
- Notation
- Reticence
- Lucidity
- Intent
Learn ’em. Live by them.
The personal website of Piers Cawley
(they/him)
—
FolkSinger, photographer, carer and occasional programmer.
Learn ’em. Live by them.
A few days ago, Obie Fernandez:
One of the handy tools that Ruby makes available to us Domain Specific Pidgin builders is instance_eval
. With instance_eval
you can take a block that was created in one context, with all its lovely closed over local variables, and evaluate it in the context of an instance of an arbitrary object. Which means that any references to instance variables and calls to methods are made as if your block were a 0 argument method of that class. It’s really potent, but at the same time, a little frustrating.
So, I’m busily writing an article about implementing an embedded little language in Ruby. It’s not something that’s going to need an entirely new parser, it borrows Ruby’s grammar/syntax but does some pretty language like things to the semantics and ends up feeling far more like at declarative language than the usual Ruby imperative OO style.
I’ve been following Adam Turoff’s excellent Haskell tutorial and he’s just reached the part where he explains Monads.
Fixtures suck! Mocks rock! Don’t you dare let your tests touch the database!
Back when I was still programming Perl, one of the common mistakes that you’d see when people wrote lazily initialized object accessors was code like:
Mmm… back from Scotland with a chunk of reading done:
The bags are packed, there’s a pile of reading matter (mostly the classics, Turing’s papers, The Dragon Book…), the iPod is charged and we’re off to Scotland for a week with no connectivity.
Have you noticed the difference between Good Clever and Bad Clever?
<typo:flickr img=“632526335” size=“small” />
As far as I can tell, one of the Smalltalk optimizers’ mottoes is “Cheat all you want, but don’t get caught”.
There’s something enormously liberating about writing an RSpec description that starts like:
So, I just pushed the first step of what I’m thinking of as the Great Typo Controller Reorganization to the typo repository and updated things here. It’s always scary when I do that - local testing’s all very well, but running on a live site is a different matter.
So, I’m quietly beavering away at Typo with an eye to slimming down our somewhat monolithic ArticlesController
class, tweaking our routing to use the new datestamped_resources
plugin that I’ve developed to help dry up our routes, making a couple of new resourceful controllers for comments and trackbacks and generally tidying the place up. Hopefully Typo’s code is going to be much more habitable when I’m done.