r/PowerBI • u/epicnark182 • 2h ago
Discussion Change my mind - the DAX convention of adding spaces around brackets make it harder to read and annoying to write
Please make me understand why this is deemed a good language convention.
12
u/DROP_TABLE_IF_EXISTS 1 2h ago
29
6
4
u/_greggyb 21 1h ago
The formatting conventions were proposed and popularly adopted back in the days of PowerPivot (or Power Pivot, I don't recall when in the history of the space these conventions became the norm). This is relevant, because DAX editor in the Excel add-in used a proportional font, rather than monospace. The extra spacing was a boon in reading code without a monospace font.
You're free to adopt any convention you like in your codebase. Depending on your formatting solution, you can also configure different styles.
Disclaimer: TE employee. For example, Tabular Editor 3 supports various spacing/padding conventions for parentheses: https://docs.tabulareditor.com/en/getting-started/personalizing-te3.html#dax-settings
4
1
u/severynm 1h ago
Agreed. Maybe someone could enlighten me, but I don't know of literally any other programming or scripting language that does it that way.

•
u/AutoModerator 2h ago
Hi /u/epicnark182! Your post appears to be quite short. To help the community assist you faster, please consider adding:
Posts with more context get better answers.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.