Autor: Irrwahn Data: Dla: dng Temat: Re: [DNG] Studying C as told. (For help)
On Wed, 22 Jun 2016 12:35:22 +0100, Simon Hobson wrote: > On 21 Jun 2016, at 18:50, Irrwahn <irrwahn@???> wrote:
>> Source code is written for humans, not machines! Clarity and
>> simplicity can help minimize code maintenance cost, and thus
>> easily outweigh some slight runtime penalty. Whoever has found
>> himself in a situation where he had to spend a considerable
>> amount of time trying to grok what some "clever", "manually
>> optimized" code is supposed to do, knows what I'm talking about.
>
> I have no argument with that, or the rest of your response. However, I do think it is important for a programmer working in a high level language to have some concept of how changing (sometimes subtle) in code can impact on performance. I wasn't suggesting manually optimising code - but looking at how different algorithms and code arrangements impact how the end result runs.
You have a valid point there! I was merely trying do discourage
(novice) coders from using possibly outdated, overly elaborated
hacks or screwy design patterns in production code, not to hold
them off from experimenting. I should have made that a bit clearer.
> Having no idea at all - or worse, not giving a s**t - leads to the scourge of "performance by throwing hardware at it".
Sigh, so true. Cold comfort: Thanks to those idiots today we have
available the equivalent of earlier mainframes the size of
wristwatches, at the price of a bench calculator; and those who
know how to write clear and efficient code have a feast.
> I suspect we've all conversed with people who have approximately zero knowledge or interest in how "the greasy bits" of the machine ends up running their code. My first computer came with just 1k of RAM, and sockets for just 8k total. It's surprising what you can do with that !
Absolutely! I might be a bit spoiled, though, as the first
machine I could call my own came with a whoppin' 64K, part of which
was actually available for user programs, and it ran at a lightning
fast 1MHz. I still have it around, BTW, and every couple of years
I dig it up, somehow adapt it's video output to the consumer AV
interface of the year to hook it up to some TV, and then surprise
myself by still being able to recall some 65xx machine code from
the top of my head. :^)