Re: Case sensitivity in programming languages.
- From: "Tony Marston" <tony@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 7 Aug 2006 12:35:19 +0100
"Jerry Stuckle" <jstucklex@xxxxxxxxxxxxx> wrote in message
news:u6SdnTyY7ogHikvZnZ2dnUVZ_sydnZ2d@xxxxxxxxxxxxxx
Tony Marston wrote:
"Jerry Stuckle" <jstucklex@xxxxxxxxxxxxx> wrote in message
news:Vt2dnWqwNJ0IMUnZnZ2dnUVZ_radnZ2d@xxxxxxxxxxxxxx
Gertjan Klein wrote:
Jerry Stuckle wrote:
Tony Marston wrote:
The ability to have 3 different functions called readfile(),
readFile() and ReadFile() causes problems.
The ability to have 3 different variables called box, Box and BOX
causes problems.
Or am I the only person who can see this?
Yep, you're the only person to see it, Tony. The rest of us are more
intelligent than that.
Please don't speak for me (or qualify "the rest of us", next time). He
is not the only one, and your disparaging comments don't make you look
all that intelligent. Although I'm not as persistent in this thread as
you and some others, I still largely agree with Tony that what he
describes above causes more problems than it solves. Neither you nor I
have any idea what the silent lurkers think.
Gertjan,
Fine. I really don't care what you think about me. My self esteem does
not depend on it. And I call stoopid asses like I see them.
I am completely tired of this one who keeps starting this argument. He
does it every three or four months - check the archives. And every time
he twists people's words, ignores valid counter arguments and doesn't
come up with any facts of his own. Just a stoopid troll.
Every time someone creates a post about case sensitve languages I reserve
the right to answer that post. The fact that my opiion differs rom yours
is no reason to insult me at every opportunity.
And every time you make a complete ass of yourself I reserve the right to
call you on it.
And I'm not insulting you. I'm calling a spade a spade. You have not
come up with any argument other than "I don't like it" or complete
bull*** such as "most programmers...".
I have said several times that the ability to create different functions and
variables with the *same spelling* but *different case* leads to obfuscated
and unmaintainable code, and should therefore be avoided. I am not the only
one with this opinion - check out item 21 on
http://mindprod.com/jgloss/unmainnaming.html
I wouldn't say that about Tony if he came up with some valid arguments,
examples and had an intelligent conversation about it. But he doesn't.
I have already documented my arguments, but you are too stupid to see
them.
You have documented nothing. You have stated your opinion and tried to
claim it is the same as "most programmers" or other such nonsense.
You have yet to come up with a single credible argument.
See my previous comment.
BOX is a defined constant
Box is a class name
box is a variable name - an object of type Box
Tony specifically described three *variables* called box, Box, and BOX.
Not a constant, classname, and variable.
That's the whole point. They are three variables with the same spelling
but dfferent case. Achange in case does not make one a constant, one a
variable and one a function. At least not in PHPP, and this *is* a PHP
newsgroup.
A perfect example of him twisting the meaning of other people's words, or
ignoring them completely.
Yes, you are the expert at that. I NEVER claimed I would use all three as
variables. Yet you have completely ignored that.
But you have said repeatedy that you would use the same word (i.e. the same
spelling) but different case to mean different things
You keep twisting my words but coming up with stupid arguments of your
own.
No, I don't need to twist your words, Tony. You do a great job of it
yourself.
As has been described many, many times in this thread. All three are
used in different contexts. But Tony tries to make them all one context.
Using the same name, with different case, for related things, as you
described above, is a sensible convention to do things -- in languages
that can't distinguish these things in another way, and that are case
sensitive. It does not mean that making a language case sensitive is a
good thing in itself.
It is a *convention* among certain programmers and not a *requirement* of
the language.
But Tony thinks a Class is the same as a CONSTANT is the same as a
variable. He just can't understand they are different things.
I did not say that. In a lot of languages (like PHP) it is possible to
create a constant, a variable, a function, a class, a class method and a
class property ALL WITH THE SAME NAME. How is this possible? Because each
one is declared and referenced differently by the use of SYMBOLS not
CASE. Thus I can create different things called 'foo' and reference each
individual one without the possbility of error, as in:
foo - constant
$foo - variable
foo() - function
class foo {...}
$object = new foo
$object->foo() - class method
$object>foo - class property
This demonstrates that I DO NOT need to use different case to ell the
difference between thedifferent objects.
No but now tell me - what is
"foo"
Is it a constant? a variable? a class name?
In PHP it can be any of those things. Each is defined in a different manner,
and each is referenced in a different manner. There is no confusion between
foo the constant, $foo the variable, foo() the function and $object->foo()
the class method.. PHP does not use different case to tell the difference,
and neither do most other languages. It may be a *convention* amongst
certain groups of programmers, but it is not a language *requirement*.
With case sensitivity, I know IMMEDIATELY
FOO is a constant
Foo is a class
foo is a variable
I don't need to search through the code to figure out what it is. In
fact, I don't even NEED to see the code.
In PHP the use of case in such a way is not necessary. FOO is a constant,
$FOO isa variable and FOO() is a function. PHP uses symbols to tell the
difference, not case.
I personally (slightly, not religiously) would prefer it if a language
had other means to distinguish between classes, constants, variables,
etc.,
You mean just like PHP already does? Without the use of case?
PHP does it just fine with case.
But it is not obligatory. With PHP (and most other languages) I can use
whatever case I like and the language will not complain for the smple reason
that it does not care. There are no *language rules* about how to use case,
only *programer conventions*.
rather than having to rely on programmers adhering to such
conventions (I've seen too many that don't). This is a personal
preference, to which I'm entitled, as you are to yours, obviously.
Trying to make such a preference into a universal truth (as both you and
Tony try to do) does not make a lot of sense to me.
Gertjan.
Yes, you're entitled to your preferences. The difference is you're not
trying to force the rest of the world to follow your preferences.
Neither am I. All I am saying is that I do not like people who use case
sensitive languages trying to force case sensitivity into ALL languages.
Not at all. I am not trying to force case sensitivity into COBOL or
FORTRAN, for instance. Unlike you, who are trying to force case
insensitivity into already-case-sensitive languages such as PHP.
Gotcha! Both PHP 4 and PHP 5 are case INsensitive when it comes to function
names and method names. If I try to define another function or method with
the same spelling but different case PHP will object. If I try to reference
a function or variable with the correct spelling but different case then PHP
will ignore the difference in case and refer to the *single* method or
function which has that *spelling*, regardless of any dfferences in *case*.
As for a language which has other means to distinguish between classes,
constants, variable, etc. - PHP has some of that. The '$' is used to
indicate variables. Personally i don't like it.
Personally I *LOVE* it. It means that I don't have to rely on different
case totell the difference.
So you would rather be forced to use an artificial construct to identify a
variable? It figures. Why not get your beloved COBOL to implement this
"feechur"?
I am not advocating any changes in COBOL. I a advocating against the
introduction of more case sensitivity into PHP jst to be "consistent" with
other people's conventions.
And you wouldn't like C, C++ or Java. But I guess those languages would
be too hard for you to understand anyway, so it doesn't matter.
In the projects I work on (both paid and open source), standards are set.
Programmers will follow those standards, or they will not be part of the
project.
I once had a highly paid programmer on a project who thought he was "too
good" for the project's standards. He was asked to follow them, then
warned by his manager. Unfortunately, he had to learn the hard way.
Interestingly enough, the project went better after he was let go then
while he was around.
Some standards just aren't worth following. They are not examples of "the
best there is" but "the best that we can do". I've quit jobs rather than
work with their primitive standards. More than once.
And you wouldn't last on any of the projects I've been on - or those of
any other professional project manager I know. You also wouldn't last
long with any of the companies I've consulted for.
I see. All they require are sycophantic "yes" men who never have an
original idea, who follow what other people say without question. That's my
idea of hell.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
.
- Follow-Ups:
- Re: Case sensitivity in programming languages.
- From: Jerry Stuckle
- Re: Case sensitivity in programming languages.
- References:
- Re: Case sensitivity in programming languages.
- From: Chung Leong
- Re: Case sensitivity in programming languages.
- From: Tony Marston
- Re: Case sensitivity in programming languages.
- From: Miguel Cruz
- Re: Case sensitivity in programming languages.
- From: Shelly
- Re: Case sensitivity in programming languages.
- From: Tony Marston
- Re: Case sensitivity in programming languages.
- From: Shelly
- Re: Case sensitivity in programming languages.
- From: Tony Marston
- Re: Case sensitivity in programming languages.
- From: Shelly
- Re: Case sensitivity in programming languages.
- From: Tony Marston
- Re: Case sensitivity in programming languages.
- From: Jerry Stuckle
- Re: Case sensitivity in programming languages.
- From: Gertjan Klein
- Re: Case sensitivity in programming languages.
- From: Jerry Stuckle
- Re: Case sensitivity in programming languages.
- From: Tony Marston
- Re: Case sensitivity in programming languages.
- From: Jerry Stuckle
- Re: Case sensitivity in programming languages.
- Prev by Date: Re: Case sensitivity in programming languages.
- Next by Date: Re: Case sensitivity in programming languages.
- Previous by thread: Re: Case sensitivity in programming languages.
- Next by thread: Re: Case sensitivity in programming languages.
- Index(es):