…on a train ride home one day. […] I sat, staring out the window at the world, a life-sized blender mixing graffiti and iron smelts before my eyes.
You've got to hand it to fun money, though. Fake money rules. You can get your hands on it so quickly. For a moment, it seems like you're crazy rich. When I was a kid, I got with some of the neighborhood kids and we built this little Tijuana on our street. We made our own pesos and wore sombreros and everything!
One kid was selling hot tamales for two pesos each. Two pesos! Did this kid know that the money was fake? Was he out of his mind? Who invited this kid? Didn't he know this wasn't really Tijuana? Maybe he was really from Tijuana! Maybe these were real pesos! Let's go make more real pesos!
I think we even had a tavern where you could get totally hammered off Kool-Aid. There's nothing like a bunch of kids stumbling around, mumbling incoherently with punchy red clown lips.
And you know (you've got to know!) that this is going to turn into an obsession. First, you'll completely forget to take the dog out. It'll be standing by the screen door, darting its head about, as your eyes devour the code, as your fingers slip messages to the computer.
Thanks to your neglect, things will start to break. Your mounds of printed sheets of code will cover up your air vents. Your furnace will choke. The trash will pile-up: take-out boxes you hurriedly ordered in, junk mail you couldn't care to dispose of. Your own uncleanliness will pollute the air. Moss will infest the rafters, the water will clog, animals will let themselves in, trees will come up through the foundations.
But your computer will be well-cared for. And you, Smotchkkiss, will have nourished it with your knowledge. In the eons you will have spent with your machine, you will have become part-CPU. And it will have become part-flesh. Your arms will flow directly into its ports. Your eyes will accept the video directly from DVI-24 pin. Your lungs will sit just above the processor, cooling it.
And just as the room is ready to force itself shut upon you, just as all the overgrowth swallows you and your machine, you will finish your script. You and the machine together will run this latest Ruby script, the product of your obsession. And the script will fire up chainsaws to trim the trees, hearths to warm and regulate the house. Builder nanites will rush from your script, reconstructing your quarters, retiling, renovating, chroming, polishing, disinfecting. Mighty androids will force your crumbling house into firm, rigid architecture. Great pillars will rise, statues chiseled. You will have dominion over this palatial estate and over the encompassing mountains and islands of your stronghold.
In April, the callow lilies came back. They stretched their baby angel wings out and reached for the world. Gently, their tendrils caressed the sullen fence posts until even they lilted lovelier.
From her bedroom window, Lara watched the lilies […] She wanted to paint them, so she opened a new Flash template. A blank movie this time.
She set her cursor loose in the garden of her movie’s viewable area. Vector white lines below shorter vector yellow lines. She selected the white lines and grouped them together. She even moved them to a new layer entitled “Cry, Baby Angel, Cry.” Then she converted them into a graphic object and moved them to the library.
Lara's smile reflected across the glass of her monitor. She chose the text tool and in 42 point serif typed: “Dad.” She created a path for it and let it tween off the right side of the screen. She cried long after it was gone.
Just like the white stripe down a skunk's back and the winding, white train of a bride, many of Ruby’s parts of speech have visual cues to help you identify them. Punctuation and capitalization will help your brain to see bits of code and feel intense recognition. Your mind will frequently yell Hey, I know that guy! You’ll also be able to name-drop in conversations with other Rubyists.
Symbols are words that look just like variables. Again, they may contain letters, digits, or underscores. But they start with a colon.
:a, :b, or :ponce_de_leon are examples.
Symbols are lightweight strings. Usually, symbols are used in situations where you need a string but you won’t be printing it to the screen.
You could say a symbol is a bit easier on the computer. It’s like an antacid. The colon indicates the bubbles trickling up from your computer’s stomach as it digests the symbol. Ah. Sweet, sweet relief.
Method arguments are attached to the end of a method. The arguments are usually surrounded by parentheses and separated by commas.
front_door.paint( 3, :red )
The above paints the front door three coats of red.
Think of it as an inner tube the method is pulling along, containing its extra instructions. The parentheses form the wet, round edges of the inner tube. The commas are the feet of each argument, sticking over the edge. The last argument has its feet tucked under so they don’t show.
Any code surrounded by curly braces is a block.
2.times { print “Yes, I've used chunky bacon in my examples, but never again!” } is an example.
With blocks, you can group a set of instructions together so that they can be passed around your program. The curly braces give the appearance of crab pincers that have snatched the code and are holding it together. When you see these two pincers, remember that the code inside has been pressed into a single unit.
It’s like one of those little Hello Kitty boxes they sell at the mall that’s stuffed with tiny pencils and microscopic paper, all crammed into a glittery transparent case that can be concealed in your palm for covert stationary operations. Except that blocks don’t require so much squinting.
Block arguments are a set of variables surrounded by pipe characters and separated by commas.
|x|, |x,y|, and |up, down, allaround| are examples.
Block arguments are used at the beginning of a block.
{ |x,y| x + y }
In the above example, |x,y| are the arguments. After the arguments, we have a bit of code. The expression x + y adds the two arguments together.
I like to think of the pipe characters as representing a tunnel. They give the appearance of a chute that the variables are sliding down. (An x goes down spread eagle, while the y neatly crosses her legs.) This chute acts as a passageway between blocks and the world around them.
Variables are passed through this chute (or tunnel) into the block.