QCon 2018 – Invest in your Java Katalogue

Title: Invest in your Java Katalog: Managing Java Version Changes on the Rapid Release Train
Speaker: Don Raab & Aditi Mantri

See the table of contents for more blog posts from the conference.


Links to Katas

  • Oriinal Katas – http://codekata.com
  • On GitHub: https://github.com/BNYMellon/CodeKatas

Kata

  • Hands on programming exercies to hone your skills through practice
  • Styles
    • Refactor  code and tests should keep passing
    • Fix the code – write code to make tests pass
    • Fix the tests – write tests using API
    • Sandbox – free  form

Learning by teaching

  • Must learn something better to teach it
  • Develop katas to teach others
  • Practice through repetition

How to build a kata

  • Identify what want to learn (ex library feature)
  • Design a problem to solveWrite unit tests demonstrating how feature works
  • Implement code
  • Add helpful comments and hints so becomes standalone
  • Delete parts of code that want someone to learn

Live coding

  • Java lambda kata – refactor the code style
    • showed Java 10 var
    • showed effectively final
    • showed converting anonymous inner class to a lambda – used IntelliJ to do conversion. Showed casting so could keep using var. Said don’t recommend [I would have shown it without var. Using the type is far better than using var there]
    • showed converting lambda to method references
  • Deck of cards kata – fix the code style
    • Showed code using stream APIs and custom APIs
    • Showed Java 10 Collectors.ofImmutableList()
    • showed Java 10 Map.copyOf() to make immutable map
    • Showed using some of the APIs in   Eclipse Collections
  • Donut kata – fix the code style
    • Showed code using advanced Eclipse Collections
  • Calendar kata – fix the code style
    • showed Java  8 dates, Eclipse collections, etc
    • showed three ten library (extension of Eclipse collections?)

 

My take

I like the emphasis on using  live code (doing the katas) to reinforce the concepts taught earlier in the session. I learned about an API in Java 10 that I missed as well.  I  was a little confused by the “Eclipse Collection style of Kata” comment. That’s a kata, not one of the described type. Then I realized it was still part of the deck of cards kata so a “fix the code” style one.

QCon 2018 – Ask me Anything – Josh Bloch

Title: AMA (ask me anyhing)
Speaker: Joshua Bloch @joshbloch

See the table of contents for more blog posts from the conference.


Law

  • Idea expression dichotomy – Words copyrightable but not ideas. Methods of operations not copyrightable  like QWERTY
  • Ideas may be protected by patents so can’t reimplement for 20 years. Ex: +++ on Hayes Modem
  • Now legal strategy to include a patent in copyright so goes to desirable court
  • Technically implementing your own list is a problem. But selective enforcement implies won’t enforce.

Microsoft vs Sun

  • had signed agreement and fought
  • not broader implications

APIs

  • How document scalability, performance and other non-logical constraints? Better to specify even if implmentations get to choose. That way it is specified that can’t rely on.
  • Some requirements/behavior is in spec when buy a product. Not just in API. Ex: copy machine can make X copies a second while API is press button to make copy.
  • Balancing act – don’t want implementation details in API that might change as callers will rely on them. But if not enough, developers assume/infer

Java

  • Eventually languages keel over from own weight. Good thing.   Just like people, not meant to live forever.
  • Need to decide what to learn
  • Need to decide which API to use.
  • Makes room for new entrants when people can’t deal with current languages
  • Not just language. Also VM, libraries, etc. Much harder to move away from a platform. Harder than moving off JVM  than changing from C to Java.
  • Josh’s favorite editors – IntelliJ and Emacs
  • Type erasure is present so could be migration compatible (vs a whole new collections library)
  • As languages age, some decisions make sense only due to history and past decisions.
  • Josh wishes Java supported unsigned integers and especially bytes. Gosling designed  by gut originally and was usually right. This was a bad one. He felt it would have been unneeded complexity. Solution is a library since not in the language
  • Josh would have added methods to return an arbitrary element and leave (or remove) from collection.
  • Josh would have returned Collection itself instead of a boolean as to state. That would have allowed fluent calls
  • Josh expects modules to get used mainly within the JDK

