Level-zero programmers obsess over essentially unimportant details of programming: whether you should write blocks like
void someFunction(void) {
printf “Yesn”;
}
or like
void someFunction(void)
{
printf “Yesn”;
}
, for instance, or whether to use vim or emacs to edit your code. These are unimportant for at least a couple reasons. First, you can solve these sorts of style problems in an entirely automated way. Second, there are many, many things that are more important than these sort of nits; they don’t even really impact your code’s readability, for one. These details don’t even count as ‘style’. They’re purely mechanical.
A level-zero English-language writer pays attention to Strunk & White. What’s odd about Strunk & White is that, far from being about [book: The Elements of Style] like its name suggests, it’s really [book: The Elements of Grammar]. True, grammar does matter. Inasmuch as “style” means “writing to appeal to your audience,” and inasmuch as your audience cares about little grammar nits, grammar is important. Grammar, in this view, is arbitrary but important. It’s like the location of the silverware at dinner, or like not chewing with your mouth full: it’s an arbitrary convention that certain groups of people pay attention to. It’s a class identifier. Using “whom” properly, or not ending a sentence with a preposition, is a class identifier. It’s a way to signal to people of your class that you’re one of them. Others will completely miss the signal, which doesn’t make them rubes; it just means that they don’t subscribe to your particular class signals. So call it [book: Elements of Writing For The Wealthy], perhaps.
But even with that caveat out of the way, and even if you don’t agree with Language Log that Strunk & White is a pile of trash, it’s still the case that [book: The Elements of Style] is wildly, comically unimportant to the act of writing readable text. Whether you use “whom” properly (and I’m a dues-paying member of the Whom-Using Board Of Pedants) has practically nothing to do with whether people will read your writing all the way through to the end.
Grammar is important to get you off the ground, in a certain sense. Works riddled with typos are often hard to get through. Using commas where you mean to use semicolons will sound wrong in your reader’s ear *if he’s trained to read them that way* (so again, the rule “know your audience” is logically prior to the rule “use punctuation properly”).
But that’s just the point: this is level-zero stuff. These are the rules you pay attention to because they’re rote and mechanical, and thereby easier to remember and implement than “grab your reader with a good hook” or “use lots of examples when you’re arguing an abstract point.” They’re high-school rules; they’re not adult rules.
Interesting point. It is this exact debate that Guido tried to quash in his decision to make whitespace matter in Python. If readability is important, and coding “grammar” styles vary widely, why not make the style part of the syntax?
I also would say you could even extend this argument to include “what language should I use?” For most development projects, the language choice matters far less than the quality of the code, and you can write good code or bad code in any language you choose.
LikeLike
I know a lot of people who would dispute the “language choice is mostly irrelevant” point. Java, for instance, is an extremely verbose language, in that you need to do a lot more typing in Java to get the same point across than you would to get it across in Python. IDEs can handle a lot of boilerplate for you, but you shouldn’t have to rely on the IDE for this.
The argument from brevity, and in particular the argument that macros impart brevity, is why a lot of people I know say that Lisp really is a faster language. See Paul Graham on this point:
http://www.paulgraham.com/avg.html
The argument may be different between established companies with a large existing codebase and startups.
LikeLike
This could also be applied to persuasive speaking.
LikeLike
So language choice does matter but I think the Paul Graham article sort of misses the point. I doubt LISP alone would be good for the task he was doing. He sort of lucked out in that LISP was one of the few reasonably evolved dynamic languages in the 90’s. Seriously, I was cling back then and a lot of he languages, libs, and technologies we have today were pretty Palezoic or non-existent at that time. Also, notice how he used LISP for the front end where he was probably messing around mostly with HTML… That’s mostly string manipulation, of course LISP is suited to that kind of thing. His back end was in C and Perl. To me he real take-away is to keep your language options open and that while you can do almost anything in a particular language, some languages really are better suited than others for different tasks.
As far as the opening post is concerned, the second function style is the correct one ;)
LikeLike
I’m sure you mean “it’s like not chewing with your mouth open”…
As someone who reads an awful lot of writing that is littered with inappropriate punctuation, overly long or nonsensical paragraph breaks, lack of clear antecendents, etc. etc. I can say two things: first, although it grates me to read split infinitives and inappropriate use of who/whom, I realize that there is probably no good reason for disliking these things. However, and second, it is absolutely the case that poor composition can make a piece of writing either incomprehensible or unbearable. I tend to focus on the concept of “voice,” which I think dovetails with the gist of this post. As long as the writing is expressed in a consistent voice that is appropriate to the audience, nitpicking about grammar is better left to your freshman high school teacher.
I know nothing about programming, but there’s got to be analogy back the other way, right? Of course, there is a point at which errors in the order and arrangement of letters (the syntax) of the code makes it worthless. Similarly, there is a point at which the failure to write grammatically results in a loss of intelligibility. It’s not mechanical, but it’s real. I assure you.
LikeLike
0 Pingbacks