Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We're not using arrow functions for everything. Why are you assuming this?

We're using shorthand syntax in methods inside Vue.js objects [1], they also don't need the "function" keyword. In fact, they are suggested in the second link you posted, please read again. Arrow functions wouldn't even work in this situation.

We're mainly using two forms: shorthand and arrow. That's how we only have 21 instances of the "function" word in our entire JS codebase, and we could remove all of them if we wanted. That's what you asked for: a "JS app that completely bans the 'function' keyword". Well, we don't ban but it's possible.

And please read my comment again: I explicitly mentioned that this is not a rule, and I never enforced it. The team (39 committers ATM) reached that result organically, mostly influenced by my own personal style.

And sorry if this sounds harsh, but it seems that you have extremely limited knowledge of Javascript and ES6, so I'd suggest learning before you make such claims before you make a fool of yourself.

Btw, you're seem to be the one holding on to dogma here, since you seem unable to accept that the keyword is not strictly necessary in a large app.

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...



[flagged]


First of all, are you aware of shorthand methods? Are you aware that you can have non-arrow functions without the "function" keyword :) ES6 has grown :)

And there was no goal intended with the grep. This is what you wrote:

> And I'd love to see the codebase of a JS app that completely bans the "function" keyword

I just grepped "function" to give you a personal anecdote of an app that doesn't need to use the "function" keyword much.

That was the first time I interacted with you, I was trying to be nice then, and you were completely hostile. Some of the replies were completely uncalled for.

---

EDIT: You just edited your message to add the part about shorthand methods. My point still stands. I never claimed to be only using arrow functions (in fact, you're the one who DID claim I was only using arrow functions!). I only claimed we rarely use the "function" keyword.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: