Math.TAU

A Matías Quezada amatiasq at gmail.com
Thu Jul 3 06:14:38 PDT 2014


PS: Also in ES6 modules it will be not possible to extend module Math.

---
A. Matías Quezada
Senior Javascript Developer
amatiasq at gmail.com



2014-07-03 15:02 GMT+02:00 A Matías Quezada <amatiasq at gmail.com>:

> Extending host objects? I don't think that favors readability and
> maintainability.
>
> If I don't know TAU (or some one read my code and doesn't know it) and see
> this I will look for Math.TAU on MDN, not on the project and if by chance I
> guess it's defined somewhere in the project how will I know? there is no
> reference to the file where the variable is created.
>
> Sounds like create a global variable, we know the consequences this has
> for readability and maintainability.
>
> ---
> A. Matías Quezada
> Senior Javascript Developer
> amatiasq at gmail.com
>
>
>
> 2014-07-03 9:47 GMT+02:00 Thaddee Tyl <thaddee.tyl at gmail.com>:
>
> On Wed, Jul 2, 2014 at 5:52 PM, A Matías Quezada <amatiasq at gmail.com>
>> wrote:
>> >  1. Use Math.PI * 2 everywhere
>> >  2. Create a TAU constant on every file
>> >  3. Create a TAU constant on a single file and require this file from
>> > everywhere just for this
>>
>> 4. Do Math.TAU = Math.PI * 2 once somewhere. It even works in node.js,
>> inside of the same process, leaking through require()s.
>>
>> And some do it:
>> <https://github.com/search?q=%22Math.TAU%22&type=Code&ref=searchresults>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140703/f68f3523/attachment.html>


More information about the es-discuss mailing list