top | item 45616066

(no title)

Communitivity | 4 months ago

Bjarne Stroustrup said "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off". The same is true of Rust macros. When you need them they're awesome, but you should almost never need them - add a new macro as a very last resort.

discuss

order

galangalalgol|4 months ago

I agree with this, mostly because all the macros I would use are mostly written already. If const generic expressions arrive, a lot of those could go away too. In languages like lisp or zig where metaprogramming is a central feature, what do they do differently to make it better? Would those things have worked for rust?

jacquesm|4 months ago

That's a hilarious quote. Thank you.

tcfhgj|4 months ago

> The same is true of Rust macros.

can't follow