3 ms·
Counterpoint: Java. Java was designed during a time when operator overloading was considered abysmal language design. But that was mostly due to the experienc
by bhaak 7y ago
Counterpoint: Java.
Java was designed during a time when operator overloading was considered abysmal language design.
But that was mostly due to the experiences collected with C++ (or maybe also Perl?).
- saagarjha 7y agoI have dreams of throttling the person who decided that operator overloading was overrated every time I work with BigInteger.
- deniscepko2 7y agoDo you have examples of real world code you had to write with BigInteger? just for amusements sake
- saagarjha 7y agoI can't seem to find the file for it, but I solved #2 on this with Java and wanted to die by the end of it: http://socalcontest.org/history/2017/SC2017ICPCProblems.pdf http://socalcontest.org/history/2017/SC2017ICPCProblems.pdf
- dtech 7y agoIt's one of the things I really like about scala, x call y is always equivalent to x.call(y) This combined with relaxed method name restrictions allow you to do "operator overloading" in quite a sane way and allow you to write bigint + 1 or set contains element. Kotlin is a bit more conservative and only translated the built-in operators to fixed methods: + to the plus method etc.
- gowld 7y agoWrite your program on ints and then transform it with sed before compiling.
- saagarjha 7y agoThat sounds significantly more difficult.
- Avshalom 7y agoThe worst part is there is a talk by Steele called Growing a Language about designing Java where specifically talks about the importance of overloading so that things like future number representations like BigInteger can be first class
- b2gills 7y agoPerl 5.000 came out in 1994, the same year as Java. Perl didn't even have objects before that. So no it wasn't from experience with Perl.