Welcome to the twelfth ##java podcast. Your hosts are Joseph Ottinger, dreamreal on the IRC channel, and Andrew Lombardi (kinabalu on IRC) from Mystic Coders. Itâ€™s Tuesday, January 23, 2018.
As always, this podcast is basically interesting content pulled from various sources, and funneled through the ##java IRC channel on freenode. You can find the show notes at the channelâ€™s website, at javachannel.org; you can find all of the podcasts using the tag (or even â€œcategoryâ€) â€œpodcastâ€, and each podcast is tagged with its own identifier, too, so you can find this one by searching for the tag â€œpodcast-12â€.
Not an “interesting link,” but we discuss data formats – JSON, XML, HOCON, YAML, Avro, protobuff, Thrift…
Java 9.0.4 has been released, as part of the scheduled January update. NOTE: This is the final planned release for JDK 9. This is scary; see also Azulâ€™s post, â€œJava: Stable, Secure and Free. Choose Two out of Three,â€ which points out that with Javaâ€™s new rapid-release schedule, youâ€™re going to have to be out of date, insecure, or financially on the hook to â€¦ someone to keep up with security releases. Weâ€™ve been wanting new features in Java for a long time; weâ€™ve been wanting more churn in the JVM, too. Looks like we, as an ecosystem, might get to experience what Scala goes through every few months, except at least we have the option of stability somewhere.
Speaking of Scala, we have â€œ10 reasons to Learn Scala Programming Language.â€ It actually has some decent points to makeâ€¦ but makes them with Scala. Thatâ€™s dumb. Thereâ€™s nothing that Scala really offers you that Kotlin doesnâ€™t, and thatâ€™s assuming Java 8 and Java 9â€™s improvements donâ€™t turn your crank themselves. Itâ€™s almost got a point with Spark and Kafka (well, it mentions Spark, Play, and Akka, and Iâ€™m going to pretend that the author meant to say â€œKafkaâ€ instead), butâ€¦ when thatâ€™s your real lever for learning a language, itâ€™s time to admit that the language was a mistake.
DZone: â€œJava 8: Oogway’s Advice on Optionalâ€ is yet another attempt to justify
Optional in Java. It has a fair point to make: â€œOptional is not a replacement for the null check. Rather, it tries to tell the caller about the nature of the returned value and implicitly reminds the caller to handle the absent cases.â€ But â€¦ okay. So what? In the end, you still have to write what is effectively pretty simple code, and adding the semantic turns out in practice to mostly add noise to your code without actually making it any better.
DZone: â€œAn Introduction to Hollow Jarsâ€, which I found fascinating but I donâ€™t know why. A â€œhollow jarâ€ is apparently a deployment mechanism where you have two deployable components: the main one, the â€œhollow jarâ€ basically has the other component – which is the actual application code – in its classpath, and serves to invoke the entry point of the application. The invoker would theoretically change very rarely, and therefore could be baked into a docker image or some other base image, and the component that changes more often would be soft-loaded at runtime.
Welcome to the ninth ##java podcast. If we were using octal, weâ€™d be on the eleventh podcast by now. It’s hosted by Joseph Ottinger (dreamreal) and Andrew Lombardi (kinabalu on irc) from Mystic Coders and, as a guest, Tracy Snell (waz) on the IRC channel, and itâ€™s Friday, 2017 December 29.
As always, this podcast is basically interesting content pulled from various sources, and funneled through the ##java IRC channel on freenode. You can find the show notes at the channelâ€™s website, at javachannel.org; you can find all of the podcasts using the tag (or even â€œcategoryâ€) â€œpodcastâ€, and each podcast is tagged with its own identifier, too, so you can find this one by searching for the tag â€œpodcast-9â€. The podcast can also be found on iTunes.
You can submit to the podcast, too, by using the channel bot; ~submit, followed by an interesting url, along with maybe a comment that shows us what you think is interesting about the url. Yes, you have to have a url; this is not necessarily entirely sourced material, but we definitely prefer sourced material over random thoughts.
- Up first we have Eugen Paraschiv, from Baeldung, with “How Memory Leaks Happen in a Java Application“. Most Java coders donâ€™t really think about memory leaks, because the JVM is so good at, well, not leaking memory – but itâ€™s still doable, especially when you have long-lasting data structures sticking around, like caches, that can retain references to object trees long past their usefulness. Eugen points out the obvious suspects – the use of
static, for example, to retain references for the duration of the reference to the class – and also points out
String.intern() as a culprit for some. Thatâ€™s more a Java 7 and earlier problem than a Java 8 problem, since Java 8 handles interned strings differently. He points out unclosed resources as an obvious problem – unreleased filehandles, et cetera – and points out badly defined classes being used in collections (as
Objectâ€™s implementation of
hashCode() make retrieval difficult and therefore those objects will last as long as the
Set does). He follows it all up with some ways to detect memory leaks. Well done article, although some of the approaches that lead to memory leaks are a lot less of an impact than he implies, especially with the current releases of the JVM. (This does not mean that itâ€™s okay to be ignorant.)
“Some notes on null-intolerant Java,” from Dominic Fox, says that â€Null-intolerant Java is Java in which there are no internal null checksâ€. There are a few variants of this; thereâ€™re libraries that guarantee no methods will return null, other forms that use
Optional, or just throw exceptions if you use a null when youâ€™re not supposed to, or that will defensively check for null on library entry so that you fail immediately if you try to pass in a null when youâ€™re not supposed to. He also mentions Kotlinâ€™s null-checking – using the word “nugatory” for the first time in my experience. (It means â€œof no value,â€ just in case youâ€™re wondering or youâ€™re having difficulty inferring it from context.) His criticism of Kotlin in this case is that the null-checks are there whether you want them or not, and thereâ€™s a performance cost to them… but Iâ€™m not sure how well or deeply heâ€™s measured. Itâ€™s actually a pretty decently written article; he mentions
Optional – as he should, really – but also describes it sanely, meaning that he doesnâ€™t say something stupid like “use
Optional everywhere for nullable values.”
The Java subreddit r/java has a comment thread called â€œWhat are features that make Java stand apart from other languages?â€ Lots of interesting comments; the JVM features highly, the languageâ€™s simplicity features, the ecosystem, even the JCP gets a positive mention or two. Itâ€™s an interesting DISCUSSION. What do you think makes Java stand out? One of the things Iâ€™ve liked in Java thatâ€™s changing, though, is the preference for a single idiom; when you look at Scala, you can achieve a given task in eight wildly incompatible ways, but Javaâ€™s historically had ONE way to do most things, and thatâ€™s changing. Iâ€™m not suggesting that thatâ€™s a BAD thing, but itâ€™s something thatâ€™s changing. Essential conservatism in motion, folks!
RxTest is a Kotlin library meant to help test RxJava flows. (Is that what RxJava calls their pipeline processing mechanisms? I donâ€™t know.) Itâ€™s easy to test the simpler parts of event handling mechanisms – you pass it some input, see if you get the right output – but testing flows tends to be a little more involved, because most of itâ€™s asynchronous and itâ€™s hard to test entire streams of processes. Good idea, expressed cleanly, although if you donâ€™t know Kotlin it might be a good time to learn some of it. (This does not mean there arenâ€™t ways to test RxJava event handling in pure Java – itâ€™s just neat to see DSLs for stuff like this.) Also mentioned in this section: awaitility, a library whose name Joe apparently cannot pronounce.
Along the same topic: DZone also has an article on designing a DSL in Kotlin, entitled â€œKotlin DSL: From Theory to Practice.â€ Oddly enough, it also creates a testing DSL, for a learning environment. Youâ€™d think that people would use other problem domains for DSLs more often – but it seems like most examples are build tools or testing libraries. Itâ€™s still interesting stuff. Have you ever used or implemented a DSL? How broadly used was it, how successful do you think it was, and why?
Dan Luu wrote up an article called “Computer latency: 1977-2017” (therefore: “-40,” duh), using a keypress and the time it takes to display that key as a measure of latency. He goes into OS mechanics (simpler OSes display faster, regardless of processor speed) and display refresh ratesâ€¦ really fascinating stuff, even if itâ€™s not Java-related at all. (I kinda wish heâ€™d measured a JVM on some of these platforms, although that would expand his testing matrix considerably.) (Also mentioned in this section: Rastan, an old video game. And it’s “Rastan,” not “Rathstan,” which is what Joe was mistranslating it into. Memory is what it is, apparently.)
DZone is back with “Alan Kay Was Wrong (About Him Being Wrong),” an article talking about one of the primary ways to describe how objects interact: â€œmessaging.â€ (Alan Kay – a person, with a name – is considered one of the fathers of object-oriented programming, BTW.) It used to be that youâ€™d describe an object as “communicating” with another object by way of method calls, so youâ€™d say something like “the model is â€˜sent toâ€™ the renderer, with the
print method.” Nowadays, if youâ€™re not working with Objective C, that sounds a little quaint, I think, but itâ€™s still a way of thinking about data flow. The article is suggesting that Kay – who questioned the analogy – was absolutely right when you think about the objects in question being representative of modules rather than finely-grained objects. With Java 9 supporting module granularity, who knows – this analogy may be back in vogue when people really start using Java 9 modules in practice.
Well, it’s the end of the calendar year – may the new year bring you health, wealth, happiness, and comfort as you attempt to spread the same. We wish you all the best in everything you do.
Welcome to the second ##java podcast.
We have lots of interesting things to cover, so letâ€™s dive in.
- Java EE development has moved to the Eclipse Foundation, under the project name “Eclipse Enterprise for Java“, or “EE4J.” Java EE is still the branding for enterprise Java. This move makes Java EE more open; weâ€™ll have to see how well it works under the Eclipse Foundation. Weâ€™ll survive either way; itâ€™s a good move for everyone.
- RebelLabs’ Developer Productivity Report 2017 is here, almost 72% of the developers said their main programming language is Java 8 â€“ and about time, considering Java 7â€™s been dead for two years; IntelliJ IDEA is the most popular Java IDE at 54% with the respondents, and one of the survey questions says that 91% of the people who like it said itâ€™s because of superior functionality, as compared to 13% of Eclipse users and 73% of NetBeans users. Some other things that stood out: small teams are the norm, with teams of three to nine people making up half the teams, with medium-sized teams (10-19) coming in at 22%. Hmm, maybe a team of nine people isnâ€™t actually all that small. Itâ€™s a great report; you should check it out.
- Given Java 9â€™s release and new features, itâ€™s expected that a lot of migration articles are coming up. Sure enough, DZoneâ€™s in play with one that shows migrating a Spring app to Java 9. It has some module-based concerns and walks through fixing them; itâ€™s not exhaustive, but itâ€™s likely to be representative of early adoption efforts.
- Nicholas Frankel discusses some clean coding standards around lambdas. Itâ€™s easy to decide that a tool is available and thus must be used everywhere, he says â€“ actually, he says that developers act like children and we have to play with our new toys, which is probably a pretty appropriate description. He shows a fairly ugly way to use lambdas primitively, then shows how it can be made a lot more developer-friendly. Itâ€™s not exhaustive, but still worth looking at.
- According to InfoWorld, Java 9 is not going to receive long-term support. That doesnâ€™t mean itâ€™s not supported, but that the long-term support plans are different than what weâ€™ve seen in the past. Long-term support releases are going to be made every three years, so thatâ€™s the baseline for support plans; weâ€™ll have to see if (and how) this affects Java in the long run.
- Up next: another DZone link, this time on Javaâ€™s
Optional. The author, Eugen Paraschiv (from Baeldung) offers Optional as a tool for functional programming, and I suppose heâ€™s right, in a way. The article does a good job of walking through most, if not all, of what
Optional can do for your code, including with Java 9, and he does say that
Optional is meant as a return type and not a property type, which is â€¦ better than he could have done. The articleâ€™s worth reading, and is done at much more depth than many similar articles.
- We also saw mention of OpenTableâ€™s embedded PostgreSQL container. This allows us to treat PostgreSQL as if it were an embedded database (well, sort of); considering that PostgreSQL is a lot stronger for production use than, say, H2 or Derby, this is a nice way to do database-oriented integration tests on a â€œreal database.â€ Thatâ€™s not to say that H2 or Derby arenâ€™t real databases, but theyâ€™re anecdotally used in the Java ecosystem more as embedded databases to help with integration testing than as production databases. Of course, now that Iâ€™ve made that assertion, I expect RebelLabs to ask something about this on their next survey and completely demolish my statement. Thanks ahead of time, guys.
- A bit more on Java 9. RankRed has “What’s new in Java 9,” covering a bird’s-eye view of the changes: the module system, new versioning, the Java Shell, a better mechanism for compiling for older versions of Java, JLink, compact strings, high definition graphics, new factory methods for collections â€“ catching up to Kotlin and Scala, better networking and serialization security, Nashorn changes, a new random generator, segmented code caches, dynamic linking of object models, and an enhanced garbage collector. Whew, thatâ€™s a lot â€“ and I left some out. It gets better, though: The Java 9 readme points out that the default JCE policy files now allow for unlimited cryptographic strengths, a feature that the RankRed list left off.
- Spring 5.0 has gone to general availability â€“ itâ€™s been released, in other words. Support for Java 9, Java EE 8, functional variants, Kotlin, a new reactive web frameworkâ€¦ all kinds of goodies for Spring fans.
- Kotlin 1.2 Beta is out. Kotlin is another JVM language; this oneâ€™s from IntelliJ, the people who bring you the IDEA editor family. There are a lot of little improvements here, including some things that can drive you crazy during normal development â€“ thereâ€™s also multiplatform support, which is important even if youâ€™re like me and only really deploy on the JVM.
- We mentioned ZeroTurnaround early in the podcast â€“ the RebelLabs report â€“ but itâ€™s worth noting that in addition to the developer survey, they also released JRebel 7.1, with Java 9 support, Spring 5 support, and a bunch of other things too.
Okay, thatâ€™s this weekâ€™s podcast â€“ thanks for listening.
Yes, it’s been a while, I’ve been busy and I’m the only curator of this content:
… and just because I have a weird sense of humor:
randomUser> This code would run really well if it didn't keep waiting for the PRNG to determine the sign of a random number.