Besides Java, is it Scala or Groovy? [Reprinted], scalagroovy

Source: Internet
Author: User

Besides Java, is it Scala or Groovy? [Reprinted], scalagroovy

Original article address

Scala and Groovy are both JVM-based languages. Compared with Java, Scala and Groovy have more simpler syntax and richer expression capabilities. Scala and Groovy are good choices for developers who want to leave the JVM and avoid complicated Java statements. But which one can take the lead in the future development process? Which one is the future development direction?

Earlier last year, an article named "Scala, Groovy killer? The blog compares Scala and Groovy:

   

The core difference between Scala and Groovy is that the former is static. Some may argue that this makes it more complicated to achieve the scripted goal, and scripted is the motivation of Groovy. Scala, however, has a complete system feature that makes Groovy look more like a toy. For example, Scala has "sequence comprehensions ". This feature makes the expression of the algorithm very compact and powerful.

Scala also has more features that prove to be very useful, such as Nested classes, currying and algebraic pattern matching. It also supports generics and annotations similar to that added by JDK1.5. These are just the tip of the iceberg.

Derek Young wrote that "Scala compares Groovy: static types are the key to performance (scala-vs-groovy-static-typing-is-key-to-performance )". In this article, he gave a practical example, trying to illustrate that Scala's performance for the same algorithm is much higher than Groovy's.

However, Scala is not perfect, and it also has some obvious defects. Rick Hightower sharply criticized Scala syntax in a recent blog:

   

Scala is not a better choice. After reading the Scala document, my idea is: although the features of this language sound good, the syntax makes me want to give up.Why do things have to be different for different purposes?Scala makes Groovy look more delicious than before.

Hate is a strong word. I hate Scala syntax. Please stop promoting this syntax ....... Is Scala a good idea? Yes. Just borrow it ......

All in all, Scala looks like the next language that has been overly publicized. You just need to introduce the essence to Groovy and then throw those bad syntaxes. My favorite Scala features are reasoning type and strong type. C #3.0. (I don't need C #, so I don't like some of its features .)

Rick Hightower also suggested Sun should invest in Groovy, rather than making unnecessary investments in JRuby.

   

Groovy is more like Java, easier to use, and the syntax does not make developers dislike it. Why does Sun invest so much money in JRuby?

The investment should be made to Groovy. So that Java developers can learn Groovy faster, and if there are tools to support them, it is more likely to do so.

To demonstrate Sun's unwise investment in Ruby, Rick Hightower also cited a Statistical Chart to show that the trend of Ruby adoption is still relatively low:

In addition,Both Ruby, Scala, and Groovy have their own Web frameworks written in their respective languages. These frameworks are Rails, Lift, and Grails.Although many items in Lift and Grails are referenced by Rails, Grails inherits other existing Java technical frameworks, this will undoubtedly protect users' or manufacturers' existing investments in this area. The Grails framework is described as follows:

   

Grails is built on these concepts and significantly reduces the complexity of Building Web applications on the Java platform. The difference is that these are built on established Java technologies such as Spring and Hibernate.

Currently,Scala and Groovy are both developing rapidly. In the current situation, Groovy has the advantages of ease of use and seamless connection with Java. Scala has the advantages of performance and some advanced features.If the two can learn from each other's advantages in the development process to enrich themselves, it is undoubtedly a good news for developers. As mentioned by the author of the first post:

   

We don't want to see a desperate struggle, but we want to see that the Groovy team with more pragmatic ideas can work with Scala teams with more academic ideas, create a powerful and easy-to-use language.

Who will you bet on?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.