Coder Social home page Coder Social logo

Comments (19)

DartBot avatar DartBot commented on May 12, 2024

This comment was originally written by [email protected]


Removed Type-Defect label.
Added Type-Enhancement label.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

This comment was originally written by [email protected]


We should add PHI while we're at it :-)


Added Area-Language label.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

This comment was originally written by [email protected]


Added Triaged label.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

gbracha avatar gbracha commented on May 12, 2024

Removed Area-Language label.
Added Area-Library label.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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
reading "2 * Math.PI" than "Math.TAU". I believe it would be actively harmful to add this constant, as it would encourage programmers to write programs that other programmers could not read. The costs outweigh the benefits.


Set owner to [email protected].
Added WontFix label.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

This comment was originally written by [email protected]


Do you really think than:

degreeToRadians(num degree) {
  return degree * Math.TAU / 360;
}

Cannot be readed while

degreeToRadians(num degree) {
  return degree * Math.PI / 360 / 2;
}

Or to keep it as a simple cross-multiplication:

degreeToRadians(num degree) {
  return degree * Math.PI / 180;
}

First time I see this operation I was so confused, what's 180? Arent the total degrees 360? why just the half?

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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
http://code.google.com/p/dart/issues/detail?id=14

| Do you really think than:
|
| degreeToRadians(num degree) {
| return degree * Math.TAU / 360;
| }
|
| Cannot be readed

Yes. People won't know what it means.
 
| while
|
| degreeToRadians(num degree) {
| return degree * Math.PI / 360 / 2;
| }
|
| [can be read]

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:
|
| degreeToRadians(num degree) {
| return degree * Math.PI / 180;
| }

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

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

This comment was originally written by [email protected]


Comment #­15
[...]
A google search for "Math.PI / 180" turns up 2.7 MILLION hits
[...]

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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.

from sdk.

DartBot avatar DartBot commented on May 12, 2024

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".

from sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.