6 ms·
Against Camel Case
- blasdel 17y agoAn online bibliographical supplement: http://www.steamthing.com/2009/11/the-kneecapping-of-intercapping.html http://www.steamthing.com/2009/11/the-kneecapping-of-interca...
- texel 17y agoI much prefer William Safire's treatment linked from that bibliography: http://www.nytimes.com/1997/07/20/magazine/jammedtogether-names-inc.html http://www.nytimes.com/1997/07/20/magazine/jammedtogether-na... Safire seems to treat the whole thing with a sense of playfulness and levity, as if he realizes that the very purpose of a language is to evolve. Crain's article is preachy and disdainful- he might as well shoo us with a broom and tell us to get off his lawn.
- DanielBMarkham 17y agoSafire's piece is an order-of-magnitude better than this one. He is missed.
- eru 17y agoI like the other one better.
- gabrielroth 17y agoThe tone you call 'preachy and disdainful' I find humorous and self-aware. Likewise the conceit of refusing to print any camel-case terms. "I could print it here to show you, but I refuse to allow my prose to be so disfigured": it's a parody of a grumpy-old-man routine. I assume he's sincere in his distaste for inner caps, but he plainly recognizes that it makes him sound like an old codger, and he's playing that up for comic effect.
- texel 17y agoThat could be, and I certainly did a double-take when I saw this his blog is called "Steamboats are ruining everything." Still, at first blush, any winking and/or nodding was lost on me, and I usually pick up on that kind of stuff.
- jimbokun 17y agoI thought it was pretty clear when he added the part about letting the dog sleep on the sofa.
- s3graham 17y ago"Preachy and disdainful" -- I did not find it so. In fact, close to tongue-in-cheek, more of a "ha ha, just serious". ... "Three! And why not let the dog sleep on the sofa?"
- RiderOfGiraffes 17y agoIt must be a really slow day on Hacker News - how has this got four upvotes? Really, seriously, can someone tell me why this is even the vaguest bit interesting or intellectually stimulating to them? I would honestly be interested in hearing an opinion other than mine.
- ars 17y agoBecause we use camel case in programming, and we are curious what non programmers think of it.
- RiderOfGiraffes 17y agoReally? Do you really care what non-programmers think of CamelCase? Why not ask them what they think of using braces, or indentation? Clearly people think my question detracts from the value of HN because they're downvoting it, but to me it's worth it to investigate a place where the opinion of the "community" differs so radically from mine. I have zero interest in finding out what people think of summation notation, or bra and ket notation, and, quite frankly, I find it inconceivable (and I do mean that, unlike Vizzini) that programmers would care what non-programmers think about CamelCase. Still, you're being up-voted, I'm being down-voted, so obviously people really are interested in that. I'm mystified, but I'll accept it as a data point. ADDED IN EDIT after reading the comment by benatkin to the above: I am genuinely surprised, confused and puzzled. I'll have to re-think my model of what the HN readers think satisfies PG's outline of "On-Topic": Anything that good hackers would find interesting ... gratifies one's intellectual curiosity. I'm going away to ponder the response, feeling somewhat bruised and punished by the "community" I thought I understood and felt at home in.
- benatkin 17y agoI'm interested because I want more than half of the people who are currently in high school to know a little bit about programming in ten years, and I wonder what might trip up some of them in an introductory programming course.
- ynniv 17y agoThis is infuriating coming from the Times. Are they similarly disgruntled with FedEx? AmEx? Camel-case capitalization is used to create enforceable trademarks. It is the unfortunate truth that legally enforceable trademarks have to be substantially not generic, and this leads itself to quirky names like Kleenex and ex-lax. This is particularly bothersome: "I could print it here to show you, but I refuse to allow my prose to be so disfigured." Camel-case names are not Voldemort; you should not talk about not talking about them. If Cain is so concerned, he should do the simple thing and call it a mobile phone, or a music player. This is journalistic drivel, and tarnishes my opinion of the Times.
- lucumo 17y agoColumns are the words of their author, not the newspaper. They don't necessarily agree with the opinions of the paper. On the same note, columns aren't news items or reports. They are opinion pieces. To call it "journalistic drivel"—or "journalistic" at all—is unjustified. Columns are meant to give opinions. It's not unusual to see columns written with the intent of giving an opinion that's opposite to the one held by average readers. The opinion of the newspaper's editors is usually given in the editorial.
- billswift 17y agoBut one could wish that they were more often RATIONAL opinions. Everyone has opinions, I just wish more thought went into those that make it into print.
- ynniv 17y ago> To call it "journalistic drivel"—or "journalistic" at all—is unjustified. You're right, and in retrospect I'm surprised that I used that word. These days I expect this sort of inane rant from someone's blog that I will ignore in the future, not "nytimes.com". Maybe blogs have made opinion columns irrelevant? I can see how papers might have been boring in the past, but today we have an infinite tap of ranting idiots... maybe the papers should stick to journalism?
- aminuit 17y ago
- randallsquared 17y ago[In the New York Times] Thereafter every brand name was permitted up to three idiosyncratic majuscules. Um, what? It's a brand name. Either you render it correctly, or you don't; there are no typographic decisions to be made unless you're committed to mangling it in the first place, right?
- goodside 17y agoI more or less follow this rule. I'll mention iPhone or TextMate without pause, but SpongeBob SquarePants is asking a bit much and (PRODUCT)RED, which is audacious enough to require a superscript, is just plain silly.
- adatta02 17y agopeople always butcher the camelCasing on our company name. It's supposed to be Setfive but people will often write SetFive or Set Five. good thing the bank really doesn't care.
- gojomo 17y agoA decade ago, many journalistic outlets didn't humor brand-motivated capitalizations. They didn't accept the company's own marketing staff as authoritative about what was "correct" and what was "mangling". It was Ebay, not eBay; Next, not NeXT; Nationsbank not NationsBank; etc. This article is a lamentation that the journalistic style guardians didn't hold the line. Here's William Safire's 1997 take on the issue, alluded to by Crain but not linked: http://www.nytimes.com/1997/07/20/magazine/jammedtogether-names-inc.html http://www.nytimes.com/1997/07/20/magazine/jammedtogether-na... I'm for camel case as a necessary evolution: there are so many similar names, and name collisions, that anything that lets someone try to be distinguishable, and anything that might make two words fit together more distinctively than if paired any otherway, deserves a chance.
- etal 17y agoA press release from a typical company will throw as much glitter on their own brand name as possible, and usually butcher the surrounding language a bit too: "the new FRISBEE [TM] brand Flying Disk..." If a writer takes this literally, a copy editor has to tone it down or else the brand name will dominate the article text and make it look like an ad, too: "It's a Frisbee." Fun variants include meaningless alternating caps, or a single lowercase 'i' inside an otherwise all-caps word. Newspapers want to use the brand name, not the logo or an ASCII attempt at one; and in decades past, fixing the caps helped comprehension rather than hurting it. They considered capitalization part of presentation, not content. (Shouldn't a brand name survive an all-caps typeface?)
- rflrob 17y agoIt might be folly to try to argue with language anti-evolutionists, but when spacing was added to scripts (according to the author, most recently during the middle ages), minuscule and majuscule were not consistently used at the beginning of sentences. One could make the point that we only really need spacing OR case differences, and don't need both.
- caleb_crain 17y agoIndeed, Paul Saenger, the scholar I quote in the article, writes that during the transitional period, capitals were sometimes used to mark word boundaries in run-together text. Unexpectedly, though, the last letter of a word was more often capitalized than the first.
- thwarted 17y agoThis reminded me that Commodore BASIC (among others, as this is in no way restricted to that platform, and is a common technique), had bit 5 set in the last byte of each word in its keyword list to signal the end of the word. This had the effect of capitalizing the last letter, and avoided the need for a delimiter character on that memory strapped platform.
- 10ren 17y agohmmm, perhaps conserving paper was also a reason for running words together, and cheaper paper (e.g. from improved trade routes/technology) enabled the reintroduction of spaces.
- gecko 17y agoI'm not sure whether you're aware of this, but many older scripts, including all of the Semitic scripts, actually write letters entirely differently when they appear at the end of a word. Given that the monks who began employing majuscule and minuscule would surely have been familiar with Hebrew script, I'm hardly surprised they initially went to making the last letter significant instead of the first.
- lucumo 17y agoCamel casing in brands can be confusing when writing. Is it Paypal or PayPal? Microsoft or MicroSoft? Moneybookers or MoneyBookers? Macintosh or MacIntosh? Altavista or AltaVista? Wikipedia or WikiPedia? And so on, and so forth. Some you can remember. Others may require you to look them up every time. But well—we already have to worry about spaces and dashes, so I suppose worrying about one more thing isn't so bothersome.
- olliesaunders 17y ago"But well—we already have to worry about spaces and dashes, so I suppose worrying about one more thing isn't so bothersome." There's plenty more than that to worry about.
- goodside 17y agoThe worst is the Walmart brand, which is controlled by Wal-Mart Stores, Inc. They use both forms in their communications depending on which is being referred to.
- 100k 17y agoI won't go as far as the author but I think camel cased names are going to look pretty dated in the future. As Ken MacLeod put it in "The Star Fraction", written in 1995 and set in the mid-twenty first century: "The name [FreeSpace] had once seemed trendy, but now dated us painfully - 'very TwenCen', as I'd overheard someone say..."
- eru 17y ago> As Ken MacLeod put it [...] Ironic name, don't you think?
- decklin 17y agoDespite what you might expect, there is actually a fascinating article behind this poorly-titled link; it starts at the fifth paragraph.
- eru 17y ago"Heresy became easier to communicate, and Saenger postulates that word spacing eventually made possible phenomena like irony, pornography and freedom of conscience."
- njharman 17y agoI've always associated Camel Case with Perl. So much so that I assumed the name derived from the Camel Book. But I suppose it's just were I first saw it used extensively. Anyway this quote from the article sums up my feelings on both Camel Case and Perl. "is regressive — in fact, medieval"
- salvadors 17y agoActually perlstyle suggests avoiding Camel Case: While short identifiers like $gotit are probably ok, use underscores to separate words in longer identifiers. It is generally easier to read $var_names_like_this than $VarNamesLikeThis, especially for non-native speakers of English.
- cubicle67 17y agoI guess he's grateful he's not German
- jeroen 17y agoI always thought it was camelCase and PascalCase. Googling gives me a handful of articles that support that distinction, but wikipedia doesn't make the separation. Is the term PascalCase widespread, or does everyone just call it CamelCase?
- sp332 17y agoI'd once heard the difference described as BactrianCase and dromedaryCase :)
- jamesbritt 17y agoI've known it as lowerCamel and UpperCamel