Sure, I generally do stick with static languages. Groovy was promoted as a step up from Java, though, which until that line of code is rejected, it clearly isn't. A step sideways, perhaps.
Isn't Groovy adding static typing now? Will that line be rejected thereafter? Java's lack of type inference.. sure. Does Groovy infer types? On Jul 23, 2012 6:24 AM, "Russel Winder" <[email protected]> wrote: > On Sun, 2012-07-22 at 16:41 -0300, Ricky Clarkson wrote: > > Let me know when int i = "hello"; is rejected by the compiler and I'll > look > > again. > > Clearly you are a static typing sort of person, so stick with static > typed languages. Dynamically typed languages do not obey the same typing > rules as statically typed languages, and nor should they; the whole > point is that statically and dynamically typed languages are different. > > int i = 'Hello' > > can never be caught as an error at compile time by a dynamically typed > language since all type checking is at run time. Groovy correctly > throws an exception on this line with ClassCastException. > > Conversely, tell me when typing works properly in Java. > > ArrayList<String> x = new ArrayList<String> ( ) ; > > really? Why? This is 201x, surely type inference should be an integral > part of any modern language. And really: > > ArrayList<String> x = ArrayList<> ( ) ; > > is just no solution at all. > > -- > Russel. > > ============================================================================= > Dr Russel Winder t: +44 20 7585 2200 voip: > sip:[email protected] > 41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected] > London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder > -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
