[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A strange problem with table.sort()
- From: David Kastrup <dak@...>
- Date: Fri, 27 Jul 2007 11:44:17 +0200
Alen Ladavac <alenl-ml@croteam.com> writes:
> Ketmar wrote:
>> programmer *must* know such things as assemble language, bit
>> arithmetic, stacks, etc. others can do something that might be call
>> "programs" but they aren't programmers.
> You know what they say... "Programs must be written for people to
> read, and only incidentally for machines to execute." That's how I'd
> define a good programmer.
We would never have progressed beyond insertion sort with only "good
programmers" of that denomination.
Actually, being able to work assembly means a speedup of factor 1.3
when pitted against modern compilers, and maybe 5 when the computer
language lacks the expressive power for the algorithm (like offering
no access to the carry bit or mixed precision
multiplication/division).
Picking and implementing the right collection of good algorithms and
data structures, in contrast, easily can make for a factor of 10000 or
more. Using assembly language often lowers the threshold of
manageable complexity and maintainability. Since those thresholds are
relevant for humans (as opposed to theoretical Programming Gods),
assembly language programs done in the best possible way and
implemented by the same person at his maximal skill level can be less
efficient than the same using a higher level language.
> Knowing assembly is a good servant, but a bad master, in this
> context.
Not bothering about execution times is a bad master, too. A
programmer should likely not worry too much about how much time a
single iteration of his loop will take (though keeping things like
cache coherency in mind can be a good idea). But he certainly should
worry about how often a loop gets run.
--
David Kastrup