doingword.com

Archive for March, 2008

#5 - vi

Sunday, March 23rd, 2008

Gvim!Vi is a modal text editor for programmers. In one mode, you can delete words, duplicate words, or store them. Pretty much every single key on the keyboard corresponds to a mode. The second mode allows one to type words into the document. Vi allows you to type text without using the mouse all the time. You don’t have to go to ‘find’ in the menu with your mouse. You just have to type “/word_to_search_for” and then press “n” to cycle through those words. You can even press ‘*’ to find the next occurrence of the word the cursor is currently on.

This is cool.

Even though this is a a dead simple little wordpress blog, I’ve used vi to modify its Cascading Style Sheets and to fix the .htaccess file.

As a tool, it’s great to have. The one thing I like about it is that it’s always there. I use it for this Ruby on Rails website I’m making, I’ve used to make cell phone games, I’ve used it for C and C++ code. I always use it for projects, and the advantage here is that I don’t have to learn new concepts every time I do something new. Most programming is writing text files, compiling those programs, and then debugging them. Knowing vi (along with a Linux/Unix shell environment) eliminates the concept shifting that would occurs when one switches tools. The simplest example would be switching mobile phones and you have to learn entirely new ways to look at the contact list, a new way to set the alarm, and so on. Without vi, I’d have to relearn new concepts every time I move to a new project.

Vi has been battle tested and refined for over 30 years now. It’s a myth that whatever is newest is automatically the greatest in computer land. Programming is a craft, and the tools that are used must be refined and improved on the same timescale as any of humanity’s other tools. I’m positive that Hammer Version 1.0 did not have a nail puller on the other end; this was something that was developed later as the tool was being used in the field.

The wikipedia entry for vi explains it all.

Now, programming text editors written in 1976 aren’t the most popular thing around. There will be no bars in Moscow named ‘vi’; no one will ever name their children ‘vi’; and there will never be a movie about the origins of vi. That last one’s a shame, it would be riveting. Let’s start reading the script on page 59, shall we?

Page 59 - The Untitled Vi Movie

INT: BASEMENT. DARKLY LIT, TILE CEILING. CALIFORNIA.

PROGRAMMER 1

Hey, I know you’re working hard, Programmer 2, but I just have to say one thing. I think the user should press ‘r’ to remove that text. Not ‘d’.

PROGRAMMER 2

But we’ve already assigned ‘d’ to duplicate. We can’t change it, not at this stage. We’ve already written the symbolic hyper-tree, you goat kisser. Maybe we should use these fancy new ctrl keys?

PROGRAMMER 1

NOOOOOOOOO! Not Want!

PROGRAMMER 1 suddenly throws a FLAMING CALCULATOR at PROGRAMMER 2

END OF SECOND ACT

EXT: SUNNY DAY. COLLEGE CAMPUS.

COLLEGE STUDENTS are protesting the war, and they are being sprayed with water by some FIREMEN wearing NIXON masks. PROGRAMMER 2 is walking on the other side of the street as that ‘California Dreaming’ song plays.

Posted in Work | No Comments »

#4 - Saying ‘Zee’, not ‘Zed’

Saturday, March 22nd, 2008

I’m Canadian, and as a Canadian, you’re supposed to spell differently. Colour, Behaviour; you have to add those superfluous u’s. The whole thing is the fault of America, obviously. It sounds like something that Benjamin Franklin would do for the advancement of the colonies.

I say ‘zee’, not ‘zed’.

It’s a decision I made when we were learning the alphabet, way back in Kindergarten. I knew there was a different way to say the last letter. What if I did it differently, everyday, for the rest of my life, without any regards to the consequences of teachers correcting me or of getting beat up with hockey sticks? Everyone knew what Zee meant. We all watched Knightrider and A-Team and we knew the current year to date count of murders in Detroit (the cable stations used the Detroit affiliates of ABC, NBC, and CBS). I would never be misunderstood. And I stood by this principle for the rest of my life. I didn’t follow the American way for everything; I cannot converse in Fahrenheit, for example. I have no idea of what the weather is like at 58 in Fahrenheit at all, despite following the weather in the newspapers for years. Canadians as a whole do the same thing: I, and the other non-savants in Canada, do not know our weight in kilograms despite living in a metric country.

By saying ‘zee’, I could uncover the personality of other people. It was a way to get ‘tells’ out of people in an innocuous fashion. Some people were quite offended by this. It’s easier to say. It’s faster. For a time in my life when I was a teenager, it was the American way to do it — the better way. They had stealth bombers protected by marines with machine guns on the tarmac of the Minot, North Dakota air show. There are no machine guns in Canada. In the mind of a teenager, Q.E.D.

Posted in Language | No Comments »

Search


type and hit 'enter'