4 ms·
What is boilerplate? and why is Lisp so good at reducing it?
What exactly is boilerplate? and why is Lisp so good at reducing it?
- hxa7241 17y agoBoilerplate is an implicit abstraction: recognisable generality, but lacking a coded mechanism. These could always be manually transformed to fit standard abstractions, such as functions or classes. But Lisp's macro facility instead allows them to be captured more 'directly'. Now, whether fewer standardised abstractions is better/worse than more various tailored abstractions, is a deeper question . . .
- DanielStraight 17y agoA perfect example is Java's getters and setters, which follow a completely regular pattern but still have to be coded individually.
- wgj 17y agoThis wikipedia entry is a decent introduction, discussing pros and cons of repetition-reducing abstractions (DRY) in a language-independent way. http://en.wikipedia.org/wiki/Dont_repeat_yourself http://en.wikipedia.org/wiki/Dont_repeat_yourself
- morphir 17y agoyour link doesn't work. Try this one instead. http://en.wikipedia.org/wiki/Don%27t_repeat_yourself http://en.wikipedia.org/wiki/Don%27t_repeat_yourself I was not aware there was a term for this. Also called DIE (Duplication is Evil).
- wgj 17y agoThanks for the updated link. Mine was a cut/paste from the Chrome address bar. A bug maybe.
- morphir 17y agoI initially thought recursion where less cpu intensive than traditional for-loops. Is this even true?
- chromatic 17y agoNo one can answer that question accurately without discussing specific implementations of specific programming languages.