- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I don't think you're allowed to be pedantic about anything computer related if you're a VB fan.
Admin
using long names only obfuscates because there are no meaningful names for entirely arbitrary parameters. Even if you're writing something less general, say
you call the parameters a and b (or i,k; x,y; ...) and be done with it.
Yes. But why do mathematicians resist such notions? Maybe because making case carry meaning leads to concise and clear formulae and works extremely well, despite people's poor handwriting? Yup. Nevertheless, using case to indicate the "kind" of an identifier greatly facilitates following the relations.Admin
So..... If a library is written on an IBM mainframe and the source code is encoded in EBCDIC, then the source is compiled to a Java class, then the class file is copied to a Linux computer, do you have to save your Linux source code encoded in EBCDIC to properly call the functions?
Admin
Admin
You can kinda do that in perl using groups. It'll automatically put the parts of the search string that are within () into variables named $1, $2, $3, etc. Couple that with the magic variable ($_) and people start bleeding from the ears.
Admin
Can I use these characters in .NET?
ℂℍℕℙℚℝℤ
They are awesome!
Admin
I'll get back to the other replies some other time.
Admin
OK, here we go then: words consist of alphabetic characters, GUIDs consist of hexadecimal characters. Hopefully you see already where you screwed up but allow me to continue for you. Alphabetic characters draw a distinction between upper and lower case; it is relevant to their meaning and indeed upper and lower case characters have physically different char codes - they are fundamentally different characters. However, hexadecimal characters draw no such distiction - "f" is exactly the same character in hex as "F". In fact, forget that they're even letters because that is completely arbitrary - hex characters could be represented by your favorite 16 pop stars if you want them to, and there is no such thing as an uppercase or lowercase pop star.
Thanks for playing, it's dipshits like you that make this place so much fun! But seriously, playtime's over so get back to your VB, boy.
Admin
Admin
What about my EBCDIC comment? In this case, "F" and "F" may not even be the same thing. If you define the identity of an alphabetic character by it's numeric representation, then they must be different.
Admin
You don't do much with hex, do you?
Admin
Admin
Sure: note that you didn't write
(Why? Well, partly because Haskell won't let you, but mostly because xs is so ingrained in that programming mindset. You'd see x::xs and not x::X in ML too even though the latter would (I think) be legal.)
We definitely agree on the first point; I am sympathetic to the second but I'm not sure how much it helps. (E.g. I may disagree on the "greatly.")
So what's the meaning of q? What about Q? (Don't answer this yet; it's more prep for what comes next.) Ah, but see? You're not comparing like-to-like.In the case of hex digits, what you're saying is that the meaning of character code 102 (f) is the same as the meaning of character code 70 (F) in the context of interpreting hex (both mean "15"). That's plenty fair enough.
But then when talking about the alphabet, you don't allow for such a translation function. I could give you one that behaves quite reasonably: the meaning of character code 102 and the meaning of character code 70 are both the letter 'a'. Why do I have to keep them distinct?
IMO your argument boils down to "f and F are different because they mean different things" but you don't ever justify why that's the case.
To reiterate other posts, in English at least, it's almost never the case that capitalization changes meaning, just correctness according to the prescribed rules of English. The analogous thing to do in a programming language would be to make it case-sensitive but require that all identifiers follow a particular case. Of the languages I know, only Haskell comes anywhere close to doing this.
OK. Here's dictionary.com's definitions of f and F.
Oh, would you look at that! You get the same page for both.
Addendum (2010-11-04 13:31): And just to clarify, not only do you get the same page, but the only case-specific definitions don't apply when 'f' is used in a larger word. (Not that you can exactly say that the case-unspecific versions do apply...)
Much more clear is the fact that the dictionary (both dictionary.com and merriam-webster.com) consider "forum" and "Forum" to be the same word.
Admin
Admin
Admin
It's a different form, but I'm far from convinced that it has a significantly different meaning.
But OK then. Go ahead and explain the difference in meaning between, say, "bottle" and "Bottle".
Admin
Admin
I'm sure you can see where this is going but just in case, the output of calling this method is:
You might be asking why this prints false (if you really are as dumb as you seem). Well, it might be something to do with the fact that they consist of different characters. That makes them different. I really can't dumb this down any further for you.
Admin
Admin
Admin
This is why programming languages have Reflection. Look for all variables which contain the case insensitive string "mail" and begin with the letter E, and take the longest one.
Admin
Why anyone would name a creature "Bottle", though, is a much more difficult question; still, there's at least one being named "Blanket" that I'm sure we all know (about), several "Rainbow"s, and an "Apple" or "Moonbeam" or two.
Personally, I adore the German method of proper casing types...er, nouns. Perhaps you might recognize such overlay constructs as casing by the term "meta-data"; meta-data, as you no doubt know, and whose utility you hopefully understand, provides immediate, explicit context that is otherwise lacking or must be painstakingly built through backreferences or control trees.
Ranting against context and for a lack of discipline--in this profession, no less--is, at the very least... odd.
0_o
Admin
Admin
Admin
But I still don't see how handling e.g. strasse and straße as the same identifier won't lead to at least some confusion. Although at least in germany german identifiers or comments are not common anyhow - don't think I've ever seen something like that (japanese on the other hand like to do it, ah I see it as training ;) )
Admin
I guess Clojure is for obvious reasons; but you might have another in mind?
... then i assume you are a fan of Pointless Programming! (look it up in google, Akismet didn't like the link to wikipedia.) German sayings: "Bier soll man in Maßen trinken!" -> You shall drink beer in moderation. "BIER SOLL MAN IN MASSEN TRINKEN!" -> Drink beer in huge quantities!But of course correct is: "Bier soll man in einer Maß drinken!" -> Drink your beer in a stein!
Indeed modern languages support Unicode-characters in identifiers: http://www.scala-lang.org/node/5818CAPTCHA: incassum - shouldn't that be incbuttum?
Admin
Within reason. You won't find me flinging round stuff like
in earnest ;)
Nietzsche didn't have that problem, he wrote "Maasse" for the one, "Masse" for the other. Igitt! Am Ende etwa noch Weizen oder was? Export oder Pils, alles andere ist Pferdepisse. Und Bier trinkt man aus der Buddel, so und nich anners geiht dat.Admin
<blink>TRWTF is the fact that converting both sides of the equation ToUpper() or ToLower() is as easy as writing a blink tag no modern browser supports.</blink>
Admin
The reason it exists, however, is because it was easier and quicker to implement when K&R developed C. And seems to have persisted purely because of C.
But case-sensitive identifiers are nearly as WTF-y as the Unix case-sensitive filesystem, which is just embarrasing.
Admin
Less flippantly, I can almost as easily (I did have to type a couple words into Google and click a link) write a version that will reasonably print true. You still have to justify why you choose that version of string equality. "Programming languages should be case-sensitive because they do case-sensitive string comparisons." Wow, that's revelatory.
And that's about the only way you can answer that question. But it presents a problem: there's not really an equivalent to that distinction in programming languages. In a programming language, essentially every name is proper. Now, there are certainly distinctions between different types of identifiers in programming languages -- most particularly types and non-types -- but that's not what case distinguishes. In fact, when typing this out, I finally clarified in my mind what the difference actually is between programming languages and natural languages:When case matters in natural languages (at least English) it's almost always because only one case is correct. In the practically-rare case that a change in case actually changes the meaning (i.e. both are correct and the two cases have two different referents), it's because the language itself defines that an initial capital means a proper noun.
However, in a programming language (except Haskell), no case is considered more or less correct by the rules of the language. Furthermore, when case only distinguishes between two different referents, the rules of the language again don't specify any kind of context for them.
If you had a programming language that was case-sensitive but only permitted certain spellings in certain contexts (pick your favorite standard, e.g. the compiler itself enforced a lowerCamelCase for variables and UpperCamelCase for types), that would be pretty close to the sense that English is case-sensitive. But what programming languages do now... I think basically has no relation to what English does.
So I didn't know about Clojure; I was thinking of Guile. (And of course I already mentioned that you have to revise that up by one because of standard R6RS.)Admin
Well, one case I can think of is:
"The internet is down" vs. "The Internet is down"; Capital I Internet would be the global TCP/IP network; vs. a corporate wan scale network for the corporation you're in.
or "doctor who" vs. "Doctor Who"; capitalization can distinguish between a class, and a widely known specific instance that has no other name.
"The president picked up the phone." (and ordered lunch) vs "The President picked up The Phone." (and ordered a nuclear strike)
Admin
In any other conversation, if I wrote "thE mOOn laNDINgs WerE FAKeD" I can almost guarantee most people would consider the difference in meaning between that and "the moon landings were faked" to be of roughly the same measure as my grammatical or critical thinking skills.
Admin
who HAS had to do something like this? I haven't.
gladly, the languages that i use normally don't even allow that to happen.
Admin
Small "l" liberal? Although this probably doesn't work in the US, where liberal is widely used, somewhat paradoxically, as a four letter word.
Admin
As case is a typographical finesse, bold, italics and character size should also carry meaning for sensitive languages.
Admin
Just as a confirmation: Clojure is indeed case-sensitive: http://clojure.org/lisps
Admin
Admin
TRWTF is PHP and varible variables.
Admin
I use CamelCase variables, you case-insensitive clods!
Admin
By capitalizing idiotically, you're attaching meta-data regarding your intelligence and/or education to the content of the communication. Based on this at-a-glance meta-data, I need now assign only the most basic processing power to the task of understanding your communication, because the meta-data has already in large part invalidated whatever position you flounder to express.
Thus, capitalization enhances communication beyond mere content.
The same is true for capitalization in programming.
Well done, it attaches important (human-grokkable) meta-data to the symbols and declarations that don't inherently care about case.
Poorly done, it's confusing, sloppy, and casts doubt on the rigor and intelligence of the author: If the author can't be bothered to maintain consistent casing, how can I assume any effort was spent maintaining consistent logic?
Further, the appraised consistency of a system is additional meta-data that changes the interpretation of every next symbol or construct parsed, in a feedback loop that raises or lowers the determining appraisal. A "Running Tally", let's call it.
Following your path to conclusion by way of one example, virtually everyone that works on or near the web today agrees that standards (i.e. consistency) are A Good Thing™. Before we had them, or rather, before anyone followed them, The Bright Idea™ that tag soup should be parsed "as well as possible" was the norm. How did that end up?
Nightmarish, you say?
IE6, you say?
To shreds, you say?
We exist to find or build order in chaos. We are all driven to do so, or doomed to run in circles until we lie down and die. It is a HUGE component of life, and of the human condition.
Programmers are generally [expected to be] a little closer to the order end of the scale. Else, how can you even begin to trust them to solve your logic problems?
As I said before, ranting against context (and now, I add, consistency) and for a lack of discipline is very... odd.
0_o
Admin
Too much nested anything pisses me off, too. Classes, anyone?
Admin
Admin
The correct way to do this is to:
Admin
Computer is the most complex artifact made by humanity so far, a truly masterpiece. TRWTF is to allow average people to program it (if not morons).
shaman
Admin
Trick question. Java mandates that source code is in UNICODE. A Java compiler that eats only EBCDIC isn't. You lose.
Admin
FYI, the correct transliteration of ß in this case is sz:
Bier soll man in Maszen trinken.
Masse und Gewichte: Mass and weights Masze und Gewichte: Measures and weights
Tut Busze: Repent! Tut Busse: Do buses - erm, what?
Admin
Admin
Admin
Admin
clap._x = 0; clap._y = 0; clap.gotoAndPlay(0); //flash makes me want to vomit