4 ms·
The word "optimisation" should not be confused with considering computational complexity, and I believe we are in dire need for a catchy word for the latter. O
by mduerksen 11y ago
The word "optimisation" should not be confused with considering computational complexity, and I believe we are in dire need for a catchy word for the latter.
One of the most important steps in programming is:
How many elements could this code actually have to process, and if there could be many: is this datastructure/algorithm suitable for that?
This is almost never premature.
This should NOT be called optimisation.
I would like an own word for that. Suggestions?
- Lozzer 11y agodesign
- danieltillett 11y agoYes you should always think about optimisation, even if you never end up coding for it. Every function I write I think about what is the effect that it will have on the rest of the code and what will I need to change if it later turns out to be a bottle neck. The advantage of this is I sometimes avoid writing some dumb code - even if it never matters from a performance perspective I have thought a little bit more deeply about what I want to accomplish. To answer your question how does thinkthencode sound?
- xatnys 11y agoWhile not particularly original, I would place this under 'thoughtfulness' / 'thoughtfully'. Code thoughtfully, but don't dive into premature optimization.
- taco_emoji 11y agoI think the operative word is "premature". If you actually have a reasonable idea of how much data you're going to be working with, it's not premature at that point to put some time into optimization. Also, I would restate the rule as something like "don't spend too much time prematurely optimizing. If you're building a lookup, it's obviously a Good Thing to use a hash instead of a linked list, and in 99% of cases shouldn't take you any longer to code.