The Evolution of Java

7,377 views
6,970 views

Published on

The evolution history of Java. What Java is good for? The rising of dynamic languages in JVM.

Published in: Technology, News & Politics

The Evolution of Java

  1. 1. The Evolution of JavaFu Cheng
  2. 2. Author of Understanding the Java 7 Author of 40+ technical articles on
  3. 3. We talk about ...
  4. 4. Java is …A Programming LanguageJust like C/C++, Ruby, Python and many others
  5. 5. Java is ...A Programming PlatformLanguage + Libraries + VM
  6. 6. Java is ...Popular
  7. 7. Java is ...http://en.wikipedia.org/wiki/History_of_programming_languagesOld - maybe not old enough
  8. 8. Java is ...Object-OrientedNearly everything is a object
  9. 9. Java is ...Easy to learn
  10. 10. Java is ...(Maybe) too easy to learnThe Perils of JavaSchoolsby Joel SpolskyJava is not, generally, a hard enoughprogramming language that it can beused to discriminate between greatprogrammers and mediocre programmers.
  11. 11. Java is …JDK 1.01996 1997 1998 2004 20062000 2002 2011JDK 1.1J2SE 1.2J2SE 1.3J2SE 1.4J2SE 5.0Java SE 6Java SE 7http://en.wikipedia.org/wiki/Java_(programming_language)#VersionsSlowly evolving
  12. 12. Java has ...Strong Platform Medium languageWeak core libraries
  13. 13. Popular Platform• Desktop– 850M PCs, 2011• Mobile– Android– Java ME• Enterprise– LinkedIn– Ebay– Paypal– AOL– Alibaba– Netflixhttp://w3techs.com/technologies/details/pl-java/all/all
  14. 14. JVM• Shield applications from OS layer details– Threading using java.lang.Thread• Provide runtime support for applications– Basic types and operators– Object model– Unicode support– Dynamic linkage– Garbage collection– Memory model– Access control
  15. 15. Java Language• Static typed• Strict & rigid syntaxIts hard to say language X is better than language Y.Use the right tool.
  16. 16. Java is good for ...Big Teams Long-term projectsThe key is maintainability.Code readabilityFind good developersHigh-profile projects
  17. 17. Core Libraries• Java core libraries are weak– Collections– IO– Date/Time• Rely on communities– Apache Commons XXX• Problems– Version conflicts– Jar hell– Dependency management
  18. 18. http://www.slideshare.net/vishnu/the-top-10-reasons-the-ruby-programming-language-sucksThe Top 10 Reasons The Ruby Programming Language Sucks-MatzSee Ruby
  19. 19. Why Java Succeeded
  20. 20. Compile Once, Run AnywhereJava Source Code(.java)Java Byte Code(.class)CompileJava CompilerJVMWin *Nix MacJava LanguageSpecificationJVMSpecificationRun
  21. 21. Class loader• Javas true invention• Load code from remoteand execute locally• Core technique behindJava Applet• Java applet boostedJava’s spreading in dotcom ageNASA World Wind applet
  22. 22. How Java Evolves
  23. 23. Java Community ProcessOpenJDK+
  24. 24. Java Community ProcessDevelop standard technical specifications for JavatechnologyJava Specification Request (JSR) - Changes to makehttp://jcp.org/en/procedures/overview
  25. 25. MemberExecutive Committee(EC)- Individuals- Companies- Organizations- Major stakeholders- Representative cross-section ofthe Java CommunityJSRsGame of big playersEclipse FoundationHPIBMIntelNokiaOracleRed HatSAPTwitterand more ...submit approve
  26. 26. OpenJDK• Open-source implemenation of Java SE• Reference implementation of JCP JSRs• Base of other Java SE implementations• Oracle collaboration with Red Hat, IBM, Apple, andSAP
  27. 27. What Happened Behind Java SE 7 JSRJSR 336 JavaTMSE7ReleaseContentsFinal Approval Ballothttp://jcp.org/en/jsr/results?id=5225
  28. 28. Those Voted Yes Said ...http://jcp.org/en/jsr/results?id=5225
  29. 29. Licensing Terms of TCK• Technology Compatibility Kit (TCK) is used to testcompatibility of Java implementation.• Oracle only wants to license the use of TCK in the OpenJDKcontext• Apache Software Foundation, Doug Lea and Tim Peierlsresigned from JCP EC in protest over this issue.– Apache Harmony Project - retried alreadyOracle ... has essentially turned the JCPinto a rubber-stamp organization for Java SE 7Alex Handy
  30. 30. Evolution Areas of JavaProductivity Performance Modularization
  31. 31. Productivity
  32. 32. Averaging over the lifetime of the project, a programmerspends about 10-20% of his time writing code, and mostprogrammers write about 10-12 lines of code per day thatgoes into the final product, regardless of their skill level.http://automagical.rationalmind.net/2010/08/17/some-lesser-known-truths-about-programming/
  33. 33. http://www.codinghorror.com/blog/2005/08/are-all-programming-languages-the-same.htmlLines of Code
  34. 34. Java is improving• Java SE 5– Enhanced for loop• Java SE 7– try-with-resources– Diamond operator• Java SE 8– List & Map literals– Lambda expressionsExample of lambda expressionhttp://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html
  35. 35. Performance
  36. 36. Java is NOT slow
  37. 37. Benchmark Result 1http://blog.cfelde.com/2010/06/c-vs-java-performance/
  38. 38. Benchmark Result 2http://readwrite.com/2011/06/06/cpp-go-java-scala-performance-benchmark
  39. 39. Most of the performance issues are caused byprogramming errors•Bad algorithms•Careless memory usage•I/O operations•Threading issues, dead lock
  40. 40. Java is improving• Performance was not good prior to Java 1.3• Performance improved since HotSpot wasintroduced in Java 1.3• Each Java release has performanceimprovementsJVM in OpenJDK = HotSpot + JRockit
  41. 41. Modularization
  42. 42. Why you need Swing library for an application server?Project JigsawDesign and implement astandard module system for theJava SE platform, and to applythat system to the platform itselfand to the JDKhttp://openjdk.java.net/projects/jigsaw/
  43. 43. JVM Languages
  44. 44. Rise of Dynamic JVM LanguagesAnd more ...https://en.wikipedia.org/wiki/List_of_JVM_languages
  45. 45. Source code Java byte codeJVMCompileRunJythonJRubyGroovyScalaClojure...
  46. 46. the Da Vinci Machine ProjectExtend the JVM with first-class architecturalsupport for languagesother than Java,especially dynamiclanguages.http://openjdk.java.net/projects/mlvm/
  47. 47. Meet invokedynamic• A new JVM instruction introduced in JSR 292for Java SE 7• Allow extremely fast dynamic invocationthrough method handles• Improve performance of dynamic JVMlanguageshttp://jcp.org/en/jsr/detail?id=292
  48. 48. Polyglot and poly-paradigmprogrammingUse the right language to solve problems in differentcomponentshttp://polyglotprogramming.com/papers/PolyglotPolyParadigm.pdfCore business logicAdmin tasksWeb developmentConcurrent programming
  49. 49. What should Java developers do?
  50. 50. Learn more about Java platformLearn more JVM internals, class loading, byte code spec, etc.
  51. 51. Keep an eye on Java languageUse new features and enhancements to increase productivity
  52. 52. Embrace dynamic JVM languagesLearn new dynamic JVM languages to make your life easier
  53. 53. Java may not be a good programming languageJava platform is a good platform to work onIt’s evolving slowlyANDBUT

×