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

Should else branches always be required? #9

Open
Feliix42 opened this issue Oct 19, 2018 · 1 comment
Open

Should else branches always be required? #9

Feliix42 opened this issue Oct 19, 2018 · 1 comment
Labels

Comments

@Feliix42
Copy link
Member

Just wanted to throw this question in the room. Currently, every if control structure requires an else branch, which makes sense i.e., for assignments. But one might want to execute a block of the algorithm conditionally based on the control port value. In that case, the current implementation would not be the best fit.

What do you think? Make else optional or keep it required?

@sertel
Copy link

sertel commented Oct 19, 2018

To be honest, I really don't like implicit else branches. I always write empty ones into my code to make it more straight forward to see what is actually happening.

Apart from that, considering that an if-the-else block is just a function, what would be its result (type) when the if-branch is not being executed?

Can you please post your example code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants