Mark Stephens FollowMark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.
He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

My notes and pictures from thursday JavaOne 2017

9.00am Java Community Keynote [KEY7694]

IBM demo of an application on technologies and announced open-sourcing OpenLiberty and Open J9The usual silly antics with lots of community onstage. This year based around the Matrix. Good to see the cool JavaOne 60Pi cameras to create the Matrix style 360 panorama. No James Gosling this year….

11.00am From Functional to Reactive Programming [CON7319]

Reused lots of material from previous talks to show functional programmingAim with Lambda is always to be lazyJava does not apply functions to whole Collection (would hit performance) but smarterJava assumes lambda pure (so make sure it is).Functional about moving away from how, just whatExcel example of real time programmingLast 20 years we have lived in CrudReactive si elastic, message-driven, responsive and resilientAlways think of what might fail – unhappy pathStream has single channel unlike Observable (data, error, complete)

12.00am Cloud-Based Test Microservices [CON2789]

Aim to replace old monolithic.Why both on micro services and why on cloud?Micro-service is succinct API to accomplish particular taskBenefits: modular, Simpler, Portable, CustomisedTest Generation service useful to automate testsMake it easy to run any test as a benchmark

1pm Migrating to Java 9 Modules [CON1455]

Finally define dependencies explicitly and encapsulateEven if your code not modularised, j9 isDemo of issues with existing code and updating to work using –add-modulesIllegal deep reflection warnings (typing to access JDK types). Will become errors in futureAutomatic modules – non-modular jar file which we move from class path to modulepath. V. useful for library.module-info.java contains key module datarequires may need adding to find missing values defined in importsFirstly refactor code to 1 module and then refactor code to multiple modules

2pm Twelve Ways to Make Code Suck Less [CON7324]

There are What, when, how and why peopleWhy should we care? We cannot be agile if our code sucksCode is how we tell our colleagues how we feel about them.Lower quality = longer dev timeCode great because you wrote it?Quality of code inversely proportional to effort it takes to understand

12. Schedule time to lower technical debtFreeway filled with cars is a parking lot – we always need wriggle space (linda Rising)You need slack time or you will never innovateBook: Guns, germs and Steel – Jared Diamond11. Favor high cohesionNarrow focused, does one thing well.Think about frequency of change.high cohesion == low cyclomatic complexity10. Favor Loose coupling9. Program with intention (no accidental coding). Avoid working in desperationWhen Wrote this code only God and I knew what it does. Now only God knows…Kent Becks rules for simple design:-a) Passes all testsb) Reveals intentionc) No duplicationd) Fewest elements

8.Avoid primitive obsessionAm I the chosen one? If general purpose, someone else was chosen long ago – use their code.

Imperative code is packed with accidental complexityProgrammers smartest people on planet as always say it looks good, not its correctGood code is a story not a puzzle7. Prefer clear code over Clever codeOptimise for readingSacrifise quality to get performance may be get neither6.Apply Zinsser’s principle on writingBook:- On Writing well – william ZinsserSimplicity, Clarity, Brevity, Humanity5. Comment Why, not whatDon’t comment to cover bad code. RefactorWrite expressive, self-documenting codeCode code is like good joke (should never need explaining). Refactor until it worksThose who can’t design are condemned to document4. Avoid long methods – Apply SLAPPerils of long methods. Problem is levels of abstraction3. Give good meaningful names for variables.2. Do tactical code reviewsWrite tests when you find bugsTell them what to do, not what is broken. Give them some options.1. Reduce state & State mutationLet go of idea We can code it once and get it right

3pm Optimizing Java with Linux Perf [CON1879]

Performance = money. Cheaper to optimise than buy new hardwareLinux Perf demo with counters, tracepoints and samplingperf list gives very long list of events and probes (2K or so)Perf map give info on JIT code perf..map file for compiled methodsCreated with perf-map-agent after running perf recordThen use perf report (also Flame graphs or hotspot tool)Perf also has JIT DumpeBPDf demo

Mark Stephens FollowMark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.
He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.