You are a stupid programmer, you can't have that

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Aug 9 19:23:14 UTC 2021


On Mon, Aug 09, 2021 at 07:01:18PM +0000, bachmeier via Digitalmars-d wrote:
> On Monday, 9 August 2021 at 17:03:57 UTC, H. S. Teoh wrote:
> 
> > Floating-point, if anything, is *more* complex and comes with more
> > pitfalls than signed/unsigned mistakes.
[...]
> There's an important difference though. Signed/unsigned mistakes are a
> choice the programming language designer makes - Walter made his
> choice and Gosling made a different choice. You're more or less stuck
> with the limitations of floating point.

Thing is, Java can (somewhat) get away with it because it's designed to
run in an idealized VM environment, abstracted away from the ugly
details of the underlying hardware.  But D is a systems programming
language, so it should not hide the ugly realities of the hardware that
it runs on.  By using a systems programming language you kinda signed up
for this, in a sense.

As Knuth once said:

	People who are more than casually interested in computers should
	have at least some idea of what the underlying hardware is like.
	Otherwise the programs they write will be pretty weird.
	-- D. Knuth

That includes knowing the ugly realities of 2's complement arithmetic.


T

-- 
Klein bottle for rent ... inquire within. -- Stephen Mulraney


More information about the Digitalmars-d mailing list