[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Let's stop feeding the NVidia cuckoo

Scripsit Ben Johnson <camilledalmeras@yahoo.com>

> What still bothers me is that after Daniel Stone's very opinion,
> nobody could honestly prefer to write a driver using hex values for
> registers AND functions, period. This is not just a case of bad
> coding practices, it is deliberate.

I don't think that argument is convincing. I remember the bad old days
when I hung out in the periphery of the MS-DOS low-level hacking
scene.  Everybody used hex values for interrupt numbers, function
codes, subfunction codes, the works. The canonical way to write a
system call was something like

	mov	ax, 6f08h
	int	16h

and nobody expected an explanation of what precisely these magic
numbers meant, despite the fact that everybody used fairly powerful
assemblers where one could easily _have_ defined symbolic constants at
the top of the file.

If you could go back in time and ask them why, you'd probably get the
reply: What would symbolic constants be good for?  These numers are
never going to change anyway, so there's no reason to obfuscate the
code just so it would be easier to change the number globally.  Yes,
some coders really felt that symbolic constants would constitue (a
mind form of) obfuscation, because all of their reference material was
structured around the naked numeric values.

If people could prefer to code in that way back then, I have no
difficulty believing that there are people today who honestly prefer
a similar coding style when they write device drivers.

Henning Makholm                              "En tapper tinsoldat. En dame i
                                         spagat. Du er en lykkelig mand ..."

Reply to: