You are here: Re: Case sensitivity in programming languages. « PHP Programming Language « IT news, forums, messages
Re: Case sensitivity in programming languages.

Posted by Shelly on 08/04/06 23:39

"Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
news:eavli6$m75$1$8300dec7@news.demon.co.uk...
>
> "Shelly" <sheldonlg.news@asap-consult.com> wrote in message
> news:sdvAg.4257$0e5.295@newsread4.news.pas.earthlink.net...
>>
>> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
>> news:easnt1$67b$1$8300dec7@news.demon.co.uk...
>>>
>>> "Shelly" <sheldonlg.news@asap-consult.com> wrote in message
>>> news:CF8Ag.3576$0e5.3548@newsread4.news.pas.earthlink.net...
>>>> You have yet to demonstrate **WHY** you believe it produces errors.
>>>
>>> Instead of repeating myself I shall point you to
>>> http://www.tonymarston.net/php-mysql/case-sensitive-software-is-evil.html
>>
>> Excuse me, but having read the article at this link, it never addresses
>> the question I asked. Not ONCE did you show where case sensitivity
>> produces errors. Please go to
>> http://www.tonymarston.net/php-mysql/case-sensitive-software-is-evil.html
>> to locate you supposedly answered my question. Then, please, copy and
>> paste the statement that you think answers my question.
>>
>> I am reminded of what many of my students have done in the past. They
>> worked through a problem and gave an answer. The only thing wrong was
>> that it wasn't answering the question asked.
>
> 5th paragraph down
>
> 1) Is any language issued with a set of function names in different
> combinations of upper and lower case, such as 'dosomething()',
> 'doSomeThing()' and 'DOSOMETHING()', where each combination of case means
> something different?
>
> 2) Is any language issued with a set of variable names in different
> combinations of upper and lower case, such as 'box', 'Box' and 'BOX',
> where each combination of case means something different?
>
> Is the ability to have 3 different functions called 'dosomething()',
> 'doSomeThing()' and 'DOSOMETHING()' a good thing or a ad thing?
>
> Is the ability to have 3 different variables called 'box', 'Box' and 'BOX'
> a good thing or a bad thing?
>
> If ti is a bad thing then why is it allowed?

Tony, I repeat: Where in there have you documented that it leads to
problems? Certainly not in the opinions/questions you put forth above.
Please answer the question that I am asking, not put forth a set of
questions and opinions. Where is it that there are problems? Your
questions are not problems. In fact, I view them as advantages.

>
>>>
>>>> Frankly, any time I even mistyped a name, the compiler barfed out that
>>>> this was an undeclared variable or method.
>
> You get a warning if you reference an undeclared variable in PHP if your
> error reporting is set a the right level. You will always get a fatal
> error with an unreferenced function or method.
>
> BUT, and here is the point, PHP will allow you to create different
> variables and methods where the spelling is the same but only the case is
> different. Can you not see the problems that this can cause?

Not in the least! That was my question to you - what problems? In
languages more sophisticated than PHP (like Java), having the same named
function where the case is used to indicate the scope of the function has
decided advantages in readability and to quickly absorb the flow of someone
else's code. In something like PHP we could generate a convention where
starting with lower case and having Camel bumps would be for a function in
that page, while ine starting every word in caps could indicate a global
function. Great for understanding another programmer's code. Can you not
see the tremendous advantages that this provides? It would be better if
these conventions were enforced by the language. Then we truly would have
standardization. Again, can you not see the tremendous advantages that this
provides?

>
>>> Great. So your compiler did not allow you to reference anyhing in a
>>> different case. But did it actually allow you to create several variabes
>>> or methods with exactly the same spelling but different case? If the
>>> language does not allow it, then there is no real problem. It only
>>> becomes a problem when the language DOES allow it.
>>
>> The language DID allow case. It was PHP. By the way, you keep saying
>> that PHP is case insensitive.
>
> I have NEVER said that PHP is case insensitive. It is precisely because of
> its case sensitive nature that caused me to voice this opinion in the
> first pace.
>
>> That is not my experience. Run the following code snippet:
>>
>> <?php
>> $Junk = "this is junk";
>> echo "Junk = " . $Junk . "<br>";
>> echo "junk = " . $junk . "<br>";
>> ?>
>>
>> Clearly, PHP is case sensitive!
>>
>>>> No big deal. In **MY** OPINION, that little incovenience is
>>>> **GREATLY** outweighed by the ability to read someone else's code and
>>>> know right away what it is all about.
>>>
>>> Most languages don't use case to identify wheter something is a
>>> constant, variable, function, or method, so the use of case is
>>> irrelevant.
>>
>> The direction is to use case in modern languages to make these
>> distinctions.
>
> Why, when it is unnecessary? PHP does not need differences in case to tell
> the difference between a constant, a variable, a function and a method, so
> the transfer of this "convention" from an obviously inferior language is
> totally pointless.

Java is inferior to PHP or COBOL? What have you spiked your drink with
lately. (PHP is wonderful, and it has its place on a server -- but inferior
to Java?????)

>
>> Yes, it is currently by convention, but in JAVA, at least, it is a
>> UNIVERSALLY observed convention by ALL professional programmers.
>
> There is no such thing as a universal convention that is followed by ALL
> professional programmers. Different groups have their own different
> conventions.

In Java, any programmer that did not follow the universal naming rules would
be kicked in the butt. He would be considered a rank novice. EVERY
professional piece of code in Java that I have ever seen follows those
rules. The only time I have seen otherwise is coming from students learning
elementary Java -- and the instructor quickly straightens them out.

>>>> Apparantly the vast majority of professional programmers agree with me
>>>> because that is the direction in which all the newer languages are
>>>> going -- even something as new as PHP.
>>>
>>> But people won't complain unless they hit problems, and I've seen
>>> complaints from programmers who have suddenly been hit with a bug that
>>> turns out to be case-related. I still hold the opinion that case
>>> sensitivity causes problems instead of solving them, and I have seen no
>>> evidence to the contrary.
>>
>> ....and you still have not as yet detailed even a SINGLE problem caused
>> by
>
> The ability to have 3 different functions called readfile(), readFile()
> and ReadFile() causes problems.

Why do you believe in "proof by assertion". This has to be at least the
thirtieth time you have made this assertion. Repeating the assertion is not
proof. You have yet to document a single "problem" in this entire thread.

>
> The ability to have 3 different variables called box, Box and BOX causes
> problems.

See my previous comment.

> Or am I the only person who can see this?

Apparantly.

Shelly

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация