February 26, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard Krehbiel | "Richard Krehbiel" <krehbiel3@comcast.net> wrote in message news:a5fmn2$2iod$1@digitaldaemon.com... > > can not be distinguished by case alone. Having defined 'Foo', the definition or use of 'foo' would be prohibited. > > Um - okay, now I'm further puzzled. After having defined "Foo", attempting > to define "foo" is the same as attempting to redefine "Foo". What makes this different from case-insensitivity? It differs in that you cannot write "foo", or "FOO", but only "Foo" - as it's spelled by the one who'd declared it. |
February 26, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:a5fs1m$2kur$1@digitaldaemon.com... > "Richard Krehbiel" <krehbiel3@comcast.net> wrote in message news:a5fmn2$2iod$1@digitaldaemon.com... > > > > can not be distinguished by case alone. Having defined 'Foo', the definition or use of 'foo' would be prohibited. > > > > Um - okay, now I'm further puzzled. After having defined "Foo", > attempting > > to define "foo" is the same as attempting to redefine "Foo". What makes this different from case-insensitivity? > > It differs in that you cannot write "foo", or "FOO", but only "Foo" - as it's spelled by the one who'd declared it. Oh, I get it now. Case sensitivity with an attitude. I personally think that's going the wrong direction. The need for case-*in*sensitivity includes my being able to spell an identifier without being able to remember exactly how the capitalization works. For example, here's the trouble I have with MixedCase identifiers, where each "component" of the identifier is capitalized. I can figure out the proper capitalization of English words. But what about acronyms? Proper English (apparently) says acronyms are spelled in CAPS, as in "SQL" and not "Sql". But since the "SQL" in "SQLExecute" is a component word, should it be "SqlExecute", to conform to capitalization conventions? And then, I also offer into evidence the function "SQLNativeSql" (and BTW these are real examples from Microsoft's ODBC API) which by itself uses *both* conventions. As much as I'd like to say "shoot these API designers and fix the conventions," this was Microsoft and they're not going to be responsive. So I say, the language can save us from this madness and ignore the identifier case. PS: My C coding conventions prohibit any capitals in identifiers, except some #defines and enumeration constants which are UPPER CASE - and yet, there are plenty of #defines which have function-like behavior and are therefore lower case. Sigh. -- Richard Krehbiel, Arlington, VA, USA rich@kastle.com (work) or krehbiel3@comcast.net (personal) |
February 26, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russell Borogove | <cheer> Good idea! -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ] |
February 26, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | "Sean L. Palmer" <spalmer@iname.com> wrote in message news:a5e1a2$1q52$1@digitaldaemon.com... > In C I dislike using the C standard library functions (even C++ STL stuff annoys me) since it doesn't use my preferred capitalization style, which coincidentally is the same as Java uses. (I don't use Java) > > I just don't see why case is such a big deal, I'd really prefer that case not matter at all. If someone writes INTEGER all over I can always global-search-and-replace that crap. The *only* reason I can think of is it > allows the symbol lookups in the compiler to be a teeny bit faster, Pascal parsers are a bit more complicated due to this case insensitivity. > > Sean > Yes, I agree. Basically, case sensitivity will enforce always writing the same identifier the same way (probably A Good Thing). However, it makes it impossible to write consistent code when using functions from different programmers that used different conventions for the use of case, as in the standard C libraries and the Win32 API: printf(), CreateWindowEx(), (probably A Bad Thing). Seems we have a tie... -- Stijn OddesE_XYZ@hotmail.com http://OddesE.cjb.net __________________________________________ Remove _XYZ from my address when replying by mail |
February 26, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Barry Pederson | "Barry Pederson" <bp@barryp.org> wrote in message news:3C7B0559.8060205@barryp.org... > Russell Borogove wrote: > > Karl Bochert wrote: > > > >> Case-uniqueness is a third possibility: Case is significant, but > >> identifiers > >> can not be distinguished by case alone. Having defined 'Foo', the > >> definition or use of 'foo' would be prohibited. > >> > > > > I could accept that, and would prefer it to case-insensitivity. It would lead to writing things like: > > > > HANDLE handle_; > > > > or > > > > HANDLE myHandle; > > > > where one might want to write > > > > HANDLE handle; > > > I like that idea! I've always hated case-sensitivity because of the way people abuse it with things like "Handle handle;", but have never minded being > forced to use consistent capitalization myself (I think it's good to have at > least certain amount of discipline when writing code) > > This would give you the best of both worlds, ruling out both kinds of laziness: using confusing names, and just plain sloppy writing. Well... I suppose if D were this way, then a smart editor could correct the case of any identifier the user types in, since it's known to be distinct (rather like Visual Basic does). And, I could write a preprocessor that would fix the case of each identifier prior to compilation. Sheesh. I though programming languages were supposed to make coding easier. -- Richard Krehbiel, Arlington, VA, USA rich@kastle.com (work) or krehbiel3@comcast.net (personal) |
February 27, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to OddesE | >
> Yes, I agree.
> Basically, case sensitivity will enforce always writing the same
> identifier the same way (probably A Good Thing). However, it
> makes it impossible to write consistent code when using functions
> from different programmers that used different conventions for
> the use of case, as in the standard C libraries and the Win32
> API: printf(), CreateWindowEx(), (probably A Bad Thing).
> Seems we have a tie...
>
When maintaining complex code I have often found different capitalization styles to be a good thing. It serves to tag the code with the authors identity. I often intentionally use a differing style for the same reason.
Karl
|
February 27, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Karl Bochert | "Karl Bochert" <kbochert@ix.netcom.com> wrote in message news:1103_1014830062@bose...
> When maintaining complex code I have often found different capitalization styles to be a good thing. It serves to tag the code with the authors identity. I often intentionally use a differing style for the same reason.
I've always thought there are comments specially for that =)
|
February 28, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:a5jae1$166p$1@digitaldaemon.com... > I've always thought there are comments specially for that =) Comments? What are those? |
February 28, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> wrote in message news:a5kscb$1qri$1@digitaldaemon.com... > "Pavel Minayev" <evilone@omen.ru> wrote in message news:a5jae1$166p$1@digitaldaemon.com... > > I've always thought there are comments specially for that =) > > Comments? What are those? // You might have forgotten that "<g>"? =) |
February 28, 2002 Re: Can we discuss case-sensitivity? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> wrote in message news:a5kscb$1qri$1@digitaldaemon.com... > > "Pavel Minayev" <evilone@omen.ru> wrote in message news:a5jae1$166p$1@digitaldaemon.com... > > I've always thought there are comments specially for that =) > > Comments? What are those? > > :) I might 'label' my functions too: ODDPrint(); ODDOpenTable(); ODDAnotherFunc() OpenGL uses something like it: glBegin(); gluLookAt(); glutBlahBlah(); where glu and glut are libraries that extend OpenGL. I don't like it though.... -- Stijn OddesE_XYZ@hotmail.com http://OddesE.cjb.net __________________________________________ Remove _XYZ from my address when replying by mail |
Copyright © 1999-2021 by the D Language Foundation