@zeuxcg
As somebody who really wants this capability, I really disagree with this change, at least, in the fact that it has overwritten the default tostring
behaviour.
I really think that the tostring
behaviour before this change, while slower, was actually a much better option, and much more desirable, because it has always acted as error correction in the exact ways that I need it to: readability. Yes, I lose out on that tiny little dot of precision, but, I never care about that when I want to convert a float to a readable string. Error correction is extremely useful for maintaining readability and being able to understand where my math is going wrong, and also being able to understand mathematical operations. Now, if I want to do math and have it just work, I simply cannot, I am forced to introduce implementation specific corrections, which string.format
does not solve!
This is not good for beginners, or for me. It’s confusing, and difficult. As others brought up, floating point error is a limitation, not a feature.
Secondly, this is almost entirely just an advanced feature, and it’s a breaking one! As such, I think that it should be offered separately. This simply doesn’t make anything I do commonly easier (or reasonably faster!), it only makes readability harder, and the cases where I will want this are limited to advanced uses and in depth debugging.
And, as much as I love optimization and luau getting faster, faster tostring
on numbers like this also just isn’t a good justification in my opinion, because tostring
isn’t for fast code, tostring
is for readability. It’s bad practice to leave tostring
or print
inside of very large math loops, and if I want to see or use a number’s full floating point value, I don’t want to use tostring
for this.
I have been using math.floor
rounding my entire time programming, because that’s what I was taught. I was taught this by the Roblox wiki, and by the many many pieces of code I had available to me on Roblox when I started. And these practices continue to carry on still. Even if they are incorrect, older tostring
does a good job at correcting them.
And, I know this comes up every time a breaking change happens, but, I can also see it breaking older Roblox games, because, well, older Roblox games are notorious for not following good practices. Games being buggy doesn’t mean they aren’t still fun and I want to play them, it doesn’t mean they aren’t profitable either, because they are usually the one place I spend my money, and for one simple reason: The game doesn’t push me, it respects me, so I feel more compelled to respect the game’s developer, and, I get a lot more out of my money that way.