

A very common grammatical mistake that programmers make - jcbrand
https://opkode.com/blog/common-grammatical-mistake-programmers-make/

======
makmanalp
Too late!

[http://dictionary.reference.com/browse/setup?s=t](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.

~~~
ksk
lolz bt dnt u thnk tht ths shit is ugly?

~~~
chunkstuntman
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.

~~~
yaddayadda
My co-workers' (ranging in age from 18 to upper-50s) txt's beg to differ.

------
taeric
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.

~~~
sanderjd
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.

------
inverba
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.

~~~
Xeoncross
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.

~~~
sukilot
What is completely correct language? That was always a lost cause; it's not
how people work.

------
daviddaviddavid
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](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.

~~~
dragonwriter
> 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).

------
pavel_lishin
> _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."

~~~
Epenthesis
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](http://en.wikipedia.org/wiki/Heavy_NP_shift)

------
erydo
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.

~~~
peapicker
I would use "InitializeInstance" or "InitInstance" rather than "setUpInstance"
anyway...

------
justin_vanw
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.

~~~
jcbrand
Thanks :)

------
breadbox
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".

~~~
subsection1h
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".

------
acconrad
The one that makes me want to gouge my eyes is "performant", the word that
isn't.

~~~
mc32
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..

------
bane
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.

~~~
subsection1h
> _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".

~~~
bane
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&espv=2&ie=UTF-8#q=%22setupping%22)

[https://www.google.com/webhp?sourceid=chrome-
instant&ion=1&e...](https://www.google.com/webhp?sourceid=chrome-
instant&ion=1&espv=2&ie=UTF-8#q=%22setuping%22)

[https://www.google.com/webhp?sourceid=chrome-
instant&ion=1&e...](https://www.google.com/webhp?sourceid=chrome-
instant&ion=1&espv=2&ie=UTF-8#q=%22setingup%22)

------
mheasell
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.

------
nvader
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.

------
mcphage
"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](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.

~~~
wallyhs
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.

~~~
Rangi42
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.

~~~
wallyhs
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.

------
beagle90
Ahhh not me! Every time I inform someone about this grammatical difference I
get a warm smug feeling inside.

------
t1m
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!

------
fiatjaf
Pedantism is important and valuable.

------
hughdbrown
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.

------
cratermoon
setUpDog("what's")

------
cratermoon
Someone set us up the bomb.

------
bitwize
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.

~~~
jccc
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.

~~~
bentcorner
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().

