DEV Community

Discussion on: A harsh critic.

Collapse
 
0ctavia profile image
Octa

As a full on beginner, could you point to resources that explain the reason behind your comments? I tend to generally go with arrow functions a lot.

I can't comment on the technicalities (obviously, from the comment above), but it seems like the human side of the entire affair could have been handled better, or at least with something else than kicking you off the review. I hope you regain confidence soon.

Thread Thread
 
deciduously profile image
Ben Lovy • Edited

I'm not Adam, but this post gives a thorough discussion of why it's not a great idea to use arrow functions specifically as method definitions, under the heading "Where You Should Not Use Arrow Functions" a little over halfway through. They're fine to keep using in general, just with caveats.

The short answer is "JavaScript", the medium answer is that arrow functions are like closures or lambdas if you know what those are from other languages, which means they operate in their parent's calling context as opposed to creating their own separate context. This can cause unintended behavior at worst, or at least lead to code reliant on implicit as opposed to explicit behavior which hurts readability.

Also a beginner, though, Adam may have a better/more correct take.

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀

Yep pretty much my opinion on arrows for example. They don't make sense everywhere, even if they do work everywhere. And your sighted post is bang on the money ... Imo 😁.