Introduction
You must have seeing people abusing and hating JS, because they compare Javascript with other languages like Java, C++, Go ...
For further actions, you may consider blocking this person and/or reporting abuse
Posts such as these are targeted at beginners. The concepts and alternatives you suggest are not just your own opinions regarding what is good and bad but also makes things unnecessarily complex.
Yes, you're very smart but not everyone has a decade of experience under their belt. Those who have, aren't going to come and read these posts.
I fail to see how anything he mentioned makes things unnecessarily complex.
That's the problem with "senior" developers on dev.to. They fail to see things from a beginner's perspective. If you know these concepts then this post isn't for you.
Really nice clickbait. 👌
I'm not a senior developer but medior. Maybe I don't see it well from the beginner perspective - that's what I asked the question and that's why I was expecting a good answer.
Honestly I don't see why people find arrow methods so confusing. I find them much clearer and easier to read.
The first example implements an iterator interface along with recursive. The watered down version is cute but multi-level arrow functions and currying, do you think a beginner would find that easy?
I hope you found this answer good enough. If you still don't see how people find this difficult perhaps you could sit down with a beginner or better yet, spend some time teaching JavaScript to someone as their first programming language, as in actually mentor someone.
You'll be very frustrated.
I didn't click on this when its previous title, so, I won't concern myself with that. If we are discussing this, let's not casually ignore the iterator interface and recursion. Currying also causes additional complexity because you're throwing functional programming into the mix.
Regardless of what I say, you'll remain firm in your point of view and speak from your experience as if it is the experience of every new developer. Anyways, I don't want to talk about this further.
I prefer your answers but I have a very grave problem with this attitude where senior developers shove their opinions down other's throat. Even I haven't really studied functional programming, what are the odds that a beginner would've.
Have a good day Luke!
Cheers
Thanks for the feedback, renamed the title.
Yes, I avoided arrow function in currying because its quite easy to understand returning functions for beginners.
Almost every thing in JS can be written on our own, it doesn't need to know the original javascript concept.
Cheers
Of course, you're allowed to give feedback. I hope I didn't cause any strife, if I did, I'm sorry. Regarding seniorities, well, that's something we can agree on. Thanks. :)
Currying is a hard concept on it's own for beginners. Arrow functions don't make it much harder in my opinion - it's just a different syntax.
... yeah, whatever.
Insightful post for beginners! Well done! Some advice: do make sure you use the tag #beginners or at least set the post's expert level down to a lower level since it is showing up in timelines of people that are not so which has caused this mess in the comment section.
Thanks for the feedback, will update it.
Comparing Generator function with eval is vague.
I would use generator function instead of creating my own generator object then use it.
Its an open world, not always everyone has to agree with everyone. We all have our opinion. You are free to share your opinion neither I am hiding any negative comments.
You are also free to report this post.
Believe it or not, English is my third language language. I'm fluent in Pashto that's spoken in Pakistan and Afghanistan. I can speak Urdu which is like 90% same as Hindi so I can speak Hindi too.
I can read Arabic and understand Punjabi a little but I'm not counting them as language. Spanish is also an interesting language. I was thinking about properly learning 4th.
Not sure if I should learn Mandarina, Spanish or German. It really depends on which country I'll decide to move to. =)
I like generators. Redux-Saga library has been developed using generators. I would say generators is not bad way. Its our choice whether to use generators or not
Just a quick note, asynchronous functions don’t return a function to resolve, but instead a promise.
Otherwise, this is a great article!
Oh, I missed that here, will update.
Thanks for pointing out :)
FYI except for call, apply and bind methods (which are JS features) the rest are realted to functional programming paradigm rather than JS.
Be my english tutor :)
Generator in action with example
github.com/sadanandpai/generators-...
Cool agreed.
Although my native language is Hindi not English ;)
Async await returns a promise, not a prototype...
Thanks for the fix.
Cheers!
In the Closure example
The parameter "childName", where will it get its value from?
I'm new to js and this issue is confusing me
This is one of the weird cases where it is actually easier to show with TypeScript:
So it's at
child('Dogecoin');
that we supplychildName
.A version that uses function declarations only:
I believe it's a bit more difficult to understand.