Although a macro can take any number of parameters, they are often no more than two or three, for readibility reasons: parameters have no name, but their position within a macro is significant.
If you have something like this:
it may still be easy enough to understand what each parameter is used for, but:
- you can easily forget that the third parameter is the image width
- if you don’t want to resize the image, you still have to pass empty parameters to the macro, like this:
To avoid these situations, some macros which would normally take three or four parameters take optional attributes instead, so you can write:
More verbose, of course, but definitely more readable. In this way, if you won't want to scale an image, you can safely omit the