3 ms·
What I meant by that is the metaprogramming capabilities that often get cited for allowing devs to create their own domain specific "mini languages". To me that
by thunky 6mo ago
What I meant by that is the metaprogramming capabilities that often get cited for allowing devs to create their own domain specific "mini languages". To me that's a "creative" way to write code because the end result could be wildly different depending on who's doing the writing. And creativity invites over-engineering, over-abstraction, and hidden costs. That's what I meant by the "opposite of boring".
- michaelsbradley 6mo agoIn practice, though, most developers don’t do that. There’s a rule of thumb: write a macro as a last resort. It’s not hard to stick to it. In general, you can go a long, long way with HOFs, transducers, and standard macros before a hand-rolled macro would serve you better.
- hatefulheart 6mo agoI read comments like these in bewilderment. Have you worked for a company that hasn’t created its own, as you put it “mini language”? Have you worked for a company that doesn’t indulge in over engineering, over abstraction and hidden cost? Do you actually do programming for a job at all?
- thunky 6mo agospeaking of bewilderment, i'm not sure at all what you're getting at here. because programmers suck we should make tools that make it easier for them to suck?
- tines 6mo agoWe should make it easier for them to suck less. It's like providing free needles. Druggies gonna drug, might as well help them drug safely :)
- deleted 6mo ago[deleted]
- whateveracct 6mo agowhat a low trust attitude wouldn't want to work at a place with those kind of values
- dgb23 6mo agoYou linked me to this comment from another one and I have to agree with this sentiment. Creating these mini DSLs is something that requires a lot of thought and good design. There is a danger here as you pointed out sharply. But I have some caveats and counter examples: I would say the danger is greater when using macros and far less dangerous when using data DSLs. The Clojure community has been moving towards the latter since a while. There are some _very good_ examples of (data-) DSLs provided by libraries, such as hiccup (and derived libraries), reitit, malli, honeysql, core match, spec and the datalog flavor of Clojure come to mind immediately (there are more that I forget). In many cases they can even improve performance, because they can optimize what you put into them behind the scenes.
- midnight_eclair 6mo agoso many similar conversations happening, it's refreshing xD https://news.ycombinator.com/item?id=47587386 https://news.ycombinator.com/item?id=47587386
- kaliszad 6mo agoIt also allows you to write stuff like Rama, Specter (@nathanmarz) and to wrap stuff that you do often to avoid boilerplate.