Comment by toast0

3 years ago

> I love Rust's developer experience, frankly. The macros and build system are the main reason I like the language

On the contrary, I hate the macros, because the formater can't format inside tokio select or some of the other macros, and that means I have to do it manually, which is lame.

That's a pretty weak reason to hate macros, frankly. Seems more like a deficiency in the formatter than in the language feature.

As a side note, there's a poorly-documented behavior where rustfmt will format macros that are wrapped in {} if it's valid rust code. So you can even point the blame on tokio for not using formatter-friendly macros.

  • I agree, that is a weak reason to dislike macros.

    I dislike them primarily because of the additional complexity they add that isn't always justified. All of the more complex macros I wrote I regret, especially the one I did at my last job since now others had to maintain it.

    Some macro use can be justified, eg serde. But I try to avoid using proc macros where I can (and certainly never try write one anymore)