• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stuck learning Java First.

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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."

 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you have to know Java after all, because Groovy tries to enhance Java in many different places.
 
Sayth renshaw
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my frustration.

Where I work, I work in a QA role. The administration (who were / are Java Dev's) decided to move QA to write code in a scripting language (which is a good goal), and they choose Groovy as this language. It's fine and all... but their intention was: Let's pick a language easier to pick up and use than Java.

The problem is people who don't know Java very well (like me) have a very difficult time picking up Groovy. A language is only easy to pick up as there are beginner resources available. All learning resources on Groovy really target Java Dev's. Each book I pick up has a target audience of experienced Java Developers. Unlike Ruby, where I can find dozens of learning resources aimed at a true beginner. When I see material that explains that == in Java is not the same as in Groovy and Groovy treats it as a .equals and on they go, it's really lost on a guy like me... I have to first learn what this means in Java... get that understanding then roll back to Groovy and get an idea of how equivalence is different... and man what a waste of time, if my end goal is Groovy.

So this "easier" language really requires the individual to first learn Java... get some experience in Java... then roll back to picking up Groovy. Which invalidates the whole point in my case (the point being to pick a scripting language that is easy to pick up and the user doesn't have to learn Java.)

What a lot of people making decisions to force Groovy as official languages in companies, don't understand, is that not everyone is a Java developer. Typically QA roles are not Java Dev's or SDET's... So the enforcement of Groovy is fine, if Groovy was really aimed at beginners as well as Java Dev's... but it really isn't. I've found one so called "beginner's" tutorial online for Groovy. but it isn't really that good. I really wish there were many resources out there for Beginners to OO coming to Groovy - i.e. like the Ruby/Rails community has.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic