| Author |
Any new control structures or new aspects covered in ' The Well Grounded Java Developer'?
|
charlsy chuks
Greenhorn
Joined: May 18, 2012
Posts: 21
|
|
Thanks Martijn,
That was a quick answer to my question on J2ME . I read that switch statement can now take string cases. Are there any other any changes or new features for existing control structures as we know them in Java 6?
What are functional languages like? Could you throw more light on Clojure, Groovy and Scala. Thank you.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32689
|
|
Functional languages work largely by returning values, and most functions are called in a sort of recursive mannr.
By new control structures, you might mean try‑with‑resources, or multiple catch types, or the <> in generics.
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
|
Campbell's got it! Our Functional Programming Slideshare presentation might help give you some motivations/understanding for functional programming as a Java developer.
|
Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
|
 |
Palak Mathur
Ranch Hand
Joined: Jan 29, 2007
Posts: 303
|
|
I think I will add it to Clojure FAQ so that it is easier for new learners to Functional Programming to grab the essence.
|
Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
|
 |
charlsy chuks
Greenhorn
Joined: May 18, 2012
Posts: 21
|
|
Hi
Thanks Guys for the answers guys but I really need to get to the root of this. Functional languages help us write more safer OO code but one of the main features is that code and data are one?
Hmmm that for me looks like potential trouble if you ask me.
Where do we draw the boundaries so we do not mistake? Maybe my questions arise from the fact that I have used non-functional imperative languages. However, I am not biased and I am willing to explore these
new range of functional languages especially Clojure which is also Dynamic.
|
 |
Martijn Verburg
author
Bartender
Joined: Jun 24, 2003
Posts: 3268
|
|
Functional does not trump OO nor visa versa. There are just certain idioms where functional works out better, for example filter, map and reduce type operations that don't alter the original collection. You'll find common places in Java code such as Listeners, Handlers, Callables and Runnables as will as the traditional for loop with an if filter inside of it that are ripe for writing in a more functional manner.
NB: Arguably anonymous inner classes in Java are functional... it's just a clunky syntax :-)
|
 |
 |
|
|
subject: Any new control structures or new aspects covered in ' The Well Grounded Java Developer'?
|
|
|