Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Why Case Sensitive?

Reply
Thread Tools

Why Case Sensitive?

 
 
Dik T. Winter
Guest
Posts: n/a
 
      07-20-2007
In article <(E-Mail Removed)> Mark McIntyre <(E-Mail Removed)> writes:
> On Thu, 19 Jul 2007 15:37:17 +0530, in comp.lang.c , santosh
> <(E-Mail Removed)> wrote:
> >On Thursday 19 Jul 2007 3:19 pm, Bart <(E-Mail Removed)> wrote in
> >message <(E-Mail Removed) .com>:
> >
> >> Why is C case sensitive?
> >>

> >C is case sensitive because computing systems are naturally case
> >sensitive.

>
> This is true NOW, but was not generally true prior to 1970 or so. The
> first computers I worked with didn't have much in the way of lowercase
> letters.


The first computers *you* worked with... In 1965 Ascii was standardized
for the second time and that version had lower case letters. And in
1959 IBM Stretch (7030) was first purchased, which also had lower case
letters. I think around 1970 almost *all* computers had lowercase
letters. Whether you could print them on the line printers of that time
is questionable, but they could certainly be displayed on the terminals
when they were tube terminals. The first computer I worked on (back in
1969) was case sensitive. But have a look at
<http://homepages.cwi.nl/~dik/english/codes/7tape.html#start>
and find a host of very old papertape codes that include lower case
letters. The MC Flexowriter code was the first code I did use.

But the actual question is easy to answer. C ultimately derives from
Algol, and that was case sensitive. And the reason for that is easy
to explain, the computers to implement Algol were mostly in Europe, and
there case distinction was quite common in the paper-tape codes (the
most frequently used device to input programs). Using additional
translations in the compiler to make it case insensitive was prohibitive,
as memory space was scarce.

> There's a reason why Basic wasn't case-sensitive, and I
> recall that F66 required all upper case.


F66 derives from a much older language, and I think that even F66 allows
both cases in strings. Basic probably is single case (yes, originally it
*was* single case), because that was much easier.

> >Real world is case sensitive

>
> Not entirely true either... The Romans and Greeks lived in
> case-insensitive worlds.


Oh. There are many scripts that still are used and do not even have a
case distinction. But that is entirely different.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
 
Reply With Quote
 
 
 
 
Gordon Burditt
Guest
Posts: n/a
 
      07-20-2007
>Why is C case sensitive?
>
>I know it's a bit late to change it now but there would seem to be far
>more advantages in ignoring letter case in source code.
>
>In real life such a situation would be ridiculous (eg. the 16 ways of
>writing my name) and, in some cases, frightening.


Some people are trying to use this feature of English to claim that they
are not subject to the US income tax.

>Is it to avoid having to think up new identifiers? And how would you
>distinguish case when reading out bits of code over the phone for
>example?


