8 ms·
Obligatory list of some good quotes that are not included: Rules of Optimization: Rule 1: Don't do it. Rule 2 (for experts only): Don't do it yet. - M.A. Jack
by Jun8 8y ago
Obligatory list of some good quotes that are not included:
Rules of Optimization: Rule 1: Don't do it. Rule 2 (for experts only): Don't do it yet.
- M.A. Jackson
Never test for an error condition you don't know how to handle.
- Steinbach
Choose mnemonic identifiers. If you can't remember what mnemonic means, you've got a problem.
- perldoc perlstyle
Every program has (at least) two purposes: the one for which it was written, and another for which it wasn't.
- Alan Perlis
Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration.
- Stan Kelly-Bootle
- andrepd 8y ago>Rules of Optimization: Rule 1: Don't do it. Well that explains the modern web, and a great deal of modern software.
- paedupeax 8y agoThere is a huge difference between not optimizing (say, purge formatting white space from HTML) and putting out five megabyte of JavaScript junk for static website.
- hoppelhase 8y agoWell, optimization could also mean to remove unnecessary JS.
- cakebrewery 8y agoI think removing unnecessary code and generalizing redundant parts should be a given. On the other hand, early optimizations such as caching or in-lining should be avoided unless needed.
- deleted 8y ago[deleted]
- protomyth 8y agoI remember someone saying simple code implementing well selected algorithms beat optimized code implementing poor algorithms. Although, I would have to agree with your statement.
- adrianN 8y agoSelecting algorithms well is not trivial. How many people think about the difference between linear search in a small array versus just passing maps around without calling it optimization? It also doesn't matter as much if your design is a mess of abstraction and indirection that spends 95% of its time chasing pointers and inspecting maps.
- protomyth 8y agoNo, its not. Frankly, I haven't seen any tools to help which is an amazing shame. Its something that as a profession we need to be better at. > It also doesn't matter as much if your design is a mess of abstraction and indirection that spends 95% of its time chasing pointers and inspecting maps. Well, that's the other side of the problem of picking decent algorithms is picking a reasonable structure for your program.
- nerdponx 8y agoI think this rule only applies in situations where the runtime is smart and fast enough that the naive approach is fast enough for whatever you need to do.
- gmfawcett 8y agoThere was a surprising lack of Alan Perlis on the original list! His "epigrams on programming" should be required reading for every programmer, even if some are a little dated now: http://pu.inf.uni-tuebingen.de/users/klaeren/epigrams.html http://pu.inf.uni-tuebingen.de/users/klaeren/epigrams.html
- dkarl 8y ago"All code is technical debt; some code just has a higher interest rate." Paul McMahon Stroustrup’s Rule: "For new features, people insist on LOUD explicit syntax. For established features, people want terse notation." "Le meilleur moment du programmation, c'est quand on télécharge le compilateur." Georges Clemenceau
- baud147258 8y agoThe Clemenceau quote is not grammaticaly correct, it should be: "Le meilleur moment _de la_ programmation". Also I've seen "développement" used more often than "programmation", even if both terms are valid. Still where does it come from? The only George Clemenceau I've heard of died in 1929.
- dkarl 8y agoThanks for the correction! I made it up as a joke. He really said, "Le meilleur moment de l'amour, c'est quand on monte l'escalier."
- baud147258 8y agoOk, I didn't know that quote
- jfengel 8y agoHe was really looking forward to downloading the compiler.
- marcosdumay 8y ago> Choose mnemonic identifiers. If you can't remember what mnemonic means, you've got a problem. - perldoc perlstyle From that source it should rather be a joke. What is the meaning of `@` again?
- JadeNB 8y ago> What is the meaning of `@` again? @rray (just like `$` is for $calar, and `%` is for … uhm …). Everything is mnemonic if you have a sufficient amount of context. :-)
- marcosdumay 8y agoThe `@` symbol is a variable by itself, what is very clear from it's name, even more because `$` certainly isn't and I also don't think `%` is one (that last is for dictionaries, by the way). Another system defined variable is `$_`, that is as well named as the one I cited. There are many more of those in Perl, but I can't remember them for some reason.
- JadeNB 8y ago> The `@` symbol is a variable by itself, what is very clear from it's name I'm almost certain that this is false, at least in Perl 5. (Sigils are dramatically overhauled in Perl 6, and I haven't kept up.)
- lizmat 8y ago<plug> This blog post could be of interest: https://opensource.com/article/18/9/using-sigils-perl-6 https://opensource.com/article/18/9/using-sigils-perl-6 </plug>
- JadeNB 8y agoIn "What they have in common is that they consume the Callable role.", shouldn't 'consume' be 'perform' for consistency with your useage elsewhere?