62 comments

[ 1.8 ms ] story [ 121 ms ] thread
The one that makes me want to gouge my eyes is "performant", the word that isn't.
I find not using declension to sound hip a bit jarring:

Total spend (instead of budget, expense) Compute power (instead of computing power)

Maybe it's just me and maybe they are grammatically correct but it just seems like trying to sound in-clique..

I also find the functionality of that word questionable.
The thing is, though, if people use the word (which they do) and people understand it (which they do), then it's a perfectly valid part of the language regardless of how much you want to tilt at your ivory windmills.
It's a fairly recent French loan word with Anglicized pronunciation. It has two meanings:

1 - A person who performs (alternative to performer). With semantics that suggests it's for more serious roles.

"The performant did a wonderful job during the ceremony."

2 - Efficient, effective. Considered a term-of-art in technical disciplines.

"The shape of this new hull design is far more performant than previous generations of ships."

But we're writing code, not a grammatically correct english essay. If incorrect grammar leads to shorter and simpler variable names that other programmers understand, then it should be encouraged.
To some extent, this is true in the real world - it often feels like completely correct english is a lost cause. Many of our grammar rules have been replaced over time as our language has evolved.

I was upset when I learned some people didn't have to spend years in school trying to figure out all how to correctly sound out words in their language.

At least we have a large vocabulary to pull from.

What is completely correct language? That was always a lost cause; it's not how people work.
Most of the "grammar rules" that people like to hoist their flags upon have never been "rules" (except in the head of woolly minded prescriptivists like Orwell, Strunk, et al) because there has never been (and likely never will be) a formal English grammar.
> If incorrect grammar leads to shorter and simpler variable names

It doesn't.

> that other programmers understand

It confuses many programmers.

> I ask you to set something up for me. I don't ask you to setup something for me.

"Please set up a meeting with Kevin for me" sounds more natural to me than "Please set a meeting with Kevin up for me."

That's called a heavy NP shift[1]. Since "A meeting with Kevin" is "heavy" (which is a fuzzy line, but one which native speakers know intuitively), the phrasal preposition gets "shifted" closer to the verb.

An example (pronouns almost never qualify as "heavy"):

Good:

• Please set him up

Weird sounding:

• *Please set up him

[1] http://en.wikipedia.org/wiki/Heavy_NP_shift

"Please set a meeting up with Kevin for me"? I'm probably breaking rules here.
Who says the criteria for separating parts of programming language identifiers need be dictated by whether the words are separated by spaces in English?

The "mistakes" here are all examples of phrasal verbs:

http://en.wikipedia.org/wiki/Phrasal_verb

The central characteristic of these constructions is that the verb+preposition form "a single semantic unit".

That would seem to be a perfectly reasonable justification for not introducing underscores.

> Who says the criteria for separating parts of programming language identifiers need be dictated by whether the words are separated by spaces in English?

Many coding standards specify different presentation for single-word vs multi-word identifiers, except in languages where the syntax would prevent this (e.g., snake-, Pascal-, or camel-case presentation of multi-word identifiers.)

All the examples are phrasal verbs, presented as single words in identifiers that are using snake_case or camelCase to distinguish multiple words in the identifier, and so are incorrect.

The only times I can see this being anything more than a mild aesthetic issue (though still a real issue that, while perhaps not the most critical to address, is worth being aware of and avoiding) is if it is in a language where, e.g., properties and methods share a single namespace, and coding standards dictate that properties use noun-based names and methods use verb-based names. In that case, using a single-word noun in an identifier when you intend a phrasal verb is a substantive error (most particularly when that semantic unit is the whole of the identifier).

Oh, who gives a fuck?

"Set up", "clean up", and "tear down" are used all the time in modern English, without interposing the direct object between the words, e.g.:

"Let's set up camp here."

"Clean up your room."

"Mr. Gorbachev, tear down this wall!"

So maybe if we were following the rules of CamelCase strictly, it would be setUpTestCase() or similar, but ultimately as long as what is meant is clear IT DOESN'T MATTER.

There are only two hard problems in computer science...
Does setupTestCase() return a setup test case, or does it set up a test case? Putting a little thought into clarity of naming can save a lot of repeated effort reading the code in the future. Little things add up.
Nice summarization of an article in one sentence. I guess I am going to have to be a little more careful naming by methods. I might just avoid this type of word in the future.
Context matters. TestCase.setupTestCase() sets the test case up, while TestCase TestHarness.setupTestCase() returns the setup test case.

A better name for the former would be TestCase.Setup(), and a better name for the latter would be GetSetupTestCase().

Yeah, I think this is just a snapshot of language evolving. "setup" and "cleanup" just feel like complete, whole verbs to me.

One of the first comments on 'setup' on m-w.com is "most people think this spelling can be used as a verb".

