ReadWrite - java 8http://readwrite.com/tag/java-8
enCopyright 2015 Wearable World Inc.http://blogs.law.harvard.edu/tech/rssTue, 31 Mar 2015 11:07:48 -0700Developers Are Adopting Java 8 In Droves<!-- tml-version="2" --><div tml-image="ci01bc5a180001c80a" tml-image-caption=""><figure><img src="http://a5.files.readwrite.com/image/upload/c_fill,cs_srgb,dpr_1.0,q_80,w_620/MTI1MDczOTM3MjQyNjQ4NTQ2.jpg" /><figcaption></figcaption></figure></div><p><em>Warning: serious programming geekery ahead.</em></p><p>With the release of Java 8 back in March 2014, the developer community was primarily excited about two things. One was support for&nbsp;lambda expressions<a href="http://www.developer.com/java/start-using-java-lambda-expressions.html"></a>, also known as <a href="http://en.wikipedia.org/wiki/Anonymous_function">anonymous functions</a>, which (in <a href="http://www.drdobbs.com/jvm/lambda-expressions-in-java-8/240166764">Cay Horstmann's admirably simple definition</a>) are blocks of code you can pass around in a program for later execution—or, if you prefer more formal terms, "a way to <a href="http://www.developer.com/java/start-using-java-lambda-expressions.html">represent one method interface using an expression</a>." Second was Java 8’s embrace of the multicore world.&nbsp;</p><blockquote><p><strong>See also: <a href="http://readwrite.com/2014/02/20/java-8-scala-competitors-bffs-martin-odersky">Java And Scala: Former Competitors May Be BFFs Before Long</a></strong></p></blockquote><p>Functional programmers viewed the new directions that Oracle was steering Java 8 as a strong validation of core principles in languages like Scala, Erlang and Haskell. Detractors suggested the new directions of Java 8 were potentially a threat to supplant those languages. (I covered the <a href="http://readwrite.com/2014/02/20/java-8-scala-competitors-bffs-martin-odersky">implications of Java 8 for other languages</a> back in February).</p><div tml-image="ci01a87e1ee244860f" tml-image-caption="Jonas Bonér" tml-render-size="small" tml-render-position="right"><figure><img src="http://a5.files.readwrite.com/image/upload/c_fill,cs_srgb,dpr_1.0,q_80,w_620/MTE5NDg0MDYxMjM1NDQ3MzEx.jpg" /><figcaption>Jonas Bonér</figcaption></figure></div><p>Six months after the release of Java 8, San Francisco-based Typesafe—the commercial backers of Scala, Play Framework, and Akka—has released a follow-up survey of Java developers. A hefty sample size of 3,000 Java developers not only updates our data on Java 8 adoption, it highlights other trends driving enterprise application development today.</p><p>For some context on the survey findings (<a href="http://info.typesafe.com/COLL-2014-10-20-Java-8-II-Survey-Report-LP.html?lsd=COLL-2014-10-20-Java-8-II-Survey-Report&amp;lst=RW">you can download the full findings here</a>), I spoke with Typesafe CTO and Akka creator <a href="https://twitter.com/jboner">Jonas Bonér</a>.</p><p><em><strong>ReadWrite</strong>: </em><em>So tell us where Java developers are with Java 8 and what the survey data suggests.</em></p><p><strong>Jonas Bonér</strong>: In our original Java 8 adoption survey six months ago, we found that two thirds of Java developers planned to upgrade within two years, which is really aggressive. So we were surprised to learn with this new survey that two-thirds now have actually already upgraded or plan to upgrade within a year—the adopters are six months ahead of what was already a fast pace.&nbsp;</p><p>When you think about how much Java is running in production, you just don’t expect to see this much of the market move that quickly.</p><p>Of the excitement around Java 8 for those who have adopted it already, lambdas continue to be at the top of their list of things they’re enjoying. Eighty percent called “lambdas with expressions and virtual extension models” the feature they cared about the most. With Java 8’s support of lambda expressions, type inference, syntactic sugar for static methods, and new APIs like Stream and CompletableFuture, Oracle has basically taken 9 million Java developers back to the future with a renaissance around functional programming.</p><h2>The Lambda Lies Down On Broadway</h2><p><em><strong>RW</strong>: Why the major interest in lambdas?</em></p><p><strong>JB</strong>: Well, first it simplifies traditional callback-driven programming by adding syntactic sugar on top of anonymous classes. Lots of Java APIs are making use of this callback style and all of these libraries will be able to make direct use of lambdas, enabling its users to write more fluent and less verbose code. </p><p>This is great, but the biggest benefit in my opinion is that it enables a functional style of programming, which has a lot of advantages, but primarily delivers more succinct and expressive code that is easier to compose and reuse. But perhaps most importantly, code that allows you to work with state, safely, in a concurrent environment.</p><p>In the single-threaded world of the 80s and 90s, dealing with state in applications was a lot easier. But, as we all know, the multicore world of distributed computing today has opened up a Pandora’s box and made it much harder for Java developers to shoehorn all of this state into a perceived reality of running in a single core.&nbsp;</p><p>Technically it is possible, through mutexes and other blocking primitives, but it just doesn’t scale.&nbsp;</p><p>In Java the default is mutable state, but a functional approach to programming—which can be simplified as composition of functions operating on immutable state—can make the design of concurrent and asynchronous (event-driven) applications so much easier, allowing us to take full advantage of all the exciting new multicore hardware on the market.&nbsp;</p><p>Examples of this include the JDK itself with its Stream and CompletableFuture libraries. Event-driven programming also opens up for a more loosely coupled architecture, with isolated components communicating in a non-blocking fashion, and forms the basis for the principles defined in the <a href="http://www.reactivemanifesto.org/">Reactive Manifesto</a>.</p><p><em><strong>RW</strong>: </em><em>What about those that do not have plans to upgrade, what’s the holdup?</em></p><p><strong>JB</strong>: Of Java 8 holdouts, 69% are running Java 7, and 26% are running Java 6. For the majority of the Java 8 holdouts, their decision has nothing to do with Java 8 and more to do with how their businesses operate. Among those shying away from Java 8, 37% said their non-adoption was related to “hurdles with legacy infrastructure” and 19% said “organizational obstacles/red tape.”</p><p>However, it would be a mistake to call organizations that don’t upgrade to the latest versions of software “laggards." Sometimes I think that analysis of market adoption of new versions overlooks the legacy infrastructure and existing libraries that organizations have to upgrade—where the cost of upgrading may not make financial sense, and it has nothing to do with the merits of the new version itself.&nbsp;</p><p>Java’s footprint in production is so massive, there are just a lot of moving parts at most enterprises when thinking about upgrading a language that touches so much of its infrastructure.</p><h2>Apache Spark Is On The Move; Docker, Not So Much</h2><p><em><strong>RW:&nbsp;</strong>You polled those 3,000 Java developers on their use of other technologies. Given the large sample size, I’d be interested to hear about other surprise findings that came up.</em></p><p><strong>JB</strong>: Amazon EC2 is used by more than half of respondents (57%), making it the most common cloud technology used by Java developers. Apache Hadoop ranked second in popularity at 30% and Big Data newcomer Apache Spark is being used in production by 17% of respondents.&nbsp;</p><p>Given that Spark was only introduced to the market in June of 2013, we think that’s really an incredible production usage statistic, and a sign of just how much mindshare Spark is capturing in the Big Data world.</p><p>One of the head scratchers was around Linux containers, where the data didn’t really line up. While 60% of respondents claimed to be investigating Linux containers, and 23% said they use Docker, only 13% said they are actually using Linux containers in production.</p><p>There were really no surprises where application server adoption was concerned. The latest findings confirm that adoption of lightweight, open source Java Web servers like Tomcat and Jetty are far and away more popular than traditional heavyweight JEE application servers like WebLogic or WebSphere, which are nearly tied in popularity.</p><p>I was also surprised about the Internet of Things adoption: 21% claimed to be running networked devices/M2M/IoT in production, with 22% “planning for future deployments.” That’s way out ahead of the IoT adoption curve for the rest of the industry.</p><p><em>Lead photo courtesy of <a href="http://www.shutterstock.com">Shutterstock</a></em></p>Thank lambdas!http://readwrite.com/2014/10/20/java-8-adoption-apache-spark-internet-of-things
http://readwrite.com/2014/10/20/java-8-adoption-apache-spark-internet-of-thingsHackMon, 20 Oct 2014 13:59:53 -0700Matt AsayJava And Scala: Former Competitors May Be BFFs Before Long<!-- tml-version="2" --><p>The <a href="http://www.scala-lang.org/">Scala programming language</a> celebrated its 10th anniversary last month while Java 8 is poised for its “final” release in March. Ironically, the two languages that competed for so many years are starting to look increasingly similar.</p><p>Java still <a href="http://redmonk.com/sogrady/2014/01/22/language-rankings-1-14/">tops the charts</a> but Scala has gained new adherents due to its emphasis on functional programming. As Java 8 adds significant Scala features, there's a case to be made that Scala will diminish.&nbsp;</p><p>Though there's still plenty of reason to think&nbsp;<a href="http://www.linkedin.com/groups/Will-Java-8-Kill-Scala-746917.S.245445785">Java 8 will obviate much of the reasons people turn to Scala</a>,&nbsp;I recently sat down with Martin Odersky, the creator of the Scala language and <a href="http://typesafe.com/company/team">chairman of Typesafe</a>,&nbsp;to get his assessment of where things stand between two languages that share a love for the <a href="http://en.wikipedia.org/wiki/Java_virtual_machine">Java Virtual Machine</a>.</p><h2>Scala-Like Java Is Good For Scala</h2><p><em><strong>ReadWrite</strong>: Java 8 seems to have embraced some of the basic concepts behind your original design of Scala. Is that vindication? Or do you fear that Java 8’s enhancements might suck developers away from the Scala community?</em></p><p><strong>Martin Odersky</strong>: Java 8 represents one of the most significant changes to the language in its history, with new constructs that will change the traditional ways Java developers have approached solving problems.</p><p>People often ask me if these features coming to Java will slow the adoption of Scala.&nbsp;Quite the opposite!&nbsp;Instead, I feel the acceptance of these features by the Java Community Process validates our innovation in language design on the JVM. As developers come to understand what these features are and how they work, they will also develop a better appreciation of the more extensive support of functional programming that Scala provides.</p><p>There is also likely going to be an increased interest to investigate Reactive tools such as Akka and Play Framework, even via the Java API.</p><h2>Java 8’s Impact On Scala</h2><p><em><strong>RW</strong>: What will be the main impact of Java 8 on Scala?</em></p><p><strong>MO</strong>: The list of features being included in Java 8 is actually quite long, but several of them are particularly interesting to me. Java 8 will definitely bring the Java and Scala developer communities closer together.</p><p>I also believe it will make life easier for polyglot language support on the JVM, while at the same time giving Java developers just a taste of how languages are evolving to support a higher degree of concurrency and parallelism.</p><h2>Java Learns Some New Lambdas Tricks: Will Developers Follow Along?</h2><p><em><strong>RW</strong>: What features in Java 8 stand out for you?</em></p><p><strong>MO</strong>: To me, the most interesting new feature is lambdas. It will be more helpful for Scala to be able to standardize the bytecode emitted by Scala’s compiler in the way Java implements its support of this feature, using Functional Interfaces.</p><blockquote tml-render-position="right" tml-render-size="medium"><p><strong>See also: <a href="http://readwrite.com/2014/01/08/in-demand-tech-skills-of-2013-java">The Most In-Demand Tech Skills: Why Java And The Classics Ruled In 2013</a></strong></p></blockquote><p>I doubt this will be a difficult leap for most existing Java developers who are already familiar with anonymous implementations of interfaces, which Java has permitted for some time now. The same rules will apply, such as not being able to “close over” non-final external values.</p><p>Java 8’s implementation of lambdas will bring new methods to the java.util.stream.Stream type that will sound very familiar to Scala developers. In my experience, these methods make writing high-level collection code a lot easier and act as a “gateway drug” to change to a more functional style overall. Heavy users of these abstractions would then also appreciate the additional readability Scala bring to the table with itsfor expressions.</p><p>Having these implementations will also likely be very helpful for tools such as Akka and Play Framework in supporting a more cohesive Java API, allowing them to create Java-based functional interfaces where they could not before. This will mean the APIs will be very similar regardless of whether you’re calling them from Scala or Java, increasing usability for programmers in both languages.</p><h2>Make Bytecode, Not War</h2><p><em><strong>RW</strong>: Any other features that stand out in Java 8?</em></p><p><strong>MO</strong>: Scala developers will also be excited by Java 8’s inclusion of default implementations of methods in Java Interfaces. Scala compiler developers have long had to jump through hoops to create bytecode for Scala traits that would be acceptable to the JVM, such as creating an interface for the trait and a class for the implementation of methods that would be extended by classes extending that trait. Now the bytecode emitted by the Scala compiler can be cleaner and match the Java specification, while continuing to support linearization.</p><h2>Java: A Little More Like Scala Every Day</h2><p><em><strong>RW</strong>: It sounds almost like you are in “embrace mode” with the Java community. I’m reminded of Spring creator Rod Johnson's&nbsp;<a href="http://youtu.be/DBu6zmrZ_50">controversial ScalaDays keynote</a> last summer in New York. Johnson listed examples of Scala being opaque and hardcore as obstacles to widespread adoption. He called for Scala to become more Java-like, more friendly and usable to the mainstream of developers.</em></p><p><strong>MO</strong>: Rod is a good friend of Scala’s, actually! He sits on the board of Typesafe with me. And Typesafe is focused on providing first-class support for Java developers with the Akka concurrency toolkit and the Play Framework.</p><p>In fact, Typesafe believes that the addition of these new Java 8 language features will help us expose more powerful and fluid APIs for Java developers that closely mirror much of the way we code from Scala. This is the benefit of having Java introduce constructs similar to those in Scala. The introduction of these features, as well as other Scala-influenced features such as the purely non-blocking CompletableFuture and Parallel Collections, underscore the impact Scala’s success has had in influencing the future of Java.</p><p><em>Lead image by <a href="http://www.flickr.com/photos/yukop/">yukop on Flickr</a></em></p>Java and Scala have long competed for developers' affections, but Java 8 might transform their relationship entirely.http://readwrite.com/2014/02/20/java-8-scala-competitors-bffs-martin-odersky
http://readwrite.com/2014/02/20/java-8-scala-competitors-bffs-martin-oderskyHackThu, 20 Feb 2014 10:44:00 -0800Matt Asay