Article View: rec.games.programmer
Article #107Re: TP or C ? (was: Languages to program in and ports and blah and etc...)
From: Greg Alt
Date: Tue, 21 Jul 1992 08:53
Date: Tue, 21 Jul 1992 08:53
37 lines
1956 bytes
1956 bytes
In article <1992Jul20.203317.10143@esds.mdc.com>, bonney@esds.mdc.com (Greg Bonney) writes:
>I still like Pascal. Everybody says, "it was originally intended only to teach
>people how to program". And I say, "so what?" C apparently wasn't "good
>enough" in it's original incarnation either. Otherwise, why did they have to
>come up with ANSII C and C++? And C does sacrifice readability in favor of
>flexibility. The C "for" statement is especially weird; it's completely
>different from "for" statements I've seen in any other language.
The for statement may seem weird at first, but you can do neat things like this:
for(t=root;t!=NULL;t=t->next) puts(t->str);
to cycle through a linked list of strings, printing each as it goes.
Pascal would be something like:
t:=root;
repeat
begin
write(t^.str);
t:=t^.next;
end
until t=Nil
Sure the C is uglier looking, but an experienced C programmer would easily be
able to tell what it does. And once you know how for works, you don't have
to worry about using a "for", a "while", or a "repeat...until". You can just
use the for statement.
Also, in C, I wanted to check a couple of bits at memory location 0400:0017.
All I did was:
if(*((char *)0x04000017)&3) ...
How would you do that in pascal?
Technical Details
Message-ID:
<1992Jul21.025302.22788@hellgate.utah.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!hellgate.utah.edu!peruvian.utah.edu!galtReferences:
<1992Jul15.153252.25417@esds.mdc.com> <lzam8cd@lynx.unm.edu> <76207@ut-emx.uucp> <1992Jul20.203317.10143@esds.mdc.com>Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!hellgate.utah.edu!peruvian.utah.edu!galt From: galt%peruvian.utah.edu@cs.utah.edu (Greg Alt) Subject: Re: TP or C ? (was: Languages to program in and ports and blah and etc...) Date: 21 Jul 92 02:53:01 MDT Message-ID: <1992Jul21.025302.22788@hellgate.utah.edu> Followup-To: rec.games.programmer Reply-To: galt%peruvian.utah.edu@cs.utah.edu Organization: University of Utah, CS Dept., Salt Lake City References: <1992Jul15.153252.25417@esds.mdc.com> <lzam8cd@lynx.unm.edu> <76207@ut-emx.uucp> <1992Jul20.203317.10143@esds.mdc.com> Lines: 37