cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

M scripting conventions (suggestions)

Dear all,

 

I was wondering if anyone had any thoughts about M scripting conventions that works for them. I am just trying to work out a systematic way forward for myself.

 

I am thinking.

 

variables (ie. lists and scalar values) = camelCase (with lowercase first letter)

User defined functions = CamelCase (with uppercase first letter)

Names of Tables and other objects imported from databases = same name as they appear in the database

Fields in tables = First word uppercase and all words lowercase afterward

Names of Queries involved in intermediate processing (do not appear in the report) = lowercase_with_underscore_separator

Names of Queries that appear in the report view = Every First Letter Of Words In Uppercase 

 

I should add

Constants = ALL_UPPERCASE_WITH_UNDERSCORE

 

3 REPLIES 3
Highlighted
Microsoft
Microsoft

Re: M scripting conventions (suggestions)

@robertsbd

 

I still can't understand your requirement. Can you share your expected result with sample data?

 

Regards,

Highlighted
Resolver I
Resolver I

Re: M scripting conventions (suggestions)

Hi no requirements,

 

I was just wondering if people have any conventions that they use in how they label variables, names of tables, names of queries nad so forth

 

Highlighted
Responsive Resident
Responsive Resident

Re: M scripting conventions (suggestions)

Because it is hard to collaborate on the Power Query scripts, there is little need agree on code name conventions. In my experience I'm trying to adhere to the rules that you mention in your post, but I think that a more authoritative input from @MSFT would be more desirable. Something in the lines of what Fsharp has would be good: http://fsharp.org/specs/component-design-guidelines/

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors