Re: Code Review - is this code shit




"spinoza1111" <spinoza1111@xxxxxxxxx> wrote in message

Duh back at you. He tested on his computer and OS. It was completely
unprofessional not to test it on the customer's OS and using his
compiler.

If you are writing portable code / routines then almost by definition it
isn't possible to test them on every platform for which they might be used.
However you are right. C has "implemention-defined behaviour" which means
that output might not be the same on all platforms. It also has "undefined
behaviour", which means that a bug might not manifest itself on the
development system. It would be better if we could specify the behaviour of
the program absolutely, as in Java.
However even Java had to relax this requirement due to different types of
floating point hardware. Insisting on it would have meant software emulation
of floating point, which was an inefficiency too far.
The real problem is in the hardware, not in C. Since microprocessors are
compartatively new, there are no firm standards for things like size of
bytes, endianess, address (pointer) representation, behaviour on
arithmetical overflow, the modulus operation with negative operands, the
size of an integer needed to index the whole of memory space, and so on.


.



Relevant Pages

  • Re: ADTPro beta available
    ... This is essentially saying that a platform ... is any execution environment that allows software to run. ... there is essentially no difference between Java and ... that leverages a hardware platform. ...
    (comp.sys.apple2)
  • Re: How to develop for Linux
    ... The hardware or the platform? ... The Java platform has undergone tremendous changes in speed ... Also a Java UI that looks like the OS that's hosting it? ... The Swing enthusiasts insist that with Java 6, ...
    (borland.public.delphi.non-technical)
  • Re: VC++ functions for accessing Foxpro tables with Rushmore and cursor support?
    ... although it isn't quite as apparent on modern hardware. ... The JVM is for portability across all platforms! ... and it's at least cross platform compatible then java is. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: How to develop for Linux
    ... The Java platform has undergone tremendous changes in speed up changes, but of course modern hardware has the most to do with the speed differences. ... It doesn't look like the OS hosting it, but one good java UI is in the new Oracle SQL Developer. ...
    (borland.public.delphi.non-technical)
  • Re: double vs float
    ... Can someone explain why double should be preferred to float? ... What system is it that has "a" native floating point type, ... If a platform only has a single floating point type supported in ... I can't think of any hardware architecture off-hand that has ...
    (comp.lang.c)