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,259 of 135,536   
   Richard Kettlewell to John Ames   
   Re: C/C++ timeline (was Re: Python: A Li   
   06 Feb 26 22:29:37   
   
   From: invalid@invalid.invalid   
      
   John Ames  writes:   
   > ...except when, for some reason, you don't:   
   >   
   >     Integer a = 2, b = 3;   
   >     Integer c = b.max(a, b);   
   >   
   > ...except that this is not properly a method of the *object,* but a   
   > static method of the *class,* so:   
   >   
   >     Integer a = 2, b = 3;   
   >     Integer c = b.max(a, c);   
   >   
   > ...is valid even though b has nothing at all to do with matters.   
   > Smalltalk got this right (math operations are methods of Number, and   
   > other number types like Integer are subclasses of Number;) Java is just   
   > arbitrary and confusing for no reason.   
      
   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.   
      
   --   
   https://www.greenend.org.uk/rjk/   
      
   --- 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