JavaOne – Optional – the mother of all bikesheds

“Optional – the mother of all bikesheds”

Speaker: Stuart Marks
#OptionalBikeshed

The deck is available online

For more blog posts from JavaOne, see the table of contents


Showed early version of “optional” (stream returning null)

Review of basics

  • Two states – present (contains non null reference) or absent
  • Don’t say “null optional”. Say “absent” or “empty”
  • Optionals are immutable
  • equals() and hashCode() work as one would expect – useful for JUnit because can call assertEquals()

New in Java 9

  • stream() – stream with 0 or 1 elements
  • ifPresentOrElse(Consumer)
  • or(Supplier)

Good code and Best practices

  • Never set an Optional variable to null. It should be Optional.empty() as default.
  • If method returns Optional, never return a null either.
  • Intended for return types where might or might not have a value to return.
  • Don’t call get() as could be empty optional
  • Use isPresent() and get() as last resort
  • Using .map().orElse() chained after stream pipeline gives fluent API calls
  • Calling filter() returns original value only if non-empty optional that matches. else returns empty. Using filter() and orElseThrow() is good for validation
  • [and more see the deck]

My take: Amazed there is so much to say about Optional! Excellent set of best practices. And excellent point on not calling an optional “null.” I needed to leave early as my session is immediately after this one. And I really wanted to know “what’s with the bikeshed” which is covered last.  It’s a nice collection of quotes. So I found the deck and best practices online. There’s also a youtube video linked so you can watch at home.

JavaOne – 10 tips to become an awesome tech lead

“10 tips to become an awesome tech lead”

Speaker: Bart Blommaerts

For more blog posts from JavaOne, see the table of contents


Not one free seat in the room and long wait list line. [I wait listed and left the keynote 5 minutes early to ensure I got in]

Role of Tech Lead

  • Provide tech leadership
  • Protect team from interruptions
  • What new libraries/frameworks should we use? What are risks?
  • Coaching
  • Communication – bridge gap between devs an business

Do we need one

  • In ideal world, don’t need tech lead
  • Hard to do everything by consensus
  • Unlike the lego movie, everything is not always awesome
  • Business still needs point of contact
  • New people still need training

The ten tips

  1. Advocate for change – don’t want people to be afraid of prod, need to evolve. Try to make stupid processes better. OODE – observe/orient/decide/act
  2. Work through failure and success – prepare for failure, don’t finger point (“we”), take responsibility, learn from failure, problem if you are fixing the same bug twice – that is process failure. Celebrate success – sprint celebrations, feature complete, congratulate team/individuals
  3. Stay technical – write code, review code, tech vision (and get buy in; ideally with everyone contributing to it), evolution of code. Don’t forget about security/networking
  4. Time management – be available – spending time on tech design, talking to the business, project management (ex: help write user stories) and code
  5. Be a mentor for your team – facilitate discussion. Help team becomes stronger developers. Delegate. Optimize for the group/team
  6. Surround yourself with other tech leads – on a personal level, see what others do to get ideas and learn. On an organizational level, look at common org/architecture along with interoperability/dependencies
  7. Interviewing potental new team members – know your goals. For short term,, looking at tooling. For longer term, look at eagerness to learn. Don’t use stack overflow to find questions; pick things relevant to your project
  8. Embrace cultural differences – diversity, culture, family. Your users are different too.
  9. Estimating is hard – “Hofstadter’s Law: It always takes longer than you expect, even when you take into account Hofstadter’s Law.”. Planning poker. Uncertainty is normal. Add 20% for test/debug/polish/documentation/wtf moments.
  10. Interfacing with the outside world – want to be the go-to person, but not the single point of failure
  11. Faciliate an agile and awesome team

Other notes/tips

  • Not difficult for tech lead to make things worse
  • Need to experience same pain as everbody else on team – you are part of the team
  • Be realistic. Not possible to answer every question. Also, need to connect teammates to each other. Ok to request time to look into a question as long as you get back to them. Also ok to suggest pairing.
  • Not making a decision is worse than making the wrong decision becuase not doing any work
  • Interview style – comfort people (they are nervous; start with a siimple question like “what is the difference between an interface and abstract class in Java”), offer options, build on responses like “what is the difference between interfaces/abstract classes in Java 8”, show interest, bonus question
  • Offshoring – work gets done while sleeping, communication harder. Prepare work for remote teammates since they can’t talk directly to business. Harder to make everyone feel like part of team. ex do a night shift “most developers work better at night” [I am so non standard here!] Keep history ex: Slack

He commented about people working nights the last couple sprints to ensure success on the project. [That sounds completely against the sprint of sprints being sustainable]

My take: Nice to have a good tech soft skills talk. I noticed that Bart referred to “technical lead” as “he” whenever he used a pronoun. I wonder if it’s like that in his native language. Google translate says both tech lead and developer use “le” (are masculine) in French. This was more obvious at the beginning; he switched to “you” after a bit. And he said he/she later on.

JavaOne – Community Keynote

“Community Keynote”

For more blog posts from JavaOne, see the table of contents


IBM

  • This year, open sourced IBM JDK 9 (OpenJ9)and LIberty Server
  • Demo: microservices, error handling, live code update, Docker
  • Expecting coding in the cloud will become more common
  • More innovation needed: cloud dynamics, containers, hardware
  • Container Kindergarten – play will with others; don’t steal resources/toys from other containers
  • Competition around best JVM
  • Guarded storage – physical hardware that can run GC in parallel by adjusting to memory moves
  • “Server doesn’t even mean the same as it used to”
  • Java EE got reputation for being monolithic. Hasn’t been true in a long time. Now have lighweight runtimes Ex: TomEE, Liberty
  • Even with Kubernetes, need runtime so app can run in portable way
  • Open Liberty – supports Java EE 7, Microprofile, Docker. Uses Eclipse upgrade. Biggest open source contribution IBM ever made. Can get production support as paid upgrade. Designed to be run for microservices and cloud native apps.
  • Microprofie -optimized enterprise capabiities for micro services. Looking at contributing to Java EE or moving under EE4J umbrella.

Oracle

  • Cute skit about this being a rehersal for the Matrix. Callouts to Brazil and the Netherlands. Callout to Star Wars. Callout to Java’s new 6 month release schedule
  • [The lights are green which makes for an interesting reflection on my iPad keyboard]
  • Simulated [I think] tech failures
  • Used underscore variable and changed to double unerscore when didn’t compile
  • Counting: “8, 9 , 18.3, 18.9, whaaat”
  • Follow the white duke (to the JCP party
  • Scene 2: Juggie (a puppet), a bunch of JUG leaders in costumes and two artists
  • The blue J2EE bill taes you back and the red EE4J pill… YOur improvements will be faster now.
  • The agents are spreading fear saying Java EE is dead. The JUG Leaders are the first line of defense
  • Each JUG leader said something about upgrading or a new feature
  • RV carries more and has couch/bathroom. But motorcyce more agile an can go anywhere
  • Scene 3: green screen on motorcycle
  • Scene 4: Went to Japan to learn how to fight agents. Taught spirit of Jigsaw. Used the machine with the 60 Raspberry Pi devices in a circle to check punch. Creates video to see from all angles.
  • Scene 5: Virtual User Group – in 3 weeks, doing 24 hours of vjug. And a bunch of people from the vjug went up
  • Fun references to Java and EE from the matrix in the background as they did dialog
  • Matrix is killing processes as they start up. Deployed 6 instances of programming using Kubernetes to Google, IBM and Oracle clouds. Had visual as killed instances and they came back up. Scaled it 400 and watched the isul grow. Lots of references to the cost. . Google hangout session into VJUG
  • Scene 6: Meet architect of Matrix and our hero defeats the agents.. The agents make up and turn back into dev

My take: I was thinking of not going to the keynote to get some extra sleep and then getting ready for my session. Glad I woke up at 6:30 to get ready and attended to whole keynote. IBM’s was interestng and well put together. And Oracle’s “movie” was awesome! And the more people you recognized, the better it was. Lots of references to various news to such as Angular not having a migration path.