home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.linux.misc      Linux-specific topics not covered by oth      135,536 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 135,261 of 135,536   
   John Ames to Richard Kettlewell   
   Re: C/C++ timeline (was Re: Python: A Li   
   06 Feb 26 14:43:16   
   
   From: commodorejohn@gmail.com   
      
   On Fri, 06 Feb 2026 22:29:37 +0000   
   Richard Kettlewell  wrote:   
      
   > I don’t get on well with Java either, but I think the last two   
   > examples are written in an unnecessarily obscure fashion. I think you   
   > would normally write the following:   
   >    
   >      Integer a = 2, b = 3;   
   >      Integer c = Integer.max(a, b);   
   >    
   > ...which is certainly a trifle verbose, but not actively misleading.   
      
   I could've been clearer, I s'pose, but it was my point that there are,   
   for a random subset of math functions, multiple ways to write the same   
   thing, using classes with no direct relationship - java.lang.Math isn't   
   a subclass of java.lang.Number and its subclasses, nor the other way   
   around, nor is there some kind of Math interface that they both   
   implement. (In fact, these methods aren't even part of Number - they   
   only belong to its subclasses individually!)   
      
   Why, then, do they duplicate functionality? Why some methods and not   
   others? Why are the methods for specific Number types static instead of   
   specific to the object, so that one could at least have Math.round(num)   
   for arbitrary number variables, but Double.round() for reflexive   
   rounding of a specific Double object?   
      
   It's just arbitrary and weird.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca