View Single Post
Old 26 July 2015, 15:43   #33
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
Originally Posted by pandy71 View Post
Once again - i think they don't care as they have no reference - I enjoy this example [ Show youtube player ] - this shows what im talking about - modern developers (even those with closely undescribed PhD) lost knowledge about simple yet efficient and useful algorithms...
i think they do care... they just don't know any better. because yes, they have no reference. the slowest thing they ever coded for ran at 1GHz and had 256Mb of RAM so the idea that that is a lot is completely lost on them, if you said you could get their code to run on a 10MHz CPU with only 256Kb of RAM they'd think you were being funny.

Yes, complexity growing but not wisely - it unwise, spaghetti chaotic style of growing code
i'm not talking about code complexity (although sometimes that is also a problem), but algorithmic complexity. This is taught about in computer science courses and in any good book on the subject but it somehow doesn't seem to sink in.

For example if you write a bubble sort, that will be fine if you are sorting maybe 10 or so elements, but if your dataset grows to a million elements it's going to be slow, no matter how much you optimise it. Because it will still be a bubble sort, and a bubble sort has complexity of O(n^2), in other words when the size of the problem doubles it takes four times as long to run. So if your memory size doubles, and your CPU speed doubles, your program is going to be half as fast. This is what happens in the real world. And i have seen people using O(n^2) algorithms, in fact one time i refactored what was i think even an O(n^3) algorithm (i didn't do a proper analysis, it was bad anyway). In the end i got it down to linear time complexity but people were too sceptical that it would actually produce the same result.

there is no pressure on efficiency and that's why smartphones need to be recharged at least once per 12hr...
That is because of 5-inch colour touchscreens.
Mrs Beanbag is offline  
Page generated in 0.08661 seconds with 9 queries