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

Some recommendations for Conditional statements #275

Open
gaborsch opened this issue Mar 26, 2021 · 0 comments
Open

Some recommendations for Conditional statements #275

gaborsch opened this issue Mar 26, 2021 · 0 comments
Milestone

Comments

@gaborsch
Copy link

I have a few suggestions regardinbg the conditional statements (If, If-Else) The reason is that conditionals are quite uniform, there's not much lyrics in them, and sometimes they look totally unpoetic.

  1. Add some aliases for If: When and Whether
    That's not a big deal, but they may look much more fancy.

  2. Add alias Or to the Else keyword. This will not be messed up with boolean or operaror, because it is in a different position lexically.

  3. Add Else if statement (Aliases may be combinations of [Else, Otherwise, Or] [If, When, Whether ])
    I think this statement is missing from the powerhouse. Yes, we can write nested Ifs, but we all know it's not that sexy.

  4. Add single-statement blocks to the Else statement.
    I know this is the hardest one of the four suggestions, but this way we could avoid single-word lines. Many cases one branch of a conditional statement is only a single statement - assignment, return statement or function call.

I could write examples for all of them, but someone with better imagination could write much better ones - I'm not a poet, especially not in English :D

@dylanbeattie dylanbeattie added this to the 2.0 milestone Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants