@SuricrasiaOnline okay can anyone tell me about the single most useful macro in praat? Because I can't find anything on that

@Vierkantor @SuricrasiaOnline oh, thank you! I don't know enough about programming to understand why this is bad or weird practice. All I know scripting in praat is absolutely horrible. I broke my code a couple dozen times simply by inserting a space at the end of a line

@schratze @SuricrasiaOnline So, people have been doing things like this in C for as long as C has existed -- the very first example I know of is Steve Bourne's macros to make C look more like Algol [ research.swtch.com/shmacro ] -- and people have been arguing about whether it's good or bad style for just as long.

At heart, it's an argument about readability, and specifically about when it's okay to make up your own jargon.

@schratze @SuricrasiaOnline The people who like to write code like this think that project-specific jargon is a Good Thing because it makes it easier for the day-to-day maintainers of the code to read it.

You get used to seeing things like github.com/praat/praat/blob/9a (first example I found of how these macros are _used_). It becomes quicker to read than the alternative with the macros all expanded. Code that _doesn't_ use the macros stands out as doing something special, demands more attention.

@schratze @SuricrasiaOnline On the other hand, the people who dislike code like this think project-specific jargon is a Bad Thing because it makes it harder for _new contributors_ to the code to read it.

Without these macros, anyone reasonably fluent in C would be able to jump in and make changes to the code, but with the macros, they first have to go find where the macros are defined and learn their meaning and their conventional usage. It's an extra obstacle if you just wanna fix one bug.

@schratze @SuricrasiaOnline This is a miniature version of a similar argument at the scale of entire programming languages.

You'll see people say that they prefer C++ to C because you can hide complicated processing behind simple notation, and you'll see people say that they prefer C to C++ because they don't want that to be possible, they always want it to be visible in the surface syntax when complicated things are happening.

@schratze @SuricrasiaOnline It's not just limited to the C family, either. Lisp also has really powerful "meta-programming" (capacity to define your own project-specific jargon and notation) and comes in for the exact same praise and criticism. Same for ML, Forth, ...

Sign in to participate in the conversation

Mastodon is a server for a federated social network: everyone can run a server if they want to, including me. So this is a Mastodon server for me (Vierkantor) and my friends.