vslokker's avatar

Viktor

vslokker

Member since

30

Total Reputation

1

Total Arguments

4

Total Votes for Arguments

Arguments and votes

1

Not a fan of closures.

These things can be useful in specific cases, but as i've seen someone else mention aswel shouldn't be used carelessly. In my opinion closures, especially when scattered throughout a codebase, make code hard to read.

Hiding scope makes this even more dangerous. It shouldn't always be about "faster to type", "less lines" or "doesnt require me to think". We should make sure everyone is able to work together on a codebase, we can do that by being explicit.

Please don't make javascript 2.0.

Share:
Read the RFC: Short Closures 2.0 vslokker avatar
vslokker
voted no
4

Short closures were meant to be that - short. If you need multiple lines, just create a function (it can even be a closure). Or just use a standard anonymous function instead of a short closure. It will also create confusion with having access to variables outside the short closure scope while letting it look like a normal function.

Share:
Read the RFC: Short Closures 2.0 jim avatar
jim
voted no
24

The 'use' statement clarifies the scope for me. So a proposal like this could have the side effect of mixing scope which would lead to a confusing code.

Share:
Read the RFC: Short Closures 2.0 nabeel avatar
nabeel
voted no
13

I really do not want to see this in PHP because it tempts to apply closures on everything. The question is not if we can but if we should.

Share:
Read the RFC: Short Closures 2.0 marko avatar
marko
voted no
RSS Feed Contribute Watch on YouTube Our License
© 2024 RFC Vote. This project is open source. Contribute and collaborate with us!