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

What is the benefits of not using conditions (if else, switch)? #39

Open
tim-hub opened this issue Apr 22, 2020 · 1 comment
Open

What is the benefits of not using conditions (if else, switch)? #39

tim-hub opened this issue Apr 22, 2020 · 1 comment
Labels
question Further information is requested

Comments

@tim-hub
Copy link

tim-hub commented Apr 22, 2020

func myFunc(num a, num b)
     // your code
end { x > 0 : f1(x), default : f2(x) }

what is benefits of only getting conditions in function? but not using if else/switch?

@f00stx
Copy link

f00stx commented Apr 22, 2020

From what I understand, it makes horrible nested if statements with endless recursion impossible to create, and prevents the quick-and-dirty monkey patching of new conditionals to cover some unconsidered edge case that cropped up at runtime? Essentially making it impossible to create a spiderweb of independent paths that increase complexity, decrease reliability etc.

I think it's awesome. Like, slap-myself-on-the-forehead and think "why haven't I seen this until now" kind of awesome.

I imagine it might slow productivity a bit until you get used to the new paradigm, but it'd encourage good planning and forward thinking, in an ecosystem that is absolutely drowning in hastily thrown-together code (oh, the horror).

@mertyildiran mertyildiran added the question Further information is requested label Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants