|
Posted by Jerry Stuckle on 08/07/06 19:09
Tony Marston wrote:
>
>
> 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
>
Yes, you have espoused this BS multiple times. Now you quote some
unknown programmer with no documented credentials to back up your claim.
How long did you have to search the internet to find this "essay"? Or
is it your own under an assumed name?
I would rather go by recognized experts - like K & R, the Bjorn
Stroustrop, the initial designers of Java at Sun, the developers of PHP,
the folks who developed the XML spec, and even the majority of the
people who have responded on this thread. They have done a lot more for
programming than your unknown essayist - or you, for that matter.
And they all agree that case sensitivity is a good thing.
You don't have to use PHP or any other case sensitive language. Just go
back to your beloved COBOL.
>>
>>You have yet to come up with a single credible argument.
>
>
> See my previous comment.
>
You still have yet to come up with a single credible argument. See my
previous comment.
>>>
>>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
>
Yes, I did. And I'm not going to repeat myself again.
>>>>
>>>>>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.
>
True. And these conventions take advantage of case sensitivity.
>>
>>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*.
>
Not if you follow accepted programming standards.
>
>>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.
>
Only if you add () or $ to every instance in your documentation.
>
>>>>>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.
>
Sure does. And I'm glad it does.
>
> 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*.
>
No, there are not language rules. They are programming conventions
(standards) developed to take advantage of the rules. And standards are
a good thing.
>
>>
>>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*.
>
True, but they are case sensitive in everything else - variables,
constants and class names, for instance. And you're trying to get
people to make those case-insensitive, also.
Personally, I would MUCH rather have PHP functions be case sensitive, also.
>>>
>>>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.
>
No, but you're trying the force the rest of us to use case-insensitive
work. PHP is already mostly case sensitive. The only place it isn't is
in function names. That is rather inconsistent.
>
>>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.
>
No, we do it because it's a better way of programming. And you wouldn't
last a week with the programmers I have worked with.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|