Article View: rec.games.programmer
Article #171Re: TP or C ?
From: Khan
Date: Fri, 24 Jul 1992 13:19
Date: Fri, 24 Jul 1992 13:19
49 lines
1502 bytes
1502 bytes
In article <1992Jul23.182026.57480@cc.usu.edu> sl8nl@cc.usu.edu writes:
>> what I want added to C:
>> add scope control with '.' ie:
>> int a;
>> blort()
>> {
>> int a;
>> a=1; /* set LOCAL A=1 */
>> .a=1; /* set GLOBAL A=1 */
>> }
>>
>
>Turbo Pascal already has that feature <sneer :)>
GACK!! By allowing a programmer to have umpteen variables with the same
name, Pascal actually ENCOURAGES you to write unintelligible code!!!
Of course, C doesn't NEED that kind of scope control, because a C
programmer would have written the above code fragment like this:
// begin code fragment
int a;
void blort(void)
//
// B L O R T
//
// Description: A stupid example code snippet for posting to a Usenet
// newsgroup.
//
// Parameters:
// None.
//
// Global Variables Used:
// a
//
{
int b;
b = 1; // set LOCAL variable to 1
a = 1; // set GLOBAL variable to 1
}
// end code fragment
;-)
Technical Details
Message-ID:
<BrwACA.1ru@news.cso.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!usenetReferences:
<1992Jul23.182026.57480@cc.usu.edu> <cg.0afn@ami-cg.UUCP> <1992Jul15.153252.25417@esds.mdc.com> <1992Jul23.213310.17575@ccu1.aukuni.ac.nz>Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!usenet From: tmkk@uiuc.edu (Khan) Subject: Re: TP or C ? References: <1992Jul23.182026.57480@cc.usu.edu> <cg.0afn@ami-cg.UUCP> <1992Jul15.153252.25417@esds.mdc.com> <1992Jul23.213310.17575@ccu1.aukuni.ac.nz> Message-ID: <BrwACA.1ru@news.cso.uiuc.edu> Sender: usenet@news.cso.uiuc.edu (Net Noise owner) Organization: University of Illinois at Urbana Date: Fri, 24 Jul 1992 13:19:21 GMT Lines: 50