Scala is novel generation JVM language, which is generating popularity equally an choice of arguably i of the most pop linguistic communication Java. It's non yet equally pop equally Java, but piece of cake getting momentum. As to a greater extent than in addition to to a greater extent than Java developers are learning Scala in addition to inspired yesteryear Twitter, to a greater extent than in addition to to a greater extent than companies are using Scala, it's futurity looks really bright. To start with, Scala has several practiced feature, which differentiate it from Java, but same fourth dimension it has lot of similarities equally good e.g. both Scala in addition to Java are JVM based language, You tin ship away code Scala inward Java way in addition to Scala tin ship away work whatsoever Java library, which inward my catch a cracking determination made yesteryear designers of Scala.
Since tremendous industrial plant receive got already been done inward the shape of opened upwardly origin framework in addition to library inward Java, it's best to reuse them, rather than creating a carve upwardly laid for Scala.
Out of several differences, i of the original deviation betwixt Scala in addition to Java is its powerfulness to convey wages of Functional programming paradigm in addition to multi-core architecture of current CPU.
Since electrical flow CPU evolution tendency is towards adding to a greater extent than cores, rather than increasing CPU cycles, it also favors functional programming paradigm.
Though this differences may non hold upwardly significant, i time Java 8 volition innovate lambdas, but it mightiness hold upwardly equally good early on to comment.
Apart from the functional programming aspect, in that place are many other differences equally well. One of the obvious ones is improved readability in addition to succinct code.
Java is ever on firing draw of piece of work for beingness equally good verbose, I recall Scala does convey attention of that in addition to code which took five to vi lines inward Java, tin ship away hold upwardly written inward simply 2 to three lines inward Scala.
If you lot honey to acquire yesteryear next examples, thus I gauge Scala CookBook is an some other practiced buy, contains tons of examples on dissimilar features of Scala.
5) Someone tin ship away struggle that Java is to a greater extent than readable than Scala, because of actually nested code inward Scala. Since you lot tin ship away define functions within the function, within other functions, within of an object within of a class. The code tin ship away hold upwardly really nested. Though sometimes it may better clarity, but if written poorly it tin ship away hold upwardly actually tricky to understand.
6) One to a greater extent than deviation betwixt Scala in addition to Java is that Scala supports Operator overloading. You tin ship away overload whatsoever operator inward Java in addition to you lot tin ship away also create novel operators for whatsoever type, but equally you lot already know, Java doesn't back upwardly Operator Overloading.
7) Another major deviation betwixt Java in addition to Scala is that functions are objects inward Java. Scala treats whatsoever method or component equally they are variables. When means, you lot tin ship away move yesteryear them some similar Object. You mightiness receive got seen the code, where i Scala component is accepting some other function. In fact, this gives the linguistic communication enormous power.
8) Let's compared some code written inward Scala in addition to Java to run into How much dissimilar it look:
You tin ship away run into that Scala version is lot succinct in addition to concise than Java version. You volition run into to a greater extent than of such samples i time you lot start learning functional programming concepts in addition to patterns. I am eagerly waiting for Scala Design Patterns: Patterns for Practical Reuse in addition to Design yesteryear John Hunt, which is non yet released in addition to solely available for pre-order. This majority is going to liberate this month.
That's all on this article virtually similarities in addition to differences betwixt Scala in addition to Java. Though they are 2 carve upwardly programming language, they receive got a lot inward common, which is non a bad affair at all in addition to inward my catch that's the solely thing, which volition house Scala equally Java choice if at all it happens inward future.
As I had mentioned inward my ship 10 reasons to acquire Java programming, that Java tools, libraries, in addition to community are it's the biggest pull in addition to if Scala tin ship away somehow reuse that, it volition hold upwardly good ahead, forget virtually competing, though, it volition convey years to construct such community in addition to code.
For a Java programmer, I would tell nil impairment inward learning Scala, most probable you lot volition acquire few practiced practices, which you lot tin ship away fifty-fifty apply inward Java equally corporate sector is yet inward Java, in addition to Scala inward its early on days, you lot tin ship away hold upwardly good ahead if you lot acquire Scala now.
On a closing note, at high-level Scala looks really promising, all pattern determination made are actually practiced in addition to they came afterwards several years of experience amongst Java.
One reading whatsoever Scala Programming majority is must to construct fundamental, which is indeed necessary, given rather steep learning bend of Scala, but, if you lot experience to a greater extent than comfortable amongst courses thus you lot tin ship away convey those equally well. Pluralsight receive got many costless coureses to acquire Scala, I receive got listed a dyad of them below, you lot tin ship away also convey a look. Anyway, hither is my listing of books in addition to preparation courses to acquire Scala in addition to Apache Spark:
Further Learning
Scala: Getting Started
Learn By Example: Scala
Rock the JVM! Scala in addition to Functional Programming for Beginners
Thanks, folks, Enjoy learning Scala.
Since tremendous industrial plant receive got already been done inward the shape of opened upwardly origin framework in addition to library inward Java, it's best to reuse them, rather than creating a carve upwardly laid for Scala.
Out of several differences, i of the original deviation betwixt Scala in addition to Java is its powerfulness to convey wages of Functional programming paradigm in addition to multi-core architecture of current CPU.
Since electrical flow CPU evolution tendency is towards adding to a greater extent than cores, rather than increasing CPU cycles, it also favors functional programming paradigm.
Though this differences may non hold upwardly significant, i time Java 8 volition innovate lambdas, but it mightiness hold upwardly equally good early on to comment.
Apart from the functional programming aspect, in that place are many other differences equally well. One of the obvious ones is improved readability in addition to succinct code.
Java is ever on firing draw of piece of work for beingness equally good verbose, I recall Scala does convey attention of that in addition to code which took five to vi lines inward Java, tin ship away hold upwardly written inward simply 2 to three lines inward Scala.
Similarities betwixt Scala in addition to Java
Following are some of the major similarities betwixt Scala in addition to Java programming linguistic communication :
1) Both are JVM based language, Scala produces same byte code equally Java in addition to runs on Java Virtual Machine. Similar to Java compiler javac, Scala has a compiler scalac, which compiles Scala code into byte code. At this level, all JVM linguistic communication similar Groovy, JRuby, Scala becomes equals to Java, because they work same retentiveness space, type organization in addition to run within the same JVM.
2) You tin ship away telephone phone Scala from Java in addition to Java from Scala, it offers seems less integration. Moreover, you lot tin ship away reuse existing application code in addition to opened upwardly origin Java libraries inward Scala.
3) Major Java programming IDE similar Eclipse, Netbeans in addition to InetelliJ supports Scala.
4) One to a greater extent than similarity betwixt Scala in addition to Java is that both are Object Oriented, Scala goes i steps farther in addition to also supports functional programming paradigm, which is i of its marrow strength.
The Well-Grounded Java Developer book has some overnice introduction on JVM languages like Scala, Groovy, and Closure, which is worth reading. In this article, nosotros volition run into such variety of similarities in addition to differences betwixt Scala in addition to Java.
1) Both are JVM based language, Scala produces same byte code equally Java in addition to runs on Java Virtual Machine. Similar to Java compiler javac, Scala has a compiler scalac, which compiles Scala code into byte code. At this level, all JVM linguistic communication similar Groovy, JRuby, Scala becomes equals to Java, because they work same retentiveness space, type organization in addition to run within the same JVM.
2) You tin ship away telephone phone Scala from Java in addition to Java from Scala, it offers seems less integration. Moreover, you lot tin ship away reuse existing application code in addition to opened upwardly origin Java libraries inward Scala.
3) Major Java programming IDE similar Eclipse, Netbeans in addition to InetelliJ supports Scala.
4) One to a greater extent than similarity betwixt Scala in addition to Java is that both are Object Oriented, Scala goes i steps farther in addition to also supports functional programming paradigm, which is i of its marrow strength.
The Well-Grounded Java Developer book has some overnice introduction on JVM languages like Scala, Groovy, and Closure, which is worth reading. In this article, nosotros volition run into such variety of similarities in addition to differences betwixt Scala in addition to Java.
Differences betwixt Scala in addition to Java
type inference, treating everything equally an object, component passing, in addition to several other features.
2) Scala is designed to limited mutual programming patterns inward an elegant, concise in addition to type-safe way. The linguistic communication itself encourage you lot to write code inward immutable style, which makes applying concurrency in addition to parallelism easily.
3) One difference, which some mightiness non uncovering is learning curve. Scala has a steep learning bend equally compared to Java, my catch may hold upwardly slightly biased because I am from Java background, but amongst thus much happening amongst lilliputian code, Scala tin ship away hold upwardly actually tricky to predict.
The syntax of Scala looks confusing in addition to repulsive equally compared to Java, but I am certain that is simply the starting hurdle. One way to overcome this hurdle is next a practiced Scala majority like Programming inward Scala or Scala inward Action, both are fantabulous books for a Java developer, who wants to acquire Scala
4) One of Scala's cool characteristic is built-in lazy evaluation, which allows deferring time-consuming computation until absolutely needed in addition to you lot tin ship away do this yesteryear using a keyword called "lazy" equally shown inward below code :
2) Scala is designed to limited mutual programming patterns inward an elegant, concise in addition to type-safe way. The linguistic communication itself encourage you lot to write code inward immutable style, which makes applying concurrency in addition to parallelism easily.
3) One difference, which some mightiness non uncovering is learning curve. Scala has a steep learning bend equally compared to Java, my catch may hold upwardly slightly biased because I am from Java background, but amongst thus much happening amongst lilliputian code, Scala tin ship away hold upwardly actually tricky to predict.
The syntax of Scala looks confusing in addition to repulsive equally compared to Java, but I am certain that is simply the starting hurdle. One way to overcome this hurdle is next a practiced Scala majority like Programming inward Scala or Scala inward Action, both are fantabulous books for a Java developer, who wants to acquire Scala
4) One of Scala's cool characteristic is built-in lazy evaluation, which allows deferring time-consuming computation until absolutely needed in addition to you lot tin ship away do this yesteryear using a keyword called "lazy" equally shown inward below code :
// loading of icon is actually slow, thus solely do it if demand to exhibit image
lazy val images = getImages() //lazy keyword is used for lazy computation
if(viewProfile){
showImages(images)
}
else(editProfile){
showImages(images)
showEditor()
}
else{
// Do something without loading images.
}
If you lot honey to acquire yesteryear next examples, thus I gauge Scala CookBook is an some other practiced buy, contains tons of examples on dissimilar features of Scala.
5) Someone tin ship away struggle that Java is to a greater extent than readable than Scala, because of actually nested code inward Scala. Since you lot tin ship away define functions within the function, within other functions, within of an object within of a class. The code tin ship away hold upwardly really nested. Though sometimes it may better clarity, but if written poorly it tin ship away hold upwardly actually tricky to understand.
6) One to a greater extent than deviation betwixt Scala in addition to Java is that Scala supports Operator overloading. You tin ship away overload whatsoever operator inward Java in addition to you lot tin ship away also create novel operators for whatsoever type, but equally you lot already know, Java doesn't back upwardly Operator Overloading.
7) Another major deviation betwixt Java in addition to Scala is that functions are objects inward Java. Scala treats whatsoever method or component equally they are variables. When means, you lot tin ship away move yesteryear them some similar Object. You mightiness receive got seen the code, where i Scala component is accepting some other function. In fact, this gives the linguistic communication enormous power.
8) Let's compared some code written inward Scala in addition to Java to run into How much dissimilar it look:
Java:
List<Integer> iList = Arrays.asList(2, 7, 9, 8, 10);
List<Integer> iDoubled = new ArrayList<Integer>();
for(Integer number: iList){
if(number % 2 == 0){
iDoubled.add(number 2);
}
}
Scala:
val iList = List(2, 7, 9, 8, 10);
val iDoubled = iList.filter(_ % 2 == 0).map(_ 2)
You tin ship away run into that Scala version is lot succinct in addition to concise than Java version. You volition run into to a greater extent than of such samples i time you lot start learning functional programming concepts in addition to patterns. I am eagerly waiting for Scala Design Patterns: Patterns for Practical Reuse in addition to Design yesteryear John Hunt, which is non yet released in addition to solely available for pre-order. This majority is going to liberate this month.
That's all on this article virtually similarities in addition to differences betwixt Scala in addition to Java. Though they are 2 carve upwardly programming language, they receive got a lot inward common, which is non a bad affair at all in addition to inward my catch that's the solely thing, which volition house Scala equally Java choice if at all it happens inward future.
As I had mentioned inward my ship 10 reasons to acquire Java programming, that Java tools, libraries, in addition to community are it's the biggest pull in addition to if Scala tin ship away somehow reuse that, it volition hold upwardly good ahead, forget virtually competing, though, it volition convey years to construct such community in addition to code.
For a Java programmer, I would tell nil impairment inward learning Scala, most probable you lot volition acquire few practiced practices, which you lot tin ship away fifty-fifty apply inward Java equally corporate sector is yet inward Java, in addition to Scala inward its early on days, you lot tin ship away hold upwardly good ahead if you lot acquire Scala now.
On a closing note, at high-level Scala looks really promising, all pattern determination made are actually practiced in addition to they came afterwards several years of experience amongst Java.
Recommended Books in addition to Courses on Scala for Java Programmers
Books are best way to acquire a novel programming language, commencement of all, they incorporate consummate information but also inward much to a greater extent than readable in addition to authentic form. I strongly recommend following, at least, i book, earlier jumping on blogs in addition to online articles.One reading whatsoever Scala Programming majority is must to construct fundamental, which is indeed necessary, given rather steep learning bend of Scala, but, if you lot experience to a greater extent than comfortable amongst courses thus you lot tin ship away convey those equally well. Pluralsight receive got many costless coureses to acquire Scala, I receive got listed a dyad of them below, you lot tin ship away also convey a look. Anyway, hither is my listing of books in addition to preparation courses to acquire Scala in addition to Apache Spark:
Further Learning
Scala: Getting Started
Learn By Example: Scala
Rock the JVM! Scala in addition to Functional Programming for Beginners
Thanks, folks, Enjoy learning Scala.