home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 694 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.8 KB

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 10 Jan 1996 17:36:32 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4d0tf0$i4i@maureen.teleport.com>
  8. References: <john.hendrikx.40ka@grafix.xs4all.nl> <jasonb.820051107@cs.uwa.edu.au> <VBzVx*M3f@yaps.rhein.de>
  9. NNTP-Posting-Host: julie.teleport.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Arno Eigenwillig (arno@yaps.rhein.de) wrote:
  13. : In article <4cqrti$f6u@maureen.teleport.com>, Stephan Schaem writes:
  14.  
  15. : >  I dunno , I just find it puzzling to declar variable without giving
  16. : >  a care of what its usage will be. You programing practice is VERY unwise...
  17.  
  18. : Don't distract, this was not the point. Intentional misunderstandings
  19. : prove nothing.
  20.  
  21.  It was about: "C is better because you dont need to know your variable type"
  22.  Not only I need to know my variable type, but I need to know my type
  23.  definition...  That in C or asm... I wont for example try to use the C
  24.  operator on strcutre that need supprot routine... I know my variable is
  25.  of type X and I know X is a strcture. 
  26.  
  27. : >  programing on asuption (polymorphism?)
  28.  
  29. : That I'd call "spelling on assumption". :)
  30.  
  31.  Human are smarter then compiler.. I assum :) 
  32.  
  33. : >  If the header file was programmed correctly it would not use ANSI data
  34. : >  type directly....
  35.  
  36. : What are you talking about? <time.h> is provided as part of the
  37. : compiler. The compiler is a beast that translates a valid C source
  38. : code defining an algorithm for an abstract machine into actual machine
  39. : code for an actual machine.
  40.  
  41.  I'm talking about doing operation on a strcuture element. if the element
  42.  was defined has a ulong, then one decide its a float you will have to
  43.  update your code too to use float. 
  44.  
  45. : The semantics of the abstract machine are that there are some simple
  46. : types (short, int, long, unsigned short, unsigned int, unsigned long,
  47. : char, signed char, unsigned char, float, double, long double). You can
  48. : derive compound types from simple or compund types (structs, unions,
  49. : arrays, pointers). Additionally there are function pointers.
  50.  
  51.  Yes... 
  52.  
  53. : Then there are objects of these types and operations on these objects.
  54. : Certain guarantees about the properties of types and operations are
  55. : made.
  56.  
  57.  Yes... you better, otherwise you program in the dark.
  58.  
  59. : Then there is clock_t (and similar beasts like size_t, prtdiff_t).
  60. : clock_t is a typedef for one out of a set of simple types, but it is
  61. : not said which one. Again, there are objects of type clock_t and
  62. : operations defined for them with specific semantics.
  63.  
  64.  I dont rememner reading clock_t was a type of type ulong... 
  65.  
  66. : The idea behind clock_t is that it is a data type suitable for storage
  67. : of the system's clock's value and certain operations on it. These
  68. : operations are defined in an abstract way, independant of a specific
  69. : choice what simple type clock_t may actually be.
  70.  
  71.  you might not care clockt_t went from 32bit long to a 64bit long,
  72.  but I you would if it become a 32digit bcpl.
  73.  
  74. : The obvious advantage is that these conception of the abstract machine
  75. : allows C source code to be portable to many different actual machines,
  76. : no matter what strange encoding they use for clock_t.
  77.  
  78.  No matter what strnage encoding... how about a pointer to a string?
  79.  
  80. : Dave called it "polymorphism". I call it "data encapsulation". Anyway,
  81. : it's a basic concept of decent programming, and not having understood
  82. : it is no crime, but one probably shouldn't go around demonstrating it
  83. : everywhere in the most embarrassing way. Eh?
  84.  
  85.  The point he wanted to prove is that you dont need to care about your
  86.  variable type, and your variable type definition. I just desagree.
  87.  He enver said that undefined type require support function.without that
  88.  that claim make no sense in C. There is limit on C operator and type.
  89.  
  90.  Stephan
  91.