I’ve found that typing in column mode to be very useful when using editors like IntelliJ or TextMate. VI also has a column edit mode, that is a little tricky to use.
To use it, press:
- Ctrl + V to go into column mode
- Select the columns and rows where you want to enter your text
- Shift + i to go into insert mode in column mode
- Type in the text you want to enter. Dont be discouraged by the fact that only the first row is changed.
- Esc to apply your change (or alternately Ctrl+c)
You will now see your changed applied.
Sayings I use, only some of which are actually originally attributable to me. Anyone with research on a saying’s provenance, feel free to comment. This page, unlike a normal blog entry, will be updated as needed with stuff I find myself saying with air quotes.
A comment is a lie waiting to happen.
“Legacy” means any program that people are actually using.
(Feathers: “Legacy” means “no tests.”)
If you try hard enough, you can make anything fail.
There’s no such thing as human error. (Only system error.)
If you pay attention to something, it gets better.
It’s always a people problem. (Jerry Weinberg)
You can see a lot by looking. (Yogi Berra)
Yogi wrote a book called “You Can Observe A Lot By Watching” but I prefer to think he was misquoting himself.
Language Log has a take on this quote: She was seeing at me
Object-Oriented Programming is like teenage sex: everyone says they’re doing it; few actually are; and those who are rarely know what they’re doing. (Anonymous, via Misko)
Here’s a simple test for whether you’re doing it right: Is your data in the same class as the methods accessing it? Oh, really? Check again.
Double negatives are not unconfusing.
Encapsulation means putting similar things together, and keeping dissimilar things apart.
Of course, the trick of design is knowing along what axes to group or differentiate items. One rule of thumb that has served me well since the days of Gamelan — when we were sorting dozens of incoming applets per day into categories — is:
Don’t look at the item and think, “What category does this item belong in? Look at the category and think, “If I were looking for items in this category, would I want to find this item?”
In other words, make your API fit the mindset of the user, not that of the provider.
Conway’s Law: “Any piece of software reflects the organizational structure that produced it.”
Or, “The structure of the code reflects the structure of the coders.”
Read the error message.
Good Scrum diagram. Suitable for XP too (replace “sprint” with “iteration” and “daily scrum” with “daily standup”).
Courtesy of Mountain Goat Software
We just implemented
bookmark_fu on Pivots and the experience was very smooth, taking only a few minutes. We how have an “Iconistan” of social bookmarking chiclets for either remembering or promoting content on Digg, reddit, del.icio.us — almost 20 sites in all.
Install via the normal plugin install process (the
-x installs it as an SVN:EXTERNAL):
#> ruby script/plugin install -x svn://rubyforge.org/var/svn/pivotalrb/bookmark_fu/trunk/bookmark_fu
I did have one issue — the
script/plugin install script pulled all the code down but ultimately failed because we have multiple versions of Rails on our development machine (about 5); this seemed to confuse the install script. No problem, though: I ran the
install.rb script manually:
#> script/runner vendor/plugins/bookmark_fu/install.rb
- Rails Bug: composed_of seems to be broken, at least in Rails 1.99. The :mappings parameter states that it can take an array of symbol-pairs, but symbols do not work — only strings work. Example:
Does not work:
:class_name => Name
:mapping => [
[:first_name, :first], # :symbol, :symbol does not work!
[:last_name, :last] # :symbol, :symbol does not work!
:class_name => Name
:mapping => [
['first_name', 'first'], # 'string', 'string' works!
['last_name', 'last'] # 'string', 'string' works!
- Ruby ain’t Java! A recent Java-convert ran into the following: when calling a private instance method, you must not indicate
self.private_method, but instead call
puts private_method #=> works!
puts self.private_method #=> self? uh oh!
'*** You Called? ***'
>> priv = PrivateCaller.new
*** You Called? ***
NoMethodError: private method `private_method' called for #</privatecaller:0x14ec39c><privatecaller:0x14ec39c>
from (irb):4:in `private_caller'
Ask for Help
- “Please help feed the hungry of San Francisco.”
We helped! Our barrel is over flowing.
During our Retrospective yesterday, several Pivots, especially our remote employees, mentioned that they missed the Standup blog posts that we used to post. Shall we start to post them again? And if so, does anyone have posting format suggestions? The old posts reflected our current real-life Standup format:
- Ask for Help
- Interesting Things
Unless anyone suggests changes, we’ll keep the same format.
I’m really starting to enjoy the selection of green teas in the office. I especially enjoy the ones with… well.. $#!+ in them. Popped rice, puffed rice, browned rice, black soy beans, and various other clippings and debris. It’s kind of like drinking tea with Rice Krispies in it, but in a good way. And the ingenuiTEA containers are very handy.
The only exception to my new-found enjoyment is a green “tea” named Angel, which must mean the Angel of Death, or perhaps the Angel of Turpentine; it’s easily the most foul and bitter substance I have consumed in a very long time.
So many of my colleagues have some degree of trouble with their
hands/wrists/arms. It’s a serious occupational hazard. Agile coding is a slightly different ballgame for me in terms of wrist problems.
My physical therapist for my first, worst episode — the episode that
left me with permanent nerve damage, nearly 20 years ago now –
stressed to me that damage is cumulative. Young coders can think
they’re invulnerable, but I’m here to preach to you: the pain can end
up being permanent. If it hurts to type, stop typing — please don’t do what I did, viz., shrug and keep going.
In the Agile/pair programming world the setup for workstations tends
to be a flat table, no special equipment, so that workstations are
interchangeable. No keyboard trays, nothing — not the best ergonomically. Here’s how I cope:
- I have a great chair, an armless ZackBack (um, yes, I’ve written my name on it in big black letters, why do you ask?). Posture can be really important to keeping your arms healthy.
- I use a flat keyboard, with as light a touch as possible — Macally is working well for me.
- I put the keyboard in my lap, which creates a better angle for me.
Alas, sometimes it maketh my typing to suck, but usually it’s okay.
- I use two alternative mice: a Roller Mouse for clicking and most steering, and a pen mouse for the rest of the steering. It’s best for my hands if I use both of them to mouse at once. Clicking with the pen mouse once caused a flareup, and the roller mouse gets a little wild for precision steering, which means I put my hand in a bad position trying to control it. I used to use a foot mouse, and I recommend that too if you don’t mind a loud clomping sound every time you click. High learning curve with the steering, but great low-impact clicking. My fabulous former boss Lynne Cameron thought of it. (Miss you, Lynne!)
- I turn on Sticky Keys, which means I don’t have to hold multiple keys at once. Unfortunately, it can be hard on my pair if we forget to turn it off. Sorry, folks. Think of it as a variant of Dvorak. Note that it’s a good idea to disable the “beep when a modifier key is turned on” option if you value your sanity, and enable “Press shift five times to turn on or off”. (Also that, arghh, the new Apple keyboard goes a little berserk with Sticky Keys turned on. The arrow keys don’t work at all, for example.)
- I make sure the monitor (we’re an all-iMac shop) is on a riser or phone book or something so that the top of the screen is level with my eyes. Bent neck equals bad posture.
All these help to make the setup sustainable for me. The other thing
about pairing that makes sense ergonomically is, of course, the fact
that your hands get a break whenever your pair is typing (if you ever
let them type — I am a confirmed keyboard hog, but I’m trying to mend my ways!).
Just one more wrist hazard of agile coding: all the self-applauding and high-fiving — paired code is so much better than code written solo.
How do you cope with your wrist limitations?
Want to avoid feeling like a chump and spending countless hours troubleshooting a crazily-stupid-simple problem?
<script> tags off the front and back.
You probably knew that already. Why didn’t you tell me sooner?