threading

alister alister.nospam.ware at ntlworld.com
Tue Apr 8 10:15:00 EDT 2014


On Tue, 08 Apr 2014 23:23:05 +1000, Chris Angelico wrote:

> On Tue, Apr 8, 2014 at 11:13 PM, Roy Smith <roy at panix.com> wrote:
>> And the cost of hardware keeps going down, while the cost of good
>> programmers keeps going up.
> 
> Like everything, it's a matter of trade-offs. Spending a moment thinking
> about what you're doing before you do it might cut your RAM usage by 20%
> without materially increasing your programmer time cost. But coding
> everything in C "for efficiency" is almost certainly a bad trade, for
> the reason quoted.
> 
> There can be special boundaries in resource consumption. Fitting
> something inside an Amazon Micro instance might be important for you, in
> which case you get just 613 MB of RAM (a weird figure, I know). Or maybe
> you need to stay within 8GB so you can allocate the other 8GB to the
> database. Or whatever it is. But any time it's flexible (where you
> basically just pay twice as much to get twice as much), it's usually
> worth going as far as you can.
> 
> ChrisA

My main point was that when you have only 8K of ROM & 128 byte of ram you 
have to think about your algorithms first.
Programming is in Assembler because there is no other choice (I would not 
like to go back to that Python is so much more enjoyable), do you 
calculate a result or use a look up table (calculating costs ram & there 
are only a few bytes available for temp storage) but a lookup table costs 
ROM space.

I am sure lack of constraint is what has lead to a number of the 
abominations on thedailywtf.com.
I must admit I can also see the other side of the coin in that it can 
sometimes lead to "Clever Programming"* which is rarely a good idea.

*Programming that makes use of side effects or other trickery that may 
not be obvious when read later.



-- 
Avoid the Gates of Hell.  Use Linux
	-- unknown source



More information about the Python-list mailing list