Title: Naming convention for local constants · Issue #13247 · PowerShell/PowerShell · GitHub
Open Graph Title: Naming convention for local constants · Issue #13247 · PowerShell/PowerShell
X Title: Naming convention for local constants · Issue #13247 · PowerShell/PowerShell
Description: Our coding guidelines the naming convention is to: "Use `PascalCase to name constant local variables and fields." and is common with dotnet repository guidelines. On the other hand, the style for local constants is mostly camelCase in ex...
Open Graph Description: Our coding guidelines the naming convention is to: "Use `PascalCase to name constant local variables and fields." and is common with dotnet repository guidelines. On the other hand, the style for l...
X Description: Our coding guidelines the naming convention is to: "Use `PascalCase to name constant local variables and fields." and is common with dotnet repository guidelines. On the other hand, the s...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/13247
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Naming convention for local constants","articleBody":"Our [coding guidelines](https://github.com/PowerShell/PowerShell/blob/master/docs/dev-process/coding-guidelines.md#naming-conventions) the naming convention is to: \"Use `PascalCase to name constant local variables and fields.\" and is common with [dotnet repository guidelines](https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/coding-style.md).\r\n\r\nOn the other hand, the style for local constants is mostly `camelCase` in existing code so we should consider the logic for this part of our coding guidelines.\r\n\r\nIn https://github.com/PowerShell/PowerShell/pull/13217#discussion_r458263009 @rjmholt made a persuasive case we should use `camelCase` instead of `PascalCase` for local constants:\r\n\r\n\u003eMy thinking is that that's only for global constants (which behave most like value macros), rather than local constant variables (which can hold references and for which `const` indicates just immutability rather than referential transparency)\r\n\r\nIf we used `camelCase` for local constants this would be a violation of [SA1303ConstFieldNamesMustBeginWithUpperCaseLetter](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md) but there is an [open issue](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2082) as to whether the rule should apply to local constants as well as fields.\r\n\r\n\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/xtqqczze","@type":"Person","name":"xtqqczze"},"datePublished":"2020-07-23T12:07:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/13247/PowerShell/issues/13247"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a8e70431-8bba-0885-58be-49c95677c35f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B1DA:1525EF:1D6E117:26C051B:6A51E356 |
| html-safe-nonce | 88aa4edbbf8df953ca67da405c8670f380bdc8f241f70bd955bc10b7d0bef6d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMURBOjE1MjVFRjoxRDZFMTE3OjI2QzA1MUI6NkE1MUUzNTYiLCJ2aXNpdG9yX2lkIjoiNzA2MTAxMTg3Mzc2MDY2NjQ1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5bd2bef697f1d6161674d6af1248626a34a25092dded05e171ff7c79e747cb83 |
| hovercard-subject-tag | issue:664420267 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/13247/issue_layout |
| twitter:image | https://opengraph.githubassets.com/be00622f7a5e2a4d4600f8e9ac67fa2adb8c3e2cc6b3090528e9301a78383f1b/PowerShell/PowerShell/issues/13247 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/be00622f7a5e2a4d4600f8e9ac67fa2adb8c3e2cc6b3090528e9301a78383f1b/PowerShell/PowerShell/issues/13247 |
| og:image:alt | Our coding guidelines the naming convention is to: "Use `PascalCase to name constant local variables and fields." and is common with dotnet repository guidelines. On the other hand, the style for l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xtqqczze |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width