News for hackers. Stuff that matters.
Re:Less is more: language features by kmicklas on Monday April 13, 2015 @10:17PM (#9371706)
I take issue with the single-number-type thing. This guy is conflating two different reasons/ways to divide up number types - for transparency w.r.t. machine (optimization) and by conceptual types (integer vs natural number vs fractional, etc.). The first arguably doesn't belong in a high level language. The second arguably is _exactly_ what a truly high level language should have.
Re:Less is more: language features by sink on Monday April 13, 2015 @10:30PM (#9371776)
I agree. Just think of how often what you really want to express in your program is a function that takes a Positive Integer, and any other type of number is simply wrong.
Re:Less is more: language features by dagw on Tuesday April 14, 2015 @06:22AM (#9373199)
I've often thought you could add that to your type system somehow? Sometimes you want to express that this variable can only take numeric values between 0-1 or this variable can only take string values with exactly three uppercase ASCII letters. Just like you don't need a special string type to handle three letter strings, you don't need a special number type to handle positive integers, you just need a way to represent subsets in your type systems.

On the other hand I'm decidedly old school and get very uncomfortable around languages that at least don't separate floats from ints.

Re:Less is more: language features by ygra on Tuesday April 14, 2015 @06:37AM (#9373238)
Pascal had subrange types, which were quite nice in that regard. Although I don't remember using them that much.
Re:Less is more: language features by kephra on Tuesday April 14, 2015 @05:52AM (#9373111)
e.g. money is badly represented as float.

just my $0.0200000000001 on that topic.

Re:Less is more: language features by mmphosis on Tuesday April 14, 2015 @01:06PM (#9375694)
and what about "floating" currency?

just my 0.00603698 KWD Kuwaiti Dinars on that topic