So I know I have a habit of using anonymous closures instead of declaring a scope and variables for a Lambda function, but it can harm readability and slow understanding should a newer user come along. It's also sometimes not the right choice( see square it discussion ), regardless of how nifty a trick it is or how fun it is. For advanced users it's a simple recognition of order deceleration( parens ) and immediate invocation( more parens ), but I'm not certain a beginner would understand.
That being said we do have some requirements for the repo in that it requires knowing about implicit returns which by that point you would also know about scope, and hopefully by that point you would also know about order decleration.
So with it's limited application( simple one line Lamdas that need a placeholder), should we instead just request people to expand to a scoped Lamda and use a return statement for readability and have @skatcat31 stop suggesting anonymous closures?
Yes, I called myself out here. Self review is a process of growing too
I have no idea how this affects readability for others. I am reasonably used to it, so I don't mind it too much. Opinions are definitely needed on this one.
Same. Some people have made comments it sometimes makes code a little harder to grasp, but then after they grasp it I see them using it a lot... especially at work where my co workers are still coming to terms with composition.
I think you answered your own question here. Handling variadic arguments, spreading, array mapping/reducing, anonymous closures - all of these neat tricks feel hard to learn when you are a beginner, but when you figure them out, you start using them and get used to them. If we want people to learn, better teach them all the neat tricks, even if they need to stop for a minute and read the code more carefully. So, yeah, my vote is on keeping them and not worrying about it.
I'll keep it open for two more opinions. @kingdavidmartins @Pl4gue any suggestions? @ForsakenHarmony had a really good point in square it about readability and that while hte closure was cool, it was completely unneeded
I would keep them as well. @skatcat31
Handling variadic arguments, spreading, array mapping/reducing, anonymous closures - all of these neat tricks feel hard to learn when you are a beginner, but when you figure them out, you start using them and get used to them. If we want people to learn, better teach them all the neat tricks, even if they need to stop for a minute and read the code more carefully.
I def agree with you all. It is also a learning opputunity. We should keep them
Seeing as we all agree on this topic, I am closing the issue then and we are keeping anonymous closures. If anyone has anything else to say, comment below and we can reopen.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.