Mar 13 2009

Parens

I’m a little let down this morning. I learned somewhere in college (probably from a classmate) that the singular of parentheses was paren. Certainly a lot easier to say, anyway. But when I looked it up in the dictionary this morning…

pa·ren·the·sis |pəˈrɛnθɪsɪs|
noun ( pl. -ses |-siːz|)

  • (usu. parentheses) one or both of a pair of marks ( ) used to include such a word, clause, or sentence.

The singular is parenthesis, and it all but condones using the plural for a single mark. But all is not lost!

paren |pəˈrɛn|
noun (usu. parens) Printing
a parenthesis.

ORIGIN early 20th cent.: abbreviation of parenthesis.

I don’t know about you, but I’m sick and tired of saying parentheses (we say that a lot in programming). I propose that we usher in the shift from parentheses to parens. In programming, at least, let’s use the word paren for singular and parens for plural. Will you join me?

P.S. The British tend to call parens “brackets,” which is short for “round brackets.” I was teaching a class on C and had a British student, and I had her totally confused because to me “brackets” meant square brackets. When I said brackets (meaning square brackets) she thought parens. When she said brackets (meaning round brackets by default) I thought square brackets. When I said braces I meant curly braces (what other kind are there on the keyboard?), but to her braces was a synonym for brackets…


Sep 11 2008

Touch Typing

Steve Yegge has posted an funny, irreverent, and above all excellent argument for touch typing. I highly recommend it even if you do touch type.

I am downright flabbergasted by some of the comments though. There are hunt-and-peck folks defending their inability to touch type as lifestyle choice based on the belief that they will get RSI. People justifying typing slow because it
saves them from wasting time chatting or writing long emails. There are some interesting claims from 2–4 finger typists that they can type without looking at 70wpm (this is certainly possible), and choosing not to learn to touch type
the “right way” because it will give them RSI (this is certainly ludicrous).

Typing is a vital skill if you work in IT, especially programming. Of this there is no doubt, rationalizing strangers aside. I simply cannot imagine being stuck typing at 10wpm or less. It would be like being stuck behind a pair of tractors on the freeway going 20 mph. For the rest of your life.

Last I checked I type about 65 wpm on average. I could probably go faster, but I never have felt the need. I can type as fast as I think when programming. If
I were a stream-of-consciousness novelist or a secretary, I could probably make use of a faster typing speed. As it is, 60–70wpm seems to be a sweet spot
for me.

I’d like to discuss the ridiculous RSI claims. Yes, if you type all day without breaks you can get RSI. There are certain things you can do to mitigate or exacerbate this for a given amount of typing and typing speed. If you tried to go lightning fast all the time you might hasten the onset of RSI. But I argue that the absolute worst thing you can do if you’re afraid of RSI is to not touch type. RSI means Repetitive Stress Injury, from repetitively performing certain motions until your body starts to break down. Smaller more relaxed motions are less stressful on your body than large stiff motions. If you touch
type well, your hands are relaxed, your fingers float over the keys, and movement is minimal. Of course you still need to take care—take breaks, spend some time thinking without typing or drawing pictures on paper, proper nutrition, etc. But the biggest thing you can do to prevent RSI is to have proper form. And maybe learn dvorak (I still use qwerty because I find sysadmin and programming to be tedious with dvorak, but I don’t spend most of my time actually typing).

On the other hand, if you hunt and peck 24/7 guess how much more movement—repetitive movement—your body is enduring? Ever heard of tennis elbow? RSI isn’t the exclusive privilege of touch typists. If you type slow enough that you can’t possible get RSI, you are irrelevant. If you type fast enough to be productive but don’t have good form, you are setting yourself up for RSI. If you’re RSI-prone or just paranoid, go learn dvorak now or find a job that doesn’t require much typing.

I’d add to Steve’s exhortation to learn to touch type, that if you do touch type but you feel your form is off, you have low accuracy, or you feel that your fingers are stiff, do some conscientious practice. Focus on accuracy and relaxation first, then speed. Enhancing your typing skills is a great benefit if you spend a lot of time typing, although learning to touch type in the first place is obviously a much bigger payoff.

Let’s continue to learn from musicians: correct form (including relaxed posture and keep those wrists off the keyboard/desk), accuracy, then speed.


Apr 6 2008

Functional Floundering

Levi pointed me to a presentation on Clojure, “a dynamic programming language for the JVM”. That’s actually a pretty bland description. I’d describe it at least as a dynamic functional concurrency-oriented lispy language for the JVM. The presentation was interesting, though I wish I had been able to follow the ant colony demo (it’s audio-only).

It awakened the oft-recurring “functional floundering” feeling. I’ve written a semester worth of scheme in a programming languages course. I’ve read the Erlang book and written a little Erlang code. I recently went through a graduate course in programming languages with emphasis on denotational semantics. I understand the lambda calculus, functional programming, etc. But I feel completely stymied whenever I think about actually programming in a functional language.

I’m not sure what the root is, but I’m sure it boils down to lack of practice. That undergraduate course aside, I haven’t had any practice. And since that course was very handholding (too much in retrospect), I don’t feel like I took any practical skill away from it. Yet I feel that in the future functional programming for concurrency will be important, even if I’m not convinced it will be essential.

So I don’t have time right now to really rectify the situation, but that doesn’t stop me from wondering—how does one learn practical functional programming? What problem sets do you work through to get the needed practice? I suppose the question can apply to learning any new language, but there is much paradigm carry-over between imperative languages (and probably between functional languages). Are there certain problems that will aid that paradigm shift? If you feel like you’ve developed functional chops, in any functional language, I’d like to hear in the comments how you got there, what you’d change in retrospect, and your advice for me and others like me.