These are chat archives for airbnb/javascript

9th
Sep 2015
Brian Diehr
@BDiehr
Sep 09 2015 01:27
You also dislike the implicit return in (x) => 2x?
ugh
I would hate to live in a world where ES6 was what you wanted it to be
pablo de la sotta
@pdelasotta
Sep 09 2015 01:40
There’s no need to get personal, friend.
Andrey Mikhaylov (lolmaus)
@lolmaus
Sep 09 2015 06:58
@BDiehr, I dislike inconsistency.
Huáng Jùnliàng
@JLHwung
Sep 09 2015 07:31
Hi, how shall one name the following function to show their difference?
Hi, how shall one name the following function to show their difference?
Hi, how shall one name the following function to show their difference? 1. Vanilla function, 2. function that returns Promise/A+, 3. generator functions.
sorry I press enter and it sends instead of line breaking.
Angus Perkerson
@anguspiv
Sep 09 2015 07:54
Press shift + enter to add a line break
Huáng Jùnliàng
@JLHwung
Sep 09 2015 08:10

Thank you, I might repeat my question again.
how shall one name the following function to show their difference?

  1. Vanilla function
  2. function that returns Promise/A+
  3. generator functions.

e.g. We can name 1. and 2. with suffix like Sync and Async. For example readdirSync and readdirAsync But how shall one differ 1/2 to 3 on the name of function? readdirGenerator or something else? I havn't find any style guides on that.

Andrey Mikhaylov (lolmaus)
@lolmaus
Sep 09 2015 08:26
@JLHwung You can delete unwanted messages. :)
@JLHwung Also, you could write lines one by one.
@JLHwung As for your question, you might want a flavor of the Hungarian notation. Not the generally accepted one (see Wikipedia), but the original one (see http://www.joelonsoftware.com/articles/Wrong.html ).
@JLHwung I would name them something like fooBar, fooBarPrm and fooBarGen.
Huáng Jùnliàng
@JLHwung
Sep 09 2015 12:09
@lolmaus Thank you! No sure if Hungarian style is out of fashion but it makes sense somehow. The airbnb style guide even claims not to use generator function. :worried:
Andrey Mikhaylov (lolmaus)
@lolmaus
Sep 09 2015 12:11
@JLHwung The Wikipedia-described Hungarian style is out of fashion. Joel's original Hungarian style makes perfect sense, and a lot of people are using some form of it without knowing. :) Even those who believe that Hungarian notation sucks. :)