Home
Videos uploaded by user “CodeFX”
First contact with 'var' in Java 10
 
19:07
Java 10 will be released in March 2018 and it comes with local-variable type inference, which means we can use 'var' instead of a type name when declaring local variables. In this video I tell you how to use 'var', where it works and where it doesn't (and why) and how it might impact readability. I wrote a blog post on the same topic (http://blog.codefx.org/java/java-10-var-type-inference/) and created a Java 10 demo project (https://github.com/CodeFX-org/demo-java-10), which also documents how to set up JDK 10. For much more on software development, Java, and the JVM, subscribe to this channel, follow me on Twitter (https://twitter.com/nipafx), or have a look at CodeFX (http://codefx.org). If you're interested in courses on Java, particularly Java 9 and 10, check out http://courses.codefx.org. Sections: * 0:11 introduction * 0:47 where var works * 2:49 no, this is not dynamic typing * 4:08 how var works * 4:57 "action at a distance" errors * 7:41 technical limitations of var * 9:51 design limitations of var * 13:09 impact on readability * 17:31 summary
Views: 15602 CodeFX
Kicking off a series on Effective Java, Third Edition
 
04:21
Effective Java,Third Edition, took me by surprise. After having read the second edition, I figured I would only read the new items, but I was so wrong! It sucked my right back in and I ended up rereading the entire book. I rediscovered all the details I forgot, connected the content with my personal experiences from about a decade of Java development, and had a lot of fun trying to find angles Josh hadn't covered. This inspired me to start a YouTube series on Effective Java, which this video kicks off. Come with me on a journey that goes back to the roots and makes us experts in the Java core language! Table of contents: 0:07 Praise 0:44 Effective Java outline 2:31 Everybody should read it ... 2:51 ... so I started this series 3:16 video series outline Repository with examples: https://github.com/CodeFX-org/effective-java Nicolai: * home: http://codefx.org * online Java courses: http://courses.codefx.org * on Twitter: https://twitter.com/nipafx Affiliate links to buy Effective Java, Third Edition: * InformIT (the publisher): http://tiny.cc/effective-java-3rd * Amazon USA: https://amzn.to/2QI0D0S * Amazon Germany: https://amzn.to/2OvsWOu Drum roll: * source: https://freesound.org/people/HolyGhostParty/sounds/71133/ * license: CC-BY 3.0 / http://creativecommons.org/licenses/by/3.0/
Views: 594 CodeFX
Java 11: A New Dawn - Releases, Oracle JDK vs OpenJDK, and LTS
 
20:24
Java 11 is a game changer! Not so much for technical reasons (unless you come from Java 8), but because of the new release cadence (six months), licensing (Oracle JDK vs OpenJDK), and long-term support (not free by Oracle). I discuss all of these in detail to make sure you know what to expect. Table of contents: * 0:32 Release cadence * └ Old cadence * 2:08 └ New cadence * 4:58 └ Release fatigue * 13:38 Oracle JDK vs OpenJDK * 15:39 Long-term support * 19:36 Summary Slides: https://slides.codefx.org/java-next/[email protected]/ Java 11 migration: https://blog.codefx.org/java/java-11-migration-guide/ Incubator modules: http://openjdk.java.net/jeps/11 Language previews: http://openjdk.java.net/jeps/12 Oracle JDK vs OpenJDK: https://blogs.oracle.com/java-platform-group/oracle-jdk-releases-for-java-11-and-later (particularly section "..yet with some cosmetic and packaging differences") Red Hat stewardship: https://developers.redhat.com/blog/2018/09/24/the-future-of-java-and-openjdk-updates-without-oracle-support/
Views: 4263 CodeFX
Static Factory Methods - Effective Java, Item 1
 
15:11
Static factory methods are awesome! They allow us to overcome three shortcomings of constructors by allowing us to freely choose a name, take control over returned instances, and take control over the returned type. I use them every day. Also, I'm actually sorry about all the "actuallies". 😉 Table of contents: 0:35 What's wrong with constructors? 1:14 Quick introduction to static factory methods 1:28 Named constructors 2:23 Instance control 4:16 └ Immutability and documentation 5:15 └ Value-based classes 6:02 Type control 7:57 Where to put static factory methods? 8:22 Discoverability 10:07 Make constructor inaccessible 11:03 Refactoring to static factory methods 12:33 Not the factory patterns! 13:53 Summary Repository with examples: https://github.com/CodeFX-org/effective-java BED-Con in Berlin: http://www.bed-con.org/ Twitter-poll: https://twitter.com/nipafx/status/1037310344585261056 §1 GG: https://twitter.com/nipafx/status/1038376068728676353 Value-based classes: https://blog.codefx.org/java/value-based-classes/ Comment your &*☠# Code: https://blog.codefx.org/techniques/documentation/comment-your-fucking-code/ Nicolai: * home: http://codefx.org * online Java courses: http://courses.codefx.org * on Twitter: https://twitter.com/nipafx Affiliate links for Effective Java, Third Edition: * InformIT (the publisher): http://tiny.cc/effective-java-3rd * Amazon USA: https://amzn.to/2QI0D0S * Amazon Germany: https://amzn.to/2OvsWOu
Views: 1206 CodeFX
Use Builders... Cautiously - Effective Java, Item 2
 
25:16
The builder pattern is a powerful tool to ease the instantiation of complex classes. Whether constructor parameters are too numerous, there are too many of the same type, or whether many are optional - with a builder you can make your life easier. Although, I posit, often you can make your life even easier by directly tackling the class' or constructor's complexity. In this video I show an example of how to simplify a class to make a builder obsolete, but also how to build more powerful builders that add more value than just simplifying constructor calls. Table of contents: 0:32 Mixed feelings 2:42 Builders explained 3:55 └ A better solution to Josh's example 6:20 └ An even better solution to Josh's example 8:26 Random details (threading, style, other languages) 10:50 Builders as DSL 13:43 More powerful builders 15:31 Inheriting builders and recursive generics 20:14 Refactor towards builder 22:56 Summary Repository with examples: https://github.com/CodeFX-org/effective-java JavaZone in Oslo: https://2018.javazone.no/ My opinion on Optional: https://blog.codefx.org/techniques/intention-revealing-code-java-8-optional/ Map.of et al: https://blog.codefx.org/java/java-9-tutorial/#Collection-Factories Named & default parameters in Kotlin: http://www.deadcoderising.com/kotlin-how-to-use-default-parameters-in-functions-and-constructors/ Automaton: https://brilliant.org/wiki/finite-state-machines/ Partial application: https://en.wikipedia.org/wiki/Partial_application Self types with generics: https://www.sitepoint.com/self-types-with-javas-generics/ Nicolai: * home: http://codefx.org * online Java courses: http://courses.codefx.org * on Twitter: https://twitter.com/nipafx Affiliate links for Effective Java, Third Edition: * InformIT (the publisher): http://tiny.cc/effective-java-3rd * Amazon USA: https://amzn.to/2QI0D0S * Amazon Germany: https://amzn.to/2OvsWOu
Views: 759 CodeFX
First Contact with Switch Expressions in Java 12
 
27:16
With Java 12, `switch` is no longer just a statement, but becomes an expression. That means it can have a return value (instead of having to assign or return results) and with a lambda-like syntax that doesn't fall-through (no more `break` 🎉) and exhaustiveness checks (less `default` ) it is much more readable. Table of contents: 1:53 switch statement 4:39 switch expression 7:44 statement blocks 9:38 multiple case labels 11:20 exhaustiveness 14:48 no fall-through 15:36 poly expressions 20:42 other types 21:55 old-style colon form 24:25 outlook Definitive Guide To Switch Expressions: https://blog.codefx.org/java/switch-expressions/ JEP 325 - Switch Expressions: https://openjdk.java.net/jeps/325 JEP 12 - Preview Language and VM Features: https://openjdk.java.net/jeps/12 Repository with examples: https://github.com/CodeFX-org/demo-java-x Article on 'var': https://blog.codefx.org/java/java-10-var-type-inference/ Nicolai: * home: http://codefx.org * online Java courses: http://courses.codefx.org * on Twitter: https://twitter.com/nipafx
Views: 3461 CodeFX
Utilities, Singletons and Dependency Injection - Effective Java, Items 3-5
 
20:56
What do singletons, utility classes, and dependency injection have in common? All three worry about controlling instantiation - when, how, and by whom? Effective Java items 3, 4, and 5 have something to say about that. Table of contents: 0:23 Enforce non-instantiability (item 4) 0:46 └ Private constructor 2:24 └ Good vs bad utility classes 4:06 Enforce singleton property (item 3) 4:51 └ Private constructor (again) 6:07 └ Public field vs 'getInstance()' 8:40 └ Special requirements for serializable singletons 10:25 └ Use an enum 11:41 Prefer dependency injection (item 5) 12:06 └ What is dependency injection? 14:57 └ Why use dependency injection? 16:44 └ How use dependency injection? 18:54 Summary (utilities/singletons vs dependency injection) Repository with examples: https://github.com/CodeFX-org/effective-java jDays in Gothenburg (item 4): https://jdays.se/ J-Fall in Pathé Ede (item 3): https://jfall.nl/ Devoxx Belgium in Antwerp (item 5): https://devoxx.be/ Reduce to only element: https://blog.codefx.org/java/stream-findfirst-findany-reduce/ Dependency injection: https://en.wikipedia.org/wiki/Dependency_injection Facade pattern: http://jargon.js.org/_glossary/FACADE_PATTERN.md Nicolai: * home: http://codefx.org * online Java courses: http://courses.codefx.org * on Twitter: https://twitter.com/nipafx Affiliate links for Effective Java, Third Edition: * InformIT (the publisher): http://tiny.cc/effective-java-3rd * Amazon USA: https://amzn.to/2QI0D0S * Amazon Germany: https://amzn.to/2OvsWOu
Views: 705 CodeFX
Caliz I: Wrapping JVM 11 and learning about Graal AOT
 
35:39
With Java 11's single-source-file execution and Graal's blazing fast native images (aka ahead-of-time compilation), it should be possible to create an acceptable scripting experience with Java. Here's the first part of a live stream where I did exactly that. Thanks to everyone who was there. 🙏 I had an amazing time. Follow-ups: * Caliz: https://github.com/CodeFX-org/Caliz * Scripting Java: https://blog.codefx.org/java/scripting-java-shebang/ * Graal AOT: https://www.graalvm.org/docs/reference-manual/aot-compilation/ Follow me to join us for the next stream: * on Twitch: https://twitch.tv/nipafx * on Twitter: https://twitter.com/nipafx Come to the Discord for geeking out on Java: https://discord.gg/7m9w8Td My home: https://codefx.org
Views: 199 CodeFX
Caliz III: Hashing scripts and background compilation
 
32:47
After I wrapping JVM 11 and Graal AOT in the last two videos, it is now time to determine for a give script, which way to go. Thanks again to everyone who was there for the amazing time. 🏆 Follow-ups: * Caliz: https://github.com/CodeFX-org/Caliz Follow me to join us for the next stream: * on Twitch: https://twitch.tv/nipafx * on Twitter: https://twitter.com/nipafx Come to the Discord for geeking out on Java: https://discord.gg/7m9w8Td My home: https://codefx.org
Views: 52 CodeFX
Java 12 Experiments (Live Stream)
 
02:42:03
My first live stream! I dug around in Java 12, cataloging new features and experimenting with a few of them, most notably String::indent and transform, Collectors::teeing, and additions to CompletableFuture. Table of contents: 0:07 intro 1:26 stream start 9:02 how to code along 13:58 cataloging features 46:58 experiments 48:35 * more Unicode support (excurion on updates in Java 9-11) 51:22 * new class EnumDesc 52:24 * new methods on String (excursion on new release model and ideas for `Optional`) 1:36:08 * new method Files::mismatch 1:38:06 * new class CompactNumberFormat 1:44:08 chatting, a break, more chatting 1:52:36 getting back to experiments 1:53:18 * additions to CompletableFuture (intro to CompletableFuture at 1:58:11) 2:13:24 * Collectors::teeing 2:36:01 * SourceVersion 2:39:15 wrapping up Thanks again to everyone who was there. 🙏 I had an amazing time. Follow me to join us for the next stream: * on Twitch: https://twitch.tv/nipafx * on Twitter: https://twitter.com/nipafx Come to the Discord for geeking out on Java: https://discord.gg/7m9w8Td My home: http://codefx.org
Views: 624 CodeFX
Maven 3 / 4 / 5 with Robert Scholte
 
17:25
Everybody knows Maven, but few people know the developers behind it and what they plan for Java's most used build tool. I talk with Robert Scholte, Chairman of the Apache Maven projects, and he gives a glimpse of the project's inner workings as well as some ideas for Maven 4 and even 5. Table of contents: 0:22 Introductions 0:39 Maven's role and team 2:28 Lifecycle improvements 5:36 Multi-module compilation in Maven? 8:17 Maven 4 and 5 9:50 Publishing a consumer POM (new!) 12:22 It's hard to evolve the POM 13:47 Publishing a dependency tree (new!) 15:00 Outro 15:22 St. Petersburg Recorded at JokerConf 2018: https://jokerconf.com/en/ Robert on Twitter: https://twitter.com/rfscholte Maven issues to get you started: https://issues.apache.org/jira/browse/MNG-6432?jql=project%20%3D%20MNG%20AND%20labels%20in%20(starter%2C%20newbie%2C%20easyfix%2C%20beginner)%20ORDER%20BY%20created%20DESC Snyk JVM Ecosystem Report 2018: https://snyk.io/blog/jvm-ecosystem-report-2018 Nicolai: * home: http://codefx.org * online Java courses: http://courses.codefx.org * on Twitter: https://twitter.com/nipafx
Views: 421 CodeFX
Impressions from JavaZone 2017
 
02:25
Impressions from JavaZone 2017, which took place in Oslo on September 13th and 14th. Awesome conference with great talks, superb food, an amazing setup, and a Rock'n'Roll atmosphere. Kudos to the organizers! * JavaZone 2017: https://2017.javazone.no * my talk: https://vimeo.com/233801793 * interested in those interviews with Alex Fontain and Kevlin Henney? Subscribe! Music is "Phonetic Hero - New High Score" by WillRock (http://willrock.bandcamp.com/), licensed under CC-BY-NC-ND 3.0 (http://creativecommons.org/licenses/by-nc-nd/3.0/). I'm not affiliated with the conference - just a fan (and speaker).
Views: 458 CodeFX
Caliz II: Wrapping Graal AOT
 
33:37
After I wrapped JVM 11 in the last video, it is now time to let Caliz use Graal AOT to create a native image. There are a few hurdles, though, so it took me some time. As always, thanks to everyone who was there. 🌻 I had an amazing time. Follow-ups: * Caliz: https://github.com/CodeFX-org/Caliz * Scripting Java: https://blog.codefx.org/java/scripting-java-shebang/ * Graal AOT: https://www.graalvm.org/docs/reference-manual/aot-compilation/ Follow me to join us for the next stream: * on Twitch: https://twitch.tv/nipafx * on Twitter: https://twitter.com/nipafx Come to the Discord for geeking out on Java: https://discord.gg/7m9w8Td My home: https://codefx.org
Views: 118 CodeFX
Welcome, Java 9!
 
22:58
Java 9 is out today and with other members of the community I'm throwing a welcome party. Get an all around view on the new Java release with various opinions, tips, and great sources! To learn all about Java 9: http://blog.codefx.org/java/java-9-tutorial/ For more videos on software development, Java, and the JVM, subscribe or follow me on Twitter (https://twitter.com/nipafx), and don't forget to visit CodeFX (http://codefx.org). Sections: * 0:29 introductions * 2:26 favorite Java 9 features * 6:21 impact of Java 9 on projects * 11:13 impact of Java 9 on community * 16:21 Java 9 sources * 18:37 thanks to the JDK team * 21:58 welcome, Java 9! Simon Maple: * Twitter: https://twitter.com/sjmaple * ZeroTurnaround: https://zeroturnaround.com/ * Joda projects: http://www.joda.org/ * modularity books: https://www.manning.com/books/the-java-module-system?a_aid=nipa&a_bid=869915cb, https://javamodularity.com/ Stephen Colebourne: * Twitter: https://twitter.com/jodastephen * Blog: http://blog.joda.org/ * OpenGamma: http://strata.opengamma.io/ * Joda projects: http://www.joda.org/ * on modules and their names: http://blog.joda.org/2017/04/java-se-9-jpms-module-naming.html, http://blog.joda.org/2017/04/java-se-9-jpms-modules-are-not-artifacts.html Christian Stein: * Twitter: https://twitter.com/sormuras * JUnit 5: http://junit.org/junit5/ * Bach (JShell-based build tool): https://github.com/sormuras/bach Nicolai Parlog: * Twitter: https://twitter.com/nipafx * Blog: https://blog.codefx.org * "The Java Module System": https://www.manning.com/books/the-java-module-system?a_aid=nipa&a_bid=869915cb Trisha Gee: * Twitter: https://twitter.com/trisha_gee * Blog: https://trishagee.github.io/ * JetBrains: https://trishagee.github.io/ * "Real World Java 9": https://www.youtube.com/watch?v=GkP83hvdeMk Chris Engelbert: * Twitter: https://twitter.com/noctarius2k * Hazelcast: https://hazelcast.com/ Sander Mak: * Twitter: https://twitter.com/Sander_Mak * Blog: http://branchandbound.net/ * Luminis: https://www.luminis.eu * "Java 9 Modularity": https://javamodularity.com/ Jens Schauder: * Twitter: https://twitter.com/jensschauder * Blog: http://blog.schauderhaft.de/ * Spring Data: https://projects.spring.io/spring-data-jpa/ * Pivotal: https://pivotal.io/ Monica Beckwith: * Twitter: https://twitter.com/mon_beck * Code Karam: http://www.codekaram.com/ Rafael Winterhalter: * Twitter: https://twitter.com/rafaelcodes * Site: http://rafael.codes/ * ByteBuddy: http://bytebuddy.net * Mockito: http://mockito.org/ * JavaZone talks: https://vimeo.com/javazone Wayne Beaton: * Twitter: https://twitter.com/waynebeaton * Eclipse: http://eclipse.org/ * OpenJ9: https://www.eclipse.org/openj9 * Eclipse support for Java 9: http://wiki.eclipse.org/java9 Simon Ritter: * Twitter: https://twitter.com/speakjava * Azul Systems: http://azul.com/ * "55 New Features in JDK 9": https://www.youtube.com/watch?v=CMMzG8I23lY * "JDK 9: Pitfalls For The Unwary": https://www.azul.com/jdk-9-pitfalls-for-the-unwary/ * "JDK 9: XXtra Command Line Options": https://www.azul.com/jdk-9-xxtra-command-line-options/
Views: 6978 CodeFX