home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!sschaem
- From: sschaem@teleport.com (Stephan Schaem)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: PPC compilers
- Date: 10 Jan 1996 17:36:32 GMT
- Organization: Teleport - Portland's Public Access (503) 220-1016
- Message-ID: <4d0tf0$i4i@maureen.teleport.com>
- References: <john.hendrikx.40ka@grafix.xs4all.nl> <jasonb.820051107@cs.uwa.edu.au> <VBzVx*M3f@yaps.rhein.de>
- NNTP-Posting-Host: julie.teleport.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Arno Eigenwillig (arno@yaps.rhein.de) wrote:
- : In article <4cqrti$f6u@maureen.teleport.com>, Stephan Schaem writes:
-
- : > I dunno , I just find it puzzling to declar variable without giving
- : > a care of what its usage will be. You programing practice is VERY unwise...
-
- : Don't distract, this was not the point. Intentional misunderstandings
- : prove nothing.
-
- It was about: "C is better because you dont need to know your variable type"
- Not only I need to know my variable type, but I need to know my type
- definition... That in C or asm... I wont for example try to use the C
- operator on strcutre that need supprot routine... I know my variable is
- of type X and I know X is a strcture.
-
- : > programing on asuption (polymorphism?)
-
- : That I'd call "spelling on assumption". :)
-
- Human are smarter then compiler.. I assum :)
-
- : > If the header file was programmed correctly it would not use ANSI data
- : > type directly....
-
- : What are you talking about? <time.h> is provided as part of the
- : compiler. The compiler is a beast that translates a valid C source
- : code defining an algorithm for an abstract machine into actual machine
- : code for an actual machine.
-
- I'm talking about doing operation on a strcuture element. if the element
- was defined has a ulong, then one decide its a float you will have to
- update your code too to use float.
-
- : The semantics of the abstract machine are that there are some simple
- : types (short, int, long, unsigned short, unsigned int, unsigned long,
- : char, signed char, unsigned char, float, double, long double). You can
- : derive compound types from simple or compund types (structs, unions,
- : arrays, pointers). Additionally there are function pointers.
-
- Yes...
-
- : Then there are objects of these types and operations on these objects.
- : Certain guarantees about the properties of types and operations are
- : made.
-
- Yes... you better, otherwise you program in the dark.
-
- : Then there is clock_t (and similar beasts like size_t, prtdiff_t).
- : clock_t is a typedef for one out of a set of simple types, but it is
- : not said which one. Again, there are objects of type clock_t and
- : operations defined for them with specific semantics.
-
- I dont rememner reading clock_t was a type of type ulong...
-
- : The idea behind clock_t is that it is a data type suitable for storage
- : of the system's clock's value and certain operations on it. These
- : operations are defined in an abstract way, independant of a specific
- : choice what simple type clock_t may actually be.
-
- you might not care clockt_t went from 32bit long to a 64bit long,
- but I you would if it become a 32digit bcpl.
-
- : The obvious advantage is that these conception of the abstract machine
- : allows C source code to be portable to many different actual machines,
- : no matter what strange encoding they use for clock_t.
-
- No matter what strnage encoding... how about a pointer to a string?
-
- : Dave called it "polymorphism". I call it "data encapsulation". Anyway,
- : it's a basic concept of decent programming, and not having understood
- : it is no crime, but one probably shouldn't go around demonstrating it
- : everywhere in the most embarrassing way. Eh?
-
- The point he wanted to prove is that you dont need to care about your
- variable type, and your variable type definition. I just desagree.
- He enver said that undefined type require support function.without that
- that claim make no sense in C. There is limit on C operator and type.
-
- Stephan
-