Rosetta Code:Village Pump/My code is better than existing one: Difference between revisions
Rosetta Code:Village Pump/My code is better than existing one (view source)
Revision as of 13:27, 4 November 2018
, 5 years ago(e.g. time or space compression, vs ease of refactoring)
(The Rosetta goal, readability for different audiences, optimisation for different contexts) |
m ((e.g. time or space compression, vs ease of refactoring)) |
||
Line 38:
In this particular case, we have two functional approaches, and their similarities and differences are instructive. Mine is a composition of pre-existing generic (curried) primitives, and aims to optimise for reliability and speed of composition. Currying enables more flexible composition. Re-use of primitives is good economy, and allows, over time for the development of well tested and reliably inter-operable units. You will be able to explain what yours optimises for. They complement each other.
As for 'better' etc – as you know, the quality of code is a function of its relationship to a particular pragmatic and organisational context. There is no such thing as 'better' in isolation, only 'better '''for''' XYZ', and we always need to specify the 'XYZ'. One draft might be highly optimised for time
Equally, 'more readable' is a function of a particular audience. Each of the 3 versions on the Rosetta Stone was less readable to some audiences, and more to others. Therein lies the interest and the value.
|