Java and six months release cycle

  • Platforms require stability. Can’t have major changes each 6 months.
  • Lots of stuff that in there and not used
  • Books released less frequently than release cycle even when more reasonable.
  • Changes minisule so not worth updating for each

Josh’s future

  • Josh teaching OO and APIs courses next semester
  • APIs course may turn into book on API design

My take

At Josh’s keynote, he commented that there was no time for questions, but there was this AMA. This was awesome! The people who were interested got to ask lots of questions and everyone else didn’t have to sit through it.

 

QCon 2018 – A brief, opinionated history of the API

Title: A brief, opinionated history of the API
Speaker: Joshua Bloch @joshbloch

See the table of contents for more blog posts from the conference.


In 2012,  Josh testified in he Oracle vs Google  lawsuit.  He therefore studied APIs   And this talk came from there

History

  • First subroutine libraries – 1948  paper from Princeton. Showed ol yellowed paper with assembly language. However, woul have required manual changes each time.
  • Wilkes won Turing award in 60’s for actually creating a reusable subroutine library. EDSAC. World’s first stored program computer. Kept simple to get it done so fast!
  • Wilkes and Wheeler wrote boot loader (first 30 words) to make reusable so programmers didn’t have to deal with binary machine code. Instead, programmers use assembly language.
  • In first program on first computer ”… realization came over me that a good part of the remainder of my life was going to be  spent in  finding the errors in my own programs” —— Maurice Wilkes. Subroutine library  is a partial fix.
  • Wilkes  made his student Wheeler deal with that
  • ”The wheeler jump” —— call function by jumping. Requires self  modifying ocde which would be  a security nightmare now.
  • 1951 – “The Preparation of programs for digital computers”. Called WWG for last names of authors.  World’s first text on computer programming and remained primary text until higher level languages arose.   Introduced subroutines to the word.
  • 1952 –   Wheeler wrote about   Concepts including higher order functions. Whole paper is only  two pages long and  covers so much. Doesn’t cover platform independence because only one machine architecture. Doesn’t cover legacy code because first program
  • 1968 – first reference to word API.  Josh submitted to add reference in dictionary
  • 2006 – people still don’t know importance of good API design

What is an API

  • subroutine definitions/protocols (Josh disagrees with tools being included)
  • communicate with  software and hardware
  • If it provides operations defined by inputs/outputs and allows reimplementation without compromising user, it is an API. Can ammend definition to make programming language level
  • glue that connects digital universe
  • ex:   Fortran standard library. 28 math functions
  • ex: IBM instructon set [about half audience considers API]
  • ex: C standard library
  • ex: UNIX system calls – operating system kernels have APIs
  • ex: DEC VT100 escape sequences – peripheral control interface. Smart terminals could blink or moe around on screen
  • ex: IBM PC BIOS   – control underlying hardware
  • ex: MS DOS comand line interace – not exactly API, but serves as one if using scripting language.
  • ex: Hayes modem AT command set – used to type manually. Been reimplemented any times since
  • ex: Adobe PostScript – language and/or API
  • ex: Perl regex – API within a language
  • ex:   Server Message Block – wire level protocols. Don’t program with it directly
  • ex: Windows API
  • ex: Java class libraries – core languages
  • ex: REST API for web service

Law

  • Always had freedom to reimplement APIs.
  • EDSAC was even reimplemented in Japan without any communication
  • 2010 – Oracle sued Google over Java APIs in Android. Claimed patent and copyright infringement. Ruled no patent infringement and cannot copyrightable. Oracle appealed and won. Supreme Court declined to hear. Appeals court determined fair use. So right now, APIs are copyrightable and need permission to reimplement. Google currently petitionining to rehear. Many parties supported Google.
  • Currently need author’s permission to reimplement API. Might have to pay. Author has monopoly on API. Copyright problem is worse than patents because lasts 95 years.

My take

This was awesome! I’ve seen Josh do Java talks and I liked  this topic as well

 

 

 

1951