Hacker News new | ask | show | jobs
by smt88 3284 days ago
This has been answered pretty extensively on Q&A sites like StackOverflow and Quora, so I'd recommend Googling it for the most thorough, specific, and well-vetted answers.

Here are links to get you started:

- https://stackoverflow.com/questions/1089018/why-cant-decimal...

- https://stackoverflow.com/questions/5098558/float-vs-double-...

> It blows my mind that so much effort has put into things like functions taking functions as arguments, and the characteristics of classes - yet a computer can't handle basic calculator math out of the box.

Much effort was put into it, but no amount of work allows a computer to violate the laws of math. The fact that computers use binary and have limited memory isn't something that can be hand-waved away.

You're also talking about two totally different types of problems. Classes make programming languages easier to organize (at least theoretically) -- it's easy to change the syntax of a language, but hard to know exactly how it should look to be the easiest to use.

1 comments

Thanks for the links. It all seems like excuses.
Yeah, you're right. Computer scientists are whiny little babies who can't sit down and work hard enough to overcome the laws of mathematics. What a bunch of losers, focusing on designing programming languages instead of defying natural laws.

And you know what, why haven't they invented human-level AI yet? Are they just that lazy?

Don't even get me started on chemists... too lazy and stupid to learn a simple method to turn iron into gold.

And we can't even time travel or leave the galaxy yet (◔_◔). C'mon scientists.

https://www.google.com/#safe=off&q=2*3.18

One person's "excuses" may be another's "set of rationalizations for a collection of engineering requirements that aren't ideal in every dimension".
When I've brought this up it's pretty obvious that while their were historical reasons behind it, not it because of cargo cult ideas of how numeric variables should work.

In any higher level language the default numeric variable should be an algebraic decimal float, not a binary int or float. Doesn't mean ints and floats shouldn't exist, but they shouldn't be the default.

Meaning when a programmer writes

   number x = 2/3;
number should equal 2/3. Not an approximation of 2/3.