Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Using Semicolons (;). #159

Open
iRon7 opened this issue Dec 22, 2022 · 3 comments
Open

Avoid Using Semicolons (;). #159

iRon7 opened this issue Dec 22, 2022 · 3 comments
Labels
Help Wanted Great spot for someone to pitch in

Comments

@iRon7
Copy link

iRon7 commented Dec 22, 2022

The PowerShell practice and style guide has a rule for: Avoid Using Semicolons (;) as Line Terminators.
I wonder whether there is a general readability recommendation for avoid Using Semicolons (;), period (at all), meaning:
Don't put multiple statements in a single line but instead spreading them over multiple lines, thus:
Rather than:

if ($Condition) {
    Write-Host 'Exiting...'; return
}

do:

if ($Condition) {
    Write-Host 'Exiting...'
    return
}
@Jaykul
Copy link
Member

Jaykul commented Dec 24, 2022

I would have said we had something like that, but I can't find it. I agree we should add something.

What if we add "avoid using ; to put multiple lines on one line" in the readability section where we "avoid using backticks for line continuation"

@iRon7
Copy link
Author

iRon7 commented Dec 26, 2022

@Jaykul,

avoid using ; to put multiple lines on one line

I generally agree with that statement except that it contains twice the definition lines (and line) where they should slightly differ as one (lines, maybe use "statement" or "command lines") is a subset from the other line.
(I am not sure of the correct wording either, but somehow I think they should differ.)

@Jaykul
Copy link
Member

Jaykul commented Dec 28, 2022

Yeah, "multiple statements on one line" is probably best.

@Jaykul Jaykul added the Help Wanted Great spot for someone to pitch in label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Great spot for someone to pitch in
Projects
None yet
Development

No branches or pull requests

2 participants