Check back in 15 years and see where we stand :)

You missed the point. The point is not that one should always write words in between, the point is that these compound verbs should not be written as single words.

"I set up the computer", not "I setup the computer".

"Up", "down", and "over" aren't adverbs. Frequently they're prepositions, but in verbs like "set up" they're just part of the verb itself, since "set up" can't be understood by the meanings of "set" and "up". (See http://en.wikipedia.org/wiki/Phrasal_verb for more info).

And also: what on earth is the author proposing the methods be named then? Rename "setupInstance" to "setInstanceUp"? In what way is that clearer or more readable? And really, "setup" and the like have become verbs through usage already. Which would you be more likely to say?

1. Can you set a new user up for me?

2. Can you setup a new user for me?

For me, #1 sounds awkward, #2 sounds more natural. Similarly for cleanup, teardown, and other common computer tasks.

setUpInstance vs. setupInstance. Because "setup" is a noun, setupInstance looks like it could return a setup's instance. setUpInstance looks like it performs an action.
Or, setUpInstance looks like it's the setter for an upInstance variable, whereas setupInstance has an obvious connection to the "setup" action even if it's grammatically incorrect.
Haha, very true. That is one reason I like underscores: you can distinguish between setup_instance, set_up_instance, and set_upinstance. Or maybe set_up_upinstance. In context, it probably wouldn't matter unless you have both "setup" and "upinstance" types running around.
The second example is written:

Can you set up a new user for me.

I winced as soon as I saw the examples --- these things bug me too. :)

There are quite a lot of sites with buttons labelled "login" or "logout" (HN is one!) which I always thought should read "log in" and "log out".

I suppose the language is heading this way though, so I'm sure we'll consider these things to be grammatically correct eventually, if we don't already.

(comment deleted)
That's not a mistake, it's a bug fix.
That's a case of programmers choosing to follow a rule that actually makes sense. Lots of typographical rules don't, often due to being some holdover from the days of typewriters when your options were very limited and didn't include the right answer.

Putting in quotes only what is being quoted is also considered correct in British English.

Too late!

http://dictionary.reference.com/browse/setup?s=t

  set up
  verb (adverb, mainly transitive) 
   ....
   3. to build or construct: to set up a shed
  Collins, 2012
I've slowly moved from prescriptivist to descriptivist, and if you want to keep your sanity, I suggest you do too, because linguistic history has shown that people use words the way they want and will keep doing so regardless of any interventions.

edit: To clarify - the author says:

  I ask you to set something up for me. I don't ask you to setup something for me.
I think the genesis of this expression was "to set up <sthg>" -> "set up <sthg>" -> "setup_sthg". The "to set <sthg> up" form /is/ probably more correct in the prescriptivist sense, but my take is that this isn't really a mistake, it's intentional. "setTestClassUp" sucks because it spreads the logical units of the identifier all over the place. I want the verb in the beginning and the noun after.
lolz bt dnt u thnk tht ths shit is ugly?
Ugly to us maybe, but that won't stop your kids from being fluent in it.
In my experience, the only people who send text messages this way are the parents of children who have a cell phone. Text abbreviations were used at a time when typing on a phone was difficult, but now that we can use our thumbs to type (or swipe) fully expanded words on a virtual qwerty keyboard, most people have abandoned the kind of spelling you're displaying.
My co-workers' (ranging in age from 18 to upper-50s) txt's beg to differ.
Doesn't that link contradict your point? Only the verb version contains a space.

  setup
  noun
  ...

  set up
  verb (adverb, mainly transitive) 
  ...
That said, I agree with you regarding prescriptivism vs. descriptivism.
I don't think you're disagreeing with the post. The author isn't arguing that "set up" isn't a verb, but that it's a phrasal verb, which should be written as two words.

This isn't a prescriptivist argument about language itself, it's an argument about a spelling convention (One which is arguably more accurately descriptive of the usage of the words.). Your dictionary link, by spelling "set up" as separate words when used as a verb, agrees with the author.

It's possible that language changes will result in "set up" becoming a fixed, atomic phrase, at which point writing it as one word would make sense. But since both"I'm going to set up the computer" and "I'm going to set the computer up" still sound perfectly natural to my ears as a native speaker, I don't think we've yet reached that point.

In camel case, "two words" becomes setUp. I'm not sure that capitalizing 'U' does any good for future readability.

I suppose that in snake case it might be a little clearer, but in many cases it would still be good either way that someone named their method/function/variable fairly descriptively.

I'm actually ok with it being written "setup" in that case. It's then just a noun and not a verb.

However something like "cleanupInstance" is much better written cleanInstance or cleanUpInstance

Pedantism is important and valuable.
This really became more intuitive to me after studying German, where the idea of separable verbs was made explicit.

