Going on the size of the language spec, and the number of "special cases", or the number of defined keywords, Java is actually *more* complex than Ruby/Python/Scala/Groovy
Comparing Java and Scala -------------------------------- Scala: everything is an object (no primitives) any method can be used in operator notation +, -, *, / etc are all valid method names can you see where this is going? 1 + 2 is just sugar for 1.+(2) myList append 42 is equivalent to myList.append(42) etc... User defined implicit conversions Java: has primitives all operators are predefined and baked in, no overloading some implicit conversions specified by the language now consider how the following statement would be treated in both languages: "hello " + worldObject + 42 Scala has a predefined implicit conversion from Any->String, this would be used on worldObject and 42 (remember, no primitives) and the resulting strings concatenated, job done! In Java? + is defined as you would expect for primitives but, Strings also get treated as primitives in many ways, such as this special-case of the + operator as defined for strings, if the right-hand value isn't already a string, it'll call toString() on it unless it's null, in which case the string "null" will be substituted except when it's a primitive (which is a special case within this special case), where the appropriate conversion will be made instead And, really, Java is full of these special-cases and sub-special-cases. Strings are a good source of them, as are primitives, enums, and generics. All stuff that Scala takes a more coherent, consistent approach to throughout the language. On 28 July 2010 16:31, phil.swen...@gmail.com <phil.swen...@gmail.com>wrote: > Complex? Actually Java is a pretty simple language. Ruby/Python/ > Scala/Groovy all have many more features and richer syntax than Java. > > The APIs are overly complex. And these APIs set a precedent for > creating over-engineered super abstract solutions which unfortunately > most people followed. I mean so we really have to look at everything > as streams when a string will suffice 95% of the time? Or look at the > java mail API. Could you make the simple use case of sending a text > email any harder? > > Verbose? Yep. I'll agree there..... in making java language > constructs simple, this resulted in quite a bit of verbosity (no > properties/events/closures/operator overloading/etc). It was an over- > reaction to C++'s complexity. Strip the language down to almost > nothing.... > > Not productive? I'll agree here too. Java the language is some of > the problem.... why in 2010 can't I do: String blah = "Hello $ > {user.name}, your account ${account.number} is assigned.". why can't > we use String blah = ' "no need to escape my "s! ' and other little > things like that.... but these are just irritants really. > The real problem isn't java so much as it is all the frameworks. Ant > is an absolute abomination. XML is not a scripting language! How in > God's name did people blindly go down this path of using xml for > automation/builds? It has led to undebugable build hell, build.xml > files calling build.xml files calling build.xml files. It has led to > java trailing all other languages in automation. > > Other problem frameworks : JSF (xml hell), Axis (ever hear of dynamic > binding? no, we must generate every stub - your time is not > important), OSGi (reduce coupling by making it impossible to get > anything done), Struts (could we have any more layers of indirection?) > > I still have't found a java web framework I like, so I use rails. But > roo and play both look promising.... java needs more of this type of > approach IMO > > > > > On Jul 24, 3:06 am, Blanford <euroscript...@gmail.com> wrote: > > http://developers.slashdot.org/article.pl?sid=10/07/23/1838243 > > > > I have wondered this for years, how Java could be the language of > > choice for web application design. > > > > Java is so much more complex and unproductive compared to a language > > like Python. > > This adds up to time and money. > > > > If I ran a business I would definitely use Java as little as possible. > > > > snydeq writes > > "Google distinguished engineer Rob Pike ripped the use of Java and C++ > > during his keynote at OSCON, saying that these 'industrial programming > > languages' are way too complex and not adequately suited for today's > > computing environments. 'I think these languages are too hard to use, > > too subtle, too intricate. They're far too verbose and their subtlety, > > intricacy and verbosity seem to be increasing over time. They're > > oversold, and used far too broadly,' Pike said. 'How do we have stuff > > like this [get to be] the standard way of computing that is taught in > > schools and is used in industry? [This sort of programming] is very > > bureaucratic. Every step must be justified to the compiler.' Pike also > > spoke out against the performance of interpreted languages and dynamic > > typing." > > -- > You received this message because you are subscribed to the Google Groups > "The Java Posse" group. > To post to this group, send email to javapo...@googlegroups.com. > To unsubscribe from this group, send email to > javaposse+unsubscr...@googlegroups.com<javaposse%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > > -- Kevin Wright mail/google talk: kev.lee.wri...@gmail.com wave: kev.lee.wri...@googlewave.com skype: kev.lee.wright twitter: @thecoda -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javapo...@googlegroups.com. To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.