Jump to content

Rosetta Code:Village Pump/My code is better than existing one: Difference between revisions

m
(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 andor space compression, but less well optimised for refactoring. Another might be scrupulously adherent to a particular house-style, but not actually work, or be poorly adapted in some other way to its context.
 
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.
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.