Playing with the bits of floats

Billy G. Allie bga at bgalli.UUCP
Sat Jan 21 13:27:06 AEST 1989


In article <5586 at phoenix.Princeton.EDU>, rjchen at phoenix.Princeton.EDU (Raymond Juimong Chen) writes:
> Harumph.  To emphasize that the code is inherently non-portable, why
> not just code the test in question in assembly language?  This would
> certainly point out to anyone trying to (heaven forbid!) port the code
> that something amiss is up.

I DO NOT LIKE coding in assembly language and will only do so if there is
no other way to code it.  As for pointing out to anyone that the code is
non-portable, what's wrong with:

	<non-portable construct>	/* NON-PORTABLE */

Useful comments are meant to be included in your programs, and a comment
stating that a particular construct is non-portable is definately useful.

>                              (I mean, the code is so blatantly non-portable,
> one wonders how one could possibly code it in a language which was designed
> with portability in mind.)

I don't think C was designed for portablility.  It was designed to allow a
reasonably high level language provide adequate access to the underlining
hardware so that WRITING CODE IN ASSEMBLER WOULD NOT BE NECESSARY.  The
fact that UNIX is written mostly in C says to me that it acheived that
goal.

I also get the impression that you perceive `portability' as the One True
Goal.  Portability is a useful goal for programs such as emacs and pcomm,
but not for an imbedded real-time control system that needs to have good
response times to external events.  For such a project, portability can
take a flying leap off a high cliff.

> There seems to be this great movement to make C the One True Programming
> Language That Lets You Do Anything You Want.  I don't think it is.
> If you want to get ``under the hood'' and play dirty tricks, then
> use assembly language.

You are right, C is not the 'One True Programming ...'.  BUT - it does let
me get ``under the hood'' and play `dirty' (I question the use of the word
"dirty") tricks.  This is the reason I started using C and it is the reason
I will continue to use C.
___________________________________________________________________________
____		Billy G. Allie		Internet..: bga at bgalli.eds.com
|  /|		7436 Hartwell		UUCP......: {mcf|edsews}!bgalli!bga
|-/-|-----	Dearborn, MI 48126	Compuserve: 76337,2061
|/  |LLIE	(313) 582-1540		Genie.....: BGALLIE



More information about the Comp.lang.c mailing list