4 ms·
Lisp is Changing My C++
- deleted 18y ago[deleted]
- dazzawazza 18y agoLearning Python did the same thing for me. Infact I'd go as far as to say Python has made me a significantly better programmer.
- meredydd 18y agoSometimes, the answer is no. Some boilerplate code (like exception catching) is an overhead that can not be avoided [...] I’m still looking for my “Lisp Enlightenment” with respect to macros That enlightenment is just this: "boilerplate code that cannot be avoided" is an oxymoron. If it's boilerplate, it's macro-able, and exception handling is no different. I don't know your code, so I can only suggest that you take another look at those boilerplate segments you think "cannot be avoided". Find even the smallest thing they have in common - whatever makes you call them "boilerplate". Now invent some fantasy syntax that would make that overlap go away. Now write the macro to make that syntax work. Rinse, repeat. Warning - Once you're used to thinking like this, it is my experience that returning to a language without metaprogramming will become considerably more painful...
- scott_s 18y agoI think the author meant "some boilerplate code in C++ (like exception catching) is an overhead that can not be avoided."
- meredydd 18y agoI think the author meant "some boilerplate code _in C++_" It's possible. But once you've acknowledged that boilerplate code is inevitable in one language but not the other, that was The Macro Enlightenment(tm) - you just had it.
- scott_s 18y agoMaybe the first half. The second half would be how to write such code.