Efficiency is fundamentally at odds with elegance (2013)
1–10 of 46 posts
Re: Efficiency is fundamentally at odds with elegance (2013)
#2Strangely though their absence coincides in roughly 80% of all programmes, so "being at odds with" is meant as
(Efficiency -> NOT Elegance) AND (Elegance -> NOT Efficiency)
but not as
Elegance XOR Efficiency
Re: Efficiency is fundamentally at odds with elegance (2013)
#3It is on the other hand, fundamentally at odds with accuracy - which is already well and widely known (at very least implicitly) and is the reason we so readily accept approximations in computing.
Re: Efficiency is fundamentally at odds with elegance (2013)
#4Re: Efficiency is fundamentally at odds with elegance (2013)
#5The example of the FAST decision tree is based on a code generator, an abstraction which is presumably more elegant than the generated code which is littered with goto statements.
And what about std::sort? Say what you want about C++ in general, but it is definitely superior to a rudimentary qsort in C in terms of elegance and at least equivalent in terms of runtime efficiency.
There are plenty of examples in either direction. It would seem that this is yet another case of “it depends.”
Re: Efficiency is fundamentally at odds with elegance (2013)
#6Re: Efficiency is fundamentally at odds with elegance (2013)
#7Would F# or Nim be a much faster Python with less ugly C FFI?
Re: Efficiency is fundamentally at odds with elegance (2013)
#8I think you can have in some cases efficiency and elegance, but then the solution will be either too abstract or specialized that it won't really be practical, and a small change in problem conditions will cause it not to work. (An example from the article - a matrix solver that only does a well-conditioned systems so the floating point errors never accumulate.)
Similarly, you can have robustness to change and elegance without efficiency (mathematically beautiful code), and robustness to change and efficiency without elegance (lot of copy pasting the code to deal with special cases).
In any case, I think we are generally trying to present elegant code to humans (using more abstract programming languages) and then use compilers to convert the elegance into efficiency. But it requires that somebody takes the pains to actually deal with all the possible cases (and write a working compiler).
Re: Efficiency is fundamentally at odds with elegance (2013)
#9Bad first example. Automatic differentiation in arbitrary precision is as elegant as symbolic, and as efficient as "floating point".
Re: Efficiency is fundamentally at odds with elegance (2013)
#10> Efficiency is fundamentally at odds with elegance Strangely though their absence coincides in roughly 80% of all programmes, so "being at odds with" is meant as (Efficiency -> NOT Elegance) AND (Elegance -> NOT Efficiency) but not as Elegance XOR Efficiency
For example I do not see "being drunk is fundamentally at odds with performing surgery" being invalidated by a bunch of folks writing programs in offices and fitting in neither bin. Caveat: I am not a native English speaker.