I don't think things should be named "setInstanceUp" or anything like that, but you could see how "setUpInstance" could mean something different than "setupInstance" (an instance of a setup, I suppose).

Same with "signup" versus "sign up", login/logout/etc. There are a lot of examples of these things where people confuse the verb and the noun, and the word split can be the most concise indication of which is which.

I would use "InitializeInstance" or "InitInstance" rather than "setUpInstance" anyway...
While "setUpInstance" could mean "set the instance of the up (direction)". That would confuse me a lot more.
Ahhh not me! Every time I inform someone about this grammatical difference I get a warm smug feeling inside.
Oh joy, another programmer trying to convince others that the rules of English grammar can be solved logically.

Ideas like "setup" and "teardown" have grown to describe important verbs in their own right. Why argue that the original form (verb + preposition) should not be allowed to merge, when it's clear that they already are doing so? For no particular reason, other than maintaining a status quo? That's a little ridiculous.

PS: Same logic applies to "login" and "logout".

Every English style guide that I've read stresses the importance of consistency. If you want to use "setup", "login", etc., go right ahead. But be consistent: use the words "setupping" and "loginning", rather than "setting up" and "logging in".
If it's not grammatical, why does it compile? My compiler rejects lots of errors, but not this.

Maybe the problem is that the OP thinks that the rules of English apply to computer languages.

Besides the obvious "who cares" there is another criticism here. It is not that difficult to think of that as the setup method, wherein the noun applies. That is, if you want to know what the setup is for an object, the setup method is a good place to look.

Sadly, this does mean that to set up the object, you have to execute the setup method. Which, I'll grant is odd. But seems fine.

Nitpick (which seems appropriate for a what is fundamentally a nitpick-y thread): in "the setup method", that's actually the adjective variant, rather than the noun. The article points out that the adjective is also one word.
Since grammar is just an attempt to generalize observations about usage (descriptivist), when you attempt to correct someone's grammar you are really saying "the prestige way to say this is ..., and you look foolish saying it the other way". In this case it is the author of the blog that looks foolish, since he is going in the face of the vast, vast majority of the community and he does not bring with him higher social status.

This is all a long winded way of saying the author of this blog post must be completely insufferable in real life.

Nope, every single one of the examples of being used "incorrectly" were being used correctly and also point to the general trend in all languages towards simplicity and regularity. More specifically these are all covered under well known morphological mechanisms that drive English word formation.

For example, in English, verbs and nouns have an unusually close relationship, it's trivial and natural to verb nouns, especially when the verbed noun is obvious. This is an example of derivational morphology, and there's all kinds of ways of doing this in different languages.

In English, among other neologistic processes, there's also a process to compound common noun phrases. These days, compounding nouns usually skips several medial steps (like hyphenation) because everybody knows that in a couple generations we're just not going to bother with the hyphen and we skip all that stupidity. A thousand years of English has showed us that this is the pattern.

Verbing a compounded noun is not only correct, it's actually how English works.

What happens in this specific case, is that these are all examples of incompletely verbed nouns. You don't say "setupping" you say "setting up" and that's because the phrasal verb form is still in common use. Once it goes away, we'll all be saying "setupping" and a few internet grammar nazis who are caught in a linguistic time warp that's literally decades behind every other person around them will get all hot and bothered that people are participating in these completely natural linguistic processes.

Verbing weirds language.

> Once it goes away, we'll all be saying "setupping"

Where is the evidence supporting the belief that we'll all be saying "setupping"? Not once have I ever heard anyone use the words "setupping", "loginning", etc.

I posit that the use of "setup", "login", etc. as verbs is simply the result of people not knowing how to spell. In other words, it's a change that's driven by (poor) writing, not speaking.

I think it's far more likely that people will start writing "settingup" than they'll start saying "setupping".

Everything you described is how languages actually evolve. There's pitifully few grammatical construct or morphological mechanisms in English where settingup would become a word, but there are several that trivially lead to setupping (or 'setuping')

Something linguists stopped doing a very long time ago is trying to logically set rules for how a language should evolve and started observing how they actually evolve.

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&e...

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&e...

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&e...

Just because nouns are commonly being used as verbs and just because languages evolve doesn't mean that those examples are grammatically correct.

They might one day be accepted as grammatically correct because they are overwhelmingly being used like that, but that day hasn't yet arrived ;)

I was thinking the article would be about the incorrect singularization of the word 'data'. It's a curious case. When I hear people say "these data are...", I can't help but think it's pompous. Even though I know their usage is correct!
Heh, I think a far more egregious error is having the word "instance" appended redundantly in a method name.

obj.SetUp() or obj.Setup() I'm indifferent to, but (mostly) there's no additional info gained by appending "instance" to it.

I say mostly because sometimes code could pass bound instance methods around for others to invoke alongside other functions.