r/programming • u/knife_sharpener • Feb 22 '15
Java Makes Programmers Want To Do Absolutely Anything Else With Their Time
http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35
Upvotes
1
u/btchombre Feb 22 '15 edited Feb 22 '15
Pattern matching just to cast an object that I know is a float to a float? That's ridiculous. Furthermore, making a cast more verbose doesn't change anything, and doesn't remove the "code smell". Pattern matching just makes the problem worse in this case as I have to write significantly more code.
Let me give you an example of the problem I had. I was using spark to read a row of data from a database. It returns an area of objects as the row, and I have to cast each column into its appropriate data type. Doing this in C# or Java or C++ is straightforward and simple, but using pattern matching for this is laughable, and using .AsInstanceOf[Type] is more verbose than bloody Java.
As far as operator overloading goes, that's great that I can do it, but its not very helpful when the standard library never uses the feature. I Should be able to compare Timestamps and Date objects without calling methods and without creating my own operators.