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

Posted by Jerry Stuckle on 08/06/06 16:11

Tony Marston wrote:
> "Shelly" <sheldonlg.news@asap-consult.com> wrote in message
> news:V_2Bg.10122$157.5481@newsread3.news.pas.earthlink.net...
>
>>I don't know if I should even respond to this but I will. I guess that is
>>because I am a "moron (sic)".
>>
>>"Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
>>news:eb29q4$htf$2$8300dec7@news.demon.co.uk...
>>
>>>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)?
>>
>>First, and here is what you CONTINUOUSLY fail to get through your head.
>>Any (professional) programmer who has worked for any small time with case
>>sensitivity, would NEVER confuse readfile(), readFile(), ReadFile() and
>>READFILE(). He/She would AUTOMACTICALLY assume they are different
>>functions that do more less the same thing but have different scopes and
>>areas of applicability. THERE IS NO CONFUSION. The only confusion is by
>>programmers who refuse to learn that there is a whole new world out there.
>>There is a saying, "adapt or die". Please read "Who Moved My Cheese".
>
>
> I disagree. Only a small number of programmers work with languages which
> allow such a thing, therefore most programmers would expect readfile(),
> readFile() and ReadFile() to be the same thing. To delibereately create
> different functions with the same spelling but different case is to create
> obfuscated and unmaintainable code. In my opinion, of course.
>

Prove this statement. References to numbers other than the ones Tony
made up.

>
>>What would I do? I would use functions readFileByIndex(),
>>readFileSerially(), readNext() and readPrevious() to do the specific jobs
>>involved.
>
>
> That's a step in the rght direction, to follow the conventions that have
> existed amogst ALL good programmers for decades.
>

Fortunately better conventions have come along. Do you ride a horse to
work? They were around long before automobiles!

>
>> I would also use readfile(), readFile(), ReadFile() and READFILE() to do
>>a more generalized read, but where the scopes are different and I would do
>>that according to the accepted conventions.
>
>
> Accepted conventions are to give different funtions different names, not the
> same name with different case.
>

In COBOL. In case sensitive languages it's quite common to give
functions which do basically the same thing the same name. And in OO
languages it's required for polymorphism (oops, sorry - that word is too
long for your meager brain to understand)

>
>> That is the meaning of PROFESSIONAL.
>
>
> You mean a professional obfuscator.
>

No, a PROFESSIONAL - versus a has-been Neanderthal who doesn't have the
intelligence to understand new techniques - or at least too stubborn.
Or a PROFESSIONAL TROLL who starts threads like this just to see his
name in print.

You have a real problem with self esteem, Tony. I suggest you seek
professional help. Then find another career. I hear the circus needs
someone to clean up after their elephants.

>
>>So, Tony, it is not an either-or.
>>
>>As for your insulting me, I will give you enough time to apologize to me.
>>After all I, as a programmer, fall into the category of "any programmer
>>who". After that time, if you have not apologized, you will be deposited
>>into my killfile.
>
>
> Oh good. Then will not be subjected to any more of your stupud ideas.
>

Yes, I can only wish we will not be subjected to your asinine comments.

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

"pevios" ROFLMAO! Can't even figure out how to use a spell checker!

>
>>>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)?
>>
>>Neither. I would name them accountSource accountDest. OK, that is
>>nitpiking. I would choose A. However, that is NOT the purpose of account
>>vs. Account. It would be a poor use of case sensitivity.
>
>
> So you agree that option (a) is better and opton (b) is not good practice.
> Then why allow option (b) n the first place if it's use leads to obfuscated
> and unmaintainable code?
>

B would not be used like you claim. Stop twisting what other say, Tony.

Account would be the class name. account, accountSource, accountDest
and so on would be objects of the class Account.

>
>>>>>Or am I the only person who can see this?
>>>>
>>>>Apparantly.
>>>
>>>Then you are blind. Or stupid. Or both.
>>
>>I didn't read the whole thing before starting my response and getting to
>>ths. I take back my apology statement above. Me, reading you insulting
>>me once, shame on you. Me, reading you insulting me twice, shame on me.
>>Kerplunk!!!!! (The sound of another obnoxious, egocentric, self-important,
>>prick dropping into my killfile).
>
>
> Bye bye. It's been nice knowing you (NOT!)
>

I must admit, though, your comments have been creating great humor
amongst some fellow programmers any myself. I'm may even include some
of these comments in my class material to show students how dense
someone can be. Of course, I wouldn't dream of doing it without giving
the Great Tony Marston full credit.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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