News for hackers. Stuff that matters.
Re:Swift: Madness of Generic Integer by viraptor on Tuesday March 03, 2015 @06:51PM (#9141643)
I don't understand why would you advocate almost-copy&paste in situations where you have to deal with types of similar structure. I mean you already use generic ints in almost every programming language out there. You don't write `a int32+ b`, or `a uint8+ b`. It's just `a+b`.

> It's faster to write (because you don't need to figure out how to do in a generic way)

And every time you copy/paste code, it's easier and faster to make stupid copy/paste mistakes either the first time, or when you change one version, but not the others.

Re:Swift: Madness of Generic Integer by ubernostrum on Tuesday March 03, 2015 @07:13PM (#9141824)
To be fair, I believe OCaml does use different infix operators for integral vs. floating-point arithmetic (or did, when last I looked at it years ago).

But yes, the "problem" of just writing generic code involving things that are numbers, and letting your compiler or interpreter figure out the most efficient way to represent them in memory, is not really a problem; it's been solved by plenty of languages.