The Retrospring servers are currently under heavy load from users migrating from CuriousCat. Unicorns might appear more frequently in the coming days. Follow us on Twitter to keep up to date.

Luna Saphira Dragofelis asked 6 months ago

Opinions on macros in programming?

Luna Saphira Dragofelis

Opinions on macros in programming?

Hmm... I'm not really a macro kind of person - generally speaking I'll just shove everything into a function - but I have no issues with them.

With that said, Crystal has only a few basic functions, and most other "functions" in the language are macros of those basic functions, which makes understanding what those functions actually do a whole lot easier and somewhat self-documenting, and I think that's really cool.

Do you mean preprocessor macros, as found in C? They're pretty neat and allow code to be portable between lots of funky build systems, compilers, and platforms.

I'm not really a programmer anymore, I primarily read code nowadays. So to me, I prefer to not see macros since it adds difficulty when reading. But I just see my job like how a mechanic sees theirs, I just take whatever rolls into the shop and deal with it. The result is that I'm rather ambivalent on many programming preferences.

Retrospring uses Markdown for formatting

A blank line starts a new paragraph

*italic text* for italic text

**bold text** for bold text

[link](https://example.com) for link