You don't read out bits of code over the phone. If you ever read out
*passwords* over the phone, you can take a long time doing it, and it's
still horribly error-prone. ("Upper case B as in Bastard, open square
bracket, control lowercase R as in Retard, digit nine, ....")

Some case-related questions for Standard C:

What is the maximum number of cases allowed? What is the maximum
number of cases actually implemented in a locale for a real language?
(e.g. Tholian doesn't count. Klingon might as some people have
tried to flesh it out as a complete language. Real human languages
count, even ones that are dead like ancient Egyptian.)


Is it permissible in a standard C implementation that (where c is a char)
c != toupper(c) for all values of c where isalpha(c) != 0,
c != tolower(c) for all values of c where isalpha(c) != 0,
and c == toupper(toupper(toupper(c))) for all values of c where isalpha(c) != 0?

(in other words: there's three cases, toupper() does a "circular
right rotate case", and tolower() does a "circular left rotate
case". There's no "uppermost case" or "lowermost case".)

 
Reply With Quote
 
 
 
 
Flash Gordon
Guest
Posts: n/a
 
      07-20-2007
Malcolm McLean wrote, On 19/07/07 22:34:
>
> "August Karlstrom" <(E-Mail Removed)> wrote in message
> news:_wQni.4443$(E-Mail Removed)...
>> Malcolm McLean skrev:
>>> I use the convention that if a function depends on the standard
>>> library and nothing else then it is all lowercase, whilst if it calls
>>> platform-specific functions it starts with an uppercase letter.

>>
>> If the implementation changes you may end up with naming inconsistency.
>>

> If a function does no IO then there is no reason for it to call any
> platform-specific functions, except very rarely when for efficiency
> reasons a calculation cannot be coded in C. So separate your functions
> from your procedures, and the situation cannot arise.


What does separating functions and procedures have to do with it? Apart
from implying you are using the term function in a non-C way which means
you should have stated that up front if you want to be understood.

> Unfortunately reality sometimes kicks in. For instance a lot of long
> procedures work fine in development, but for commercial use they need to
> support progress bars and user cancels. Error conditions can also be a
> problem, as can dependencies on big datasets. Generally however the
> system works.


If you think any of the above don't come in to play in development then
you should not be involved in SW development, since everything you
mention should have been in the requirements and design before you even
consider starting your source code editor.

> Then of course the standard does provide methods for basic IO, which can
> break.


Anyone with any knowledge knows that any IO operation can fail. This is
why where it is really critical you have multiple physical IO paths. So
of course the standard C IO functions can fail.
--
Flash Gordon
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      07-20-2007
On Friday 20 Jul 2007 4:17 am, Mark McIntyre
<(E-Mail Removed)> wrote in message
<(E-Mail Removed)>:

> On Thu, 19 Jul 2007 15:37:17 +0530, in comp.lang.c , santosh
> <(E-Mail Removed)> wrote:
>
>>On Thursday 19 Jul 2007 3:19 pm, Bart <(E-Mail Removed)> wrote in
>>message <(E-Mail Removed) .com>:
>>
>>> Why is C case sensitive?


[ ... ]

>> Real world is case sensitive

>
> Not entirely true either... The Romans and Greeks lived in
> case-insensitive worlds.


Yeah I know, as is my native language, but I was talking about
English, since it comes closest to a global language, if there ever
was one.

 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      07-20-2007
Gordon Burditt said:

<snip>

> You don't read out bits of code over the phone.


Well, maybe *you* don't. I have done so on several occasions.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      07-20-2007
On Fri, 20 Jul 2007 00:57:24 GMT, in comp.lang.c , "Dik T. Winter"
<(E-Mail Removed)> wrote:

>In article <(E-Mail Removed)> Mark McIntyre <(E-Mail Removed)> writes:
> > On Thu, 19 Jul 2007 15:37:17 +0530, in comp.lang.c , santosh


> > first computers I worked with didn't have much in the way of lowercase
> > letters.

>
>The first computers *you* worked with... In 1965 Ascii was standardized
>for the second time and that version had lower case letters.


Quite possibly. However the terminals (?VT52 and Tek4100?) on our Vax
cluster didn't provide any trivial way to enter lower case, and
neither VMS nor Fortran gave a hoot anyway.....

>they could certainly be displayed on the terminals
>when they were tube terminals.


The keyboards I used in Oxford in the early *eighties* didn't even
HAVE lowercase letters on the keyboards - and the teletype paper only
printed Ucase anyway....

>But the actual question is easy to answer. C ultimately derives from
>Algol, and that was case sensitive.



> > There's a reason why Basic wasn't case-sensitive, and I
> > recall that F66 required all upper case.

>
>F66 derives from a much older language, and I think that even F66 allows
>both cases in strings.


Yes, thats true. As far as I recall F66 required all code to be
uppercase. I recall being very happy when we got an upgrade which
allowed mixed case because by that time most of my coding was done via
a terminal emulator running on a Sun-1 or PCXT which of course /did/
have mixed case...
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      07-20-2007

"Flash Gordon" <(E-Mail Removed)> wrote in message
>> Unfortunately reality sometimes kicks in. For instance a lot of long
>> procedures work fine in development, but for commercial use they need to
>> support progress bars and user cancels. Error conditions can also be a
>> problem, as can dependencies on big datasets. Generally however the
>> system works.

>
> If you think any of the above don't come in to play in development then
> you should not be involved in SW development, since everything you mention
> should have been in the requirements and design before you even consider
> starting your source code editor.
>

If you program business logic then you have requirements and design. If you
are doing scientific programming then the interest is in proving the
algorithm. So you are not interested in UI issues, only if the general
approach works. However eventually the function will have to be packaged for
a non-programming user.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      07-20-2007
Malcolm McLean wrote, On 20/07/07 21:44:
>
> "Flash Gordon" <(E-Mail Removed)> wrote in message


Please don't snip attributes for still included text. You wrote the below.

>>> Unfortunately reality sometimes kicks in. For instance a lot of long
>>> procedures work fine in development, but for commercial use they need
>>> to support progress bars and user cancels. Error conditions can also
>>> be a problem, as can dependencies on big datasets. Generally however
>>> the system works.

>>
>> If you think any of the above don't come in to play in development
>> then you should not be involved in SW development, since everything
>> you mention should have been in the requirements and design before you
>> even consider starting your source code editor.
>>

> If you program business logic then you have requirements and design. If
> you are doing scientific programming


Then you also have requirements (or you are not required to write the
code), and the code still needs to be designed.

> then the interest is in proving the
> algorithm. So you are not interested in UI issues, only if the general
> approach works. However eventually the function will have to be packaged
> for a non-programming user.


So you design it to be able to but in a fancier user interface. It's
what is called designing for expected extensions and saves a lot of work.

In any case, you *still* need to handle errors, because if you don't you
don't know if the results you get are due to uncaught errors or not.
--
Flash Gordon
 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      07-20-2007

"Flash Gordon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)-gordon.me.uk...
>> If you program business logic then you have requirements and design. >>
>> If you are doing scientific programming

>
> Then you also have requirements (or you are not required to write the
> code), and the code still needs to be designed.
>

It doesn't work like that.
I've had this before from people who work in businessy type systems and
think that games can be formally specified using the same techniques. They
can't and no games company does that, for lots of reasons. One is that no
one cares if output is correct, just whether it plays. Another is that you
don't know how well the program is going to perform until it is in quite an
advanced stage of development, at which point you decide how much geometry
to throw at the rasteriser.
Scientific programming is a bit different to games, but again you can't
generally specify the program and then write it. If you can do that then
it's not reasearch.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      07-20-2007
Flash Gordon wrote:
> Malcolm McLean wrote, On 20/07/07 21:44:
>>
>> "Flash Gordon" <(E-Mail Removed)> wrote in message

>
> Please don't snip attributes for still included text. You wrote the below.
>
>>>> Unfortunately reality sometimes kicks in. For instance a lot of long
>>>> procedures work fine in development, but for commercial use they
>>>> need to support progress bars and user cancels. Error conditions can
>>>> also be a problem, as can dependencies on big datasets. Generally
>>>> however the system works.
>>>
>>> If you think any of the above don't come in to play in development
>>> then you should not be involved in SW development, since everything
>>> you mention should have been in the requirements and design before
>>> you even consider starting your source code editor.
>>>

>> If you program business logic then you have requirements and design.
>> If you are doing scientific programming

>
> Then you also have requirements (or you are not required to write the
> code), and the code still needs to be designed.
>

But the design may be done in code...

--
Ian Collins.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
"Case 1 To 5" in Select case, giving Error!!. Why? Lakshmi Narayanan.R ASP General 10 03-04-2005 01:13 AM
how to case select with case-insensitive string ? Tee ASP .Net 3 06-23-2004 07:40 PM
Possible to turn on/off cookieless sessions dynamically on a case by case basis at run-time? Steve Franks ASP .Net 2 06-10-2004 02:04 PM



Advertisments