| Author |
Stuck learning Java First.
|
Sayth renshaw
Greenhorn
Joined: Apr 17, 2011
Posts: 16
|
|
There's one problem learning Groovy. All the resources are for Java programmers. I have used Python and recently went through C course on wibit.net to broaden my understanding and skills. Try I have to locate a book that doesn't Concentrate "in java you do this so this is how it looks in groovy and in Java you do this and this is how it is in Groovy".
I will be learning Java(I have a book in post currently for Java) but wanted to play with groovy. Has anyone found a book or resource which says hey you don't know squat diddly about Java and this is Groovy just as if you got a Python book. So a this is how you get stuff done(maybe a little tip/note) and we will delve into how this relates to java in chapter 13(for example).
Does anything exist? It seems I am going to have to Java first and theen come back to groovy.
Found people know this issue exists such as point 2 here http://gavingrover.blogspot.com/2008/05/groovy-like-syntax-for-scheme.html . From there "(2) Document the Groovy Language so non-Java programmers can learn it easily. I've realized the Java libraries are quite complex, and a dynamic language on top of it, while easy for existing Java programmers, may be more difficult to learn than Python or Ruby for non-Java programmers."
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2693
|
|
I agree with your concern- lot of material cross reference java and show how groovy does it groovier But I would recommend you to learn the Java syntax and how OO principles with respect to Java. You need to learn Java in depth. Because in Groovy you usually make use of the Java APIs. Am sorry I am not aware of any such material (I am a Java programmer, playing around various JVM languages, Groovy in particular)
|
Mohamed Sanaulla | My Blog
|
 |
Hussein Baghdadi
clojure forum advocate
Bartender
Joined: Nov 08, 2003
Posts: 3334
|
|
|
Maybe you have to know Java after all, because Groovy tries to enhance Java in many different places.
|
 |
Sayth renshaw
Greenhorn
Joined: Apr 17, 2011
Posts: 16
|
|
John Todd wrote:Maybe you have to know Java after all, because Groovy tries to enhance Java in many different places.
Well I agree Groovy attempts to add in language features not present in Java, groovy had closures from the start etc. And as Java implements the feature it will get removed from groovy due to redundancy tokenparser etc.
Scala doesn't even seem to be taking the groovy path and it could be viewed as enhancing java like groovy. Look at the "Programming Scala" Programming Scala the author doesn't hit Java until chapter 31. And another scala book mentions java primitives in chapter 3 and then doesn't revist Java until chapter 11. vsscala book
Jython the jython book doesn't explain java until chapter 10 Jython book
I guess if there's anyone here writing a book it might be a good focus that sets you apart from others. It would be good if the groovy docs for this could be fleshed out a little Groovy for people new to java and groovy
|
 |
Hussein Baghdadi
clojure forum advocate
Bartender
Joined: Nov 08, 2003
Posts: 3334
|
|
Sayth renshaw wrote:
John Todd wrote:Maybe you have to know Java after all, because Groovy tries to enhance Java in many different places.
Well I agree Groovy attempts to add in language features not present in Java, groovy had closures from the start etc. And as Java implements the feature it will get removed from groovy due to redundancy tokenparser etc.
Absolutely not!
Java could have closuers/lambdas as many as it wants, this isn't going to affect Groovy language in any way.
Groovy is self sustained language and independent entity.
|
 |
Sayth renshaw
Greenhorn
Joined: Apr 17, 2011
Posts: 16
|
|
Absolutely not!
Groovy is self sustained language and independent entity.
Exactly!! Then why do none of the "Learn Groovy" books treat it that way?
Java could have closuers/lambdas as many as it wants, this isn't going to affect Groovy language in any way.
Well actually it does because then its redundant to have it in groovy. Here is an interview with the developers of groovy discussing new features, additions and removals from the language InfoQ Groovy & Grails Developers.
|
 |
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
In order to gain traction it was important that Groovy be easily accessible to Java developers. That is why all books cover it this way. Groovy isn't radically different from Java the same way other JVM languages are; Scala for example. It's more like syntactic sugar on top of Java. Yes, it is a self sustained language but it is still very much Java'esque. I think most people learn new things by relating it to something they already know. So to me, the direction books take with Groovy make sense. And I agree with Mohamed that there are some foundation principals that a language like Groovy just don't teach very well. Having that foundation in Java or some other strongly typed OO language is important.
|
My Blog | DZone Articles
|
 |
chris webster
Ranch Hand
Joined: Mar 01, 2009
Posts: 361
|
|
Well, as Gregg points out, Groovy is aimed at the Java/JVM market and offers a lot of quick benefits to Java developers, because there is a lot of common ground in the languages. I think it's a little more than "syntactic sugar", but that's certainly an important part of the appeal for Java developers - Groovy makes a lot of things much easier than Java.
And because many of the useful features of Groovy e.g. Builders are deliberately designed to make using existing Java features easier, it often helps to know something about the underlying Java implementations. Also, Groovy is a great way to take advantage of existing Java libraries in the context of a quick and easy dynamic scripting environment, for example.
So there is a close relationship between the two languages, and it's inevitable that the books and tutorials reflect this.
But don't feel you have to become a Java expert before you can experiment with Groovy, especially as you should already be familiar with many of the concepts (OO, duck typing, lambdas/closures etc) from working with Python. For example, you could look at Dierk Koenig's excellent book Groovy In Action which is a pretty thorough guide to the language and its distinctive features. And it may be that without too much Java background, you could find it easier to write idiomatic Groovy, rather than starting with pure Java and then just tweaking it to look more like Groovy.
|
Oracle bloke
|
 |
 |
|
|
subject: Stuck learning Java First.
|
|
|