Reply to Re: Case sensitivity in programming languages.

Your name:

Reply:


Posted by Tony Marston on 08/05/06 14:26

"Shelly" <sheldonlg.news@asap-consult.com> wrote in message
news:6VQAg.4686$0e5.635@newsread4.news.pas.earthlink.net...
>
> "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.

Imagine you are working on a program and you come across a refenece to a
function called readfile(). You don't know what it does exactly. so you look
it up Ten some time later you come across a reference to a function called
readFile(). You don't notice that one letter has changed case, so you don't
realise that it is not the same function as the one you remember and
therefore has completely different behaviour and possibly completely
different consequences. Later on you discover that there is a whole group of
*different* functions which have exactly thesame spelling, but where the
only difference is a change of case in one or two letters.

Let me ask you a simple question. If you were to write a series of functions
which performed some sort of file access which naming convention would you
choose?

Option (a) - readFileByIndex(), readFileSerially(), readNext() and
readPrevious()

Option (b) - readfile(), readFile(), ReadFile() and READFILE()

How many people think that option (b) is "kewl" and preferable to option
(a)?

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

Imagine you are writing code to transfer funds from one account to another,
which means that you need to hold two different account numbers. Which
naming convention would you choose?

Option (a) - account_from, account_to

Option (b) - account, Account

How many people think that option (b) is "kewl" and preferable to option
(a)?

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

Then you are blind. Or stupid. Or both.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

[Back to original 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

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