-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Tau constant to core Math class #14
Comments
This comment was originally written by [email protected] Removed Type-Defect label. |
This comment was originally written by [email protected] We should add PHI while we're at it :-) Added Area-Language label. |
This comment was originally written by [email protected] Added Triaged label. |
This comment was originally written by [email protected] How about Math.AnswerOnTheUltimateQuestionOfLifeTheUniverseAndEverything (i.e. 42)? This is a safe addition with no side effects and minimal impact to the language and runtime. |
Removed Area-Language label. |
This comment was originally written by [email protected] TAU is an important constant, which frequently gets used many times inside a loop. Only having pi, would encourage people to do 2*pi inside that loop, which would (slightly) degrade performance, and will be bad for readability. Plus the tau manifesto DOES make some good points. |
This comment was originally written by [email protected] Both TAU and PHI are used in the sunflower sample, which perfectly illustrates their importance in even the most basic graphical application. |
This comment was originally written by [email protected] As noted in the "Tau Manifesto" http://tauday.com/#sec:the_number_tau Math textbooks use 2Pi instead of Tau. It's more readable to continue to be consistent with the textbooks and see 2Pi everywhere. |
This comment was originally written by [email protected] Comment 8 advocates for abolishing all Dart language features that can be represented by other syntax currently used in textbooks. No =>, no short constructor syntax etc. |
This comment was originally written by [email protected] I'm normally conservative about certain things. For instance, when Pluto was no longer a planet, it annoyed me. When people mispronounce "zoology" or say "10 items or less" instead of "10 items or fewer", it irks me. However, after reading about Tau, I have to agree that this is a worthwhile constant to include. Jokes aside (Math.AnswerOnTheUltimateQuestionOfLifeTheUniverseAndEverything has a place in good literature, not in mathematics), if someone wants to be consistent with textbooks, they can continue to use Pi. There is nothing that would stop a Pi fan from continuing to use Pi. For Tau fans, there will also be an option. Otherwise, Tau fans would need to define Tau in all applications, adding additional overhead. As for 2Pi degrading performance, one would expect that the compiler could be intelligent enough to recognize when two constants/literals are involved in a calculation that it could combine these into a single representative constant where appropriate. So, I don't believe performance is a valid argument unless the compiler isn't smart enough to deal with 2Pi appropriately. That aside, from a "it just makes sense" standpoint, Math.TAU should be included. |
This comment was originally written by [email protected] I don't believe we should include this constant. It's obscure, even among the most skilled programmers, and we want Dart to appeal to the broad mass of programmers. The great majority of programmers would have an easier time Set owner to [email protected]. |
This comment was originally written by [email protected] Do you really think than: degreeToRadians(num degree) { Cannot be readed while degreeToRadians(num degree) { Or to keep it as a simple cross-multiplication: degreeToRadians(num degree) { First time I see this operation I was so confused, what's 180? Arent the total degrees 360? why just the half? |
This comment was originally written by [email protected] I think what's being said here is that it has nothing to do with how readable the math is. It's that the dart language isn't here to solve issues with constants, it's here to gain the most traction with developers. More developers are familiar with the use of Math.PI than are developers who are familiar with the concept of TAU, which is a relatively new concept. I agree that TAU is gaining traction and, in terms of mathematics, it just makes sense. However, if just 5% of developers out there have never heard of TAU, they're going to be more confused about this strange constant than they'd be about the example you gave, which is what users of pi have already been dealing with for decades. |
This comment was originally written by [email protected] Sorry, my last comment was mangled by email gateway; I'll try again: Comment #12 on issue #14 by [email protected]: Add Tau constant to core Math class | Do you really think than: Yes. People won't know what it means. The above is nasty (the sequence of divisions), but I don't think anyone skilled in the art would actually write it. | Or to keep it as a simple cross-multiplication: The above is just fine. In fact, it's an idiom. A google search for "Math.PI / 180" turns up 2.7 MILLION hits. If we wanted to shorten it, we could provide Math.degreesToRadians and radiansToDegrees methods, but I'm not sure it's worth adding these convenience functions. Josh |
This comment was originally written by [email protected] Maybe it's just me, and maybe i'm not as "skilled" of a programmer as you 1337 hax0rs, but when i come across something i'm not familiar with in code, I use this thing called "Google" to "search" the "internet" and "learn" information about it. While I know it's not the goal of the Dart language to "educate" people or to force them to "learn" something new, since everyone who knows a shred of programming will obviously understand all dart code without having to learn any new syntax or keywords or design patterns, I can't garner why there are so many "haters" out there who don't want a measly constant added to Math. Who are you to tell others how to write their code? Just because you think you're more skilled and know better than me, why are you forcing me to use PI when I might want to use TAU instead? It's not like we're talking about removing PI, FFS. Let's just add TAU and move on with life. |
This comment was originally written by [email protected]
If you can google "Math.PI / 180" you can also google "TAU". Do you really prefer to add two methods to Math to solve just one case instead of adding a constant? So it's not because you wanted to keep Math clean, it's not you don't want to add things to Math, it's you don't want TAU at Math. Agree with Comment #16, I don't see the problem here, when I started at Javascript didn't know the meaning of Math.E but that does not mean it shouldn't be there. What's wrong with having a constant on Math than many will use? Does it broke your program? I think this is so much "feelings" here. A. Matías Q. |
This comment was originally written by [email protected] Perhaps this can be summarized in this way, but correct me if I'm wrong. Dart is a new programming language. It's still in the early phase hoping to gain traction. As a result, dart will add Math.TAU as long as JavaScript (currently a more popular language) adds Math.TAU. This is my understanding, at least. Not that dart is just trying to copy JavaScript, but that it doesn't intend on "leading the way" to introducing new constants that other programming languages don't include. If the more popular languages add Math.TAU, then it would only make sense for dart to eventually follow suit. |
This comment was originally written by [email protected] I don't see your point, we are talking about add TAU to Dart, I don't know and don't care if Javascript or other languages includes it or not. |
This comment was originally written by [email protected] iam's argument at 18 is invalid. We have control of the Dart language; we don't have control of Javascript. Dart is already adding things other languages don't have, such as "isolates". |
This issue was originally filed by [email protected]
With a new language, we are taking the opportunity to introduce better concepts, right? So please add Tau, the ratio of a circle's circumference to its radius (i.e. 2pi), to the Math class.
Leave Math.PI as is, but please add Math.TAU
This is a safe addition with no side effects and minimal impact to the language and runtime.
Tau manifesto: http://tauday.com/
The text was updated successfully, but these errors were encountered: