Now is the best time to learn Java — Transcript
Full transcript
- 0:00Really big news for the lucky few of us
- 0:02who are still employed as software
- 0:03developers in 2026. Java 27 was just
- 0:07released and this is a really big one.
- 0:09It comes with nine JDK enhancement
- 0:11proposals including major runtime
- 0:13improvements, postquantum security,
- 0:15better pattern matching, and another
- 0:17collection of preview features that may
- 0:19eventually become permanent sometimes in
- 0:21the 2030s. And what's really exciting is
- 0:24that the most important change is one
- 0:26that requires absolutely no changes to
- 0:27your code. Compact object headers are
- 0:30now enabled by default. For context, on
- 0:32a 64-bit JVM, every Java object needs a
- 0:35header containing internal information
- 0:37such as its class and synchronization
- 0:39state. And Java 27 reduces this header
- 0:42from 96 bits to 64 bits or from 12 bytes
- 0:45to 8 bytes. Sure, four bytes might sound
- 0:47irrelevant, but that's because you are
- 0:49not familiar with the monstrosity of
- 0:50object-oriented programming in Java.
- 0:52It's safe to assume that a large Java
- 0:54application can create millions of
- 0:56objects all through thoughtfully
- 0:58engineered factories, abstract
- 0:59factories, and factories of factories.
- 1:02So, smaller headers can reduce heap
- 1:03usage, improve cache locality, and allow
- 1:06more application instances to run on the
- 1:08same hardware. Of course, the exact
- 1:10savings depend on the objects and their
- 1:11alignment, so you won't save too much on
- 1:13your AWS bill, but for applications
- 1:16containing huge numbers of small
- 1:17objects, the memory consumption can
- 1:19decrease to up to 20%. And that's great
- 1:22news because you'll need that money for
- 1:24all your future AI token consumption.
- 1:26The second automatic improvement
- 1:28concerns garbage collection and G1 is
- 1:30now the default garbage collector in
- 1:32every environment. It's important to
- 1:34note that G1 has already been the
- 1:36default on server class machines for
- 1:38years, but smaller environments could
- 1:40still fall back to the serial collector.
- 1:42From Java 27 onward, if you don't
- 1:44explicitly choose a garbage collector,
- 1:46the JVM will always use G1. This gives
- 1:49Java more consistent behavior across
- 1:51developer machines, containers, and
- 1:53production servers. Also note that the
- 1:55Java team also worked to ensure that
- 1:57workloads previously using serial don't
- 1:59suffer significant regressions in
- 2:01startup time, memory consumption,
- 2:03throughput, or latency. So if you can
- 2:05upgrade to Java 27 today, and let's be
- 2:08honest, the reality is that you'll never
- 2:10be able to do that on your legacy
- 2:11production project. Two of the biggest
- 2:13changes improve memory usage and garbage
- 2:15collection without developers touching a
- 2:17single line of application code. The
- 2:19language itself also becomes more
- 2:21consistent through primitive types in
- 2:23patterns, instance of and switch. Java
- 2:26is famously late to the game when it
- 2:27comes to pattern matching, and this
- 2:29feature has traditionally worked mainly
- 2:31with reference types. Java 27 continues
- 2:34the work of allowing primitive values
- 2:35such as int, long, and double to
- 2:37participate in the same constructs. And
- 2:40if this sounds exciting, there is only
- 2:41one small detail to keep in mind. This
- 2:44is the fifth preview of the feature. So,
- 2:46we've been previewing this feature for
- 2:47the past 2 years, but we shouldn't get
- 2:49too emotionally attached to it yet.
- 2:51Structured concurrency is back as well.
- 2:53This time in its seventh preview. If you
- 2:55are following my channel, you probably
- 2:57know that I'm a big fan of Java
- 2:58concurrency, mostly because I love
- 3:00complexity for the sake of complexity.
- 3:02This is what helps with job security and
- 3:05I usually rely on intricate difficult to
- 3:07follow concurrency abstractions to make
- 3:09sure nobody can replace me at my current
- 3:11job. [music] And trust me, this is
- 3:13really valuable in the current job
- 3:14market. Jokes aside, structured
- 3:16concurrency is extremely useful. If one
- 3:19request launches several related tasks,
- 3:21Java can treat those tasks as one unit
- 3:23of work. Their lifetime remains
- 3:25connected to the surrounding operation.
- 3:27Failures can cancel sibling tasks and
- 3:29observability tools can understand that
- 3:31the threads belong together. This works
- 3:33especially well with virtual threads
- 3:35because instead of manually coordinating
- 3:37futures, cancellation and error
- 3:39propagation, the structure of the code
- 3:41represents the structure of the
- 3:42concurrent operation. The API has
- 3:45changed repeatedly while being
- 3:46previewed, which is the entire purpose
- 3:48of previews. But seven rounds also tell
- 3:50us that the Java team is taking its time
- 3:52before freezing an API that could
- 3:53influence concurrent Java code for the
- 3:55next 20 years. Java 27 also introduces
- 3:58postquantum hybrid key exchange for TLS
- 4:011.3. I was mentioning in a previous
- 4:03video that Cloudflare recently
- 4:05accelerated its postquantum road map and
- 4:07now wants its entire infrastructure
- 4:09including authentication to be quantum
- 4:11safe by 2029. The reason is that recent
- 4:14advances in quantum hardware, error
- 4:16correction, and algorithms have moved
- 4:18the estimated arrival of
- 4:20cryptographically relevant quantum
- 4:21computers much closer. And if AI models
- 4:24and the bad economy haven't given you
- 4:26enough reasons to worry, according to
- 4:28Cloudflare, the industry's usual
- 4:30timeline of 2035 or later may no longer
- 4:32be realistic. And Google is apparently
- 4:35concerned that the so-called Qday could
- 4:37arrive as early as 2030. But the biggest
- 4:39problem is that encrypted traffic
- 4:41capture today could theoretically be
- 4:43stored and decrypted later once
- 4:45sufficiently capable quantum computers
- 4:47exist. Java now combines a traditional
- 4:49key exchange algorithm with a quantum
- 4:51resistant one. So an attacker would need
- 4:53to break both mechanisms. [music] The
- 4:55new PM encoding API also returns for its
- 4:58third preview. Java can now encode and
- 5:00decode cryptographic keys, certificates,
- 5:02and certificate revocation lists using
- 5:05the common PM format through a standard
- 5:07API. Lazy constants are also back for
- 5:09their third preview as well. They allow
- 5:11an immutable value to be initialized
- 5:13only when it is first required while
- 5:15still being treated as a constant by the
- 5:17JVM. This is useful when initialization
- 5:19is expensive or when a value may never
- 5:22be needed during a particular execution.
- 5:24As a result, it can reduce startup work
- 5:26without forcing developers to implement
- 5:28their own delicate lazy initialization
- 5:30logic with volatile fields and
- 5:32synchronization. The Vector API reaches
- 5:34its 12th incubator release because
- 5:36apparently structured concurrency looked
- 5:38far too decisive. It lets developers
- 5:41express vector computations that the JVM
- 5:43can compile into SIMD instructions
- 5:46supported by the processor. This is
- 5:48useful when working with numerical
- 5:49processing, analytics, cryptography, and
- 5:52machine learning inference where one CPU
- 5:54instruction can operate on multiple
- 5:56values at once. And to be fair, it
- 5:58remains an incubator API because the
- 6:01design still depends on both JVM
- 6:03development and the evolution of modern
- 6:05CPU architectures. Finally, Java Flight
- 6:08Recorder can now redact sensitive data
- 6:10before it leaves the running process.
- 6:12Command line arguments, environment
- 6:14variables, and system properties can
- 6:16contain passwords, tokens, and database
- 6:18credentials, all of which could
- 6:19accidentally end up inside a diagnostic
- 6:22recording. Java 27 allows these values
- 6:24to be removed at the source which is
- 6:26much safer than attempting to sanitize
- 6:28the recording after it has already been
- 6:30written or uploaded to another system.
- 6:32But before wrapping things up, Cotlin
- 6:34had news in September as well. Cotlin
- 6:372.5 beta is out and a few language
- 6:39changes stand out. If you like Java, you
- 6:41probably love Cotlin and as you know
- 6:43their updates are much more developer
- 6:45friendly. So first namebased
- 6:47destructuring is now stable with the new
- 6:49syntax. Cutlin takes values from
- 6:51properties by name while the familiar
- 6:53valy syntax still takes them by
- 6:55position. That makes the new form useful
- 6:57when you care about which property
- 6:58you're reading rather than trusting that
- 7:00you remembered its position correctly.
- 7:02Second, Cutlin is experimenting with
- 7:04companion extensions and companion
- 7:06blocks. These let you add something
- 7:07callable through a type's name without
- 7:09first creating a companion object. On
- 7:11the JVM, declarations in a companion
- 7:14block can become static members without
- 7:16a JVM static. So, Cotlin has found
- 7:18another way to make Java
- 7:19interoperability slightly less
- 7:21ceremonial. Keep in mind that this
- 7:23feature still needs a compiler flag.
- 7:25Cotlin also adds three experimental
- 7:27functions for boolean values. The first
- 7:29two run a block when a condition has the
- 7:31matching value, then return the original
- 7:33boolean. So, you can write tags at
- 7:35Cotlin on true print line tag added and
- 7:37still keep the result of add. Meanwhile,
- 7:40if or null runs a block when the
- 7:41condition is true and returns null
- 7:43otherwise, compile time constants have
- 7:45also graduated to stable. So, the
- 7:47compiler can evaluate more expressions
- 7:49ahead of time, including supported
- 7:51string operations and unsigned
- 7:53arithmetic. Granted, this is a fairly
- 7:55modest change compared with the JVM
- 7:57updates we just covered, but useful when
- 7:59a value really does need to be a
- 8:01constant and you'd rather calculate it
- 8:03in Cotlin than paste the result into
- 8:05your code. We'll go old school today and
- 8:07The Wire is your awesome TV show
- 8:09recommendation, which in my opinion is
- 8:11one of the best TV series ever created.
- 8:14Please don't forget to like and
- 8:15subscribe because it helps a lot. And
- 8:17until next time, thank you for watching.
About this transcript
This page contains the full transcript of Now is the best time to learn Java by Awesome, generated from the public captions YouTube serves with the video. The transcript has 1,472 words across 243 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.