8 ms·
Is there a good guide to learning modern Java? At my workplace, we’re thinking about using it for a few things from Python. I’m not looking for a “Java for Pyth
by ok_dad 4y ago
Is there a good guide to learning modern Java? At my workplace, we’re thinking about using it for a few things from Python. I’m not looking for a “Java for Python developers” but more like “Java for people who already know about the basic structures of programming languages”. I would love to hear about variable instantiating and for loops as little as possible to grok the Java model of programming, then drive right into the meaty bits of how Java programmers think today. I did Java 20 years ago in college.
- dxxvi 4y agoHave you ever heard of the book Core Java for the Impatient?
- mikmoila 4y agohttps://dev.java/ https://dev.java/
- znpy 4y agothis looks awesome, thank you!
- xdavidliu 4y agoI recommend The Core Java pair of books by Cay Horstmann, supplemented by Effective Java by Bloch. Those are probably the two most authoritative sources on Java out there, and both highly readable. I heard not so good things about Herb Schildt's book.
- deleted 4y ago[deleted]
- ptx 4y agoI second this recommendation! I read Horstmann's books recently and they were excellent. He really puts things in context – any time I was thinking "WTF? Why would they do things this way?" he had an explanation coming up (or in some cases an acknowledgment that it is indeed a WTF).
- gleenn 4y agoHorstmann was one of my favorite teachers at San Jose State. He's a really sharp guy, and very enthusiastic teacher. I had him for a programming languages class and we dove into the various implementations of closures that were to be added to Java. We compared these to Scala and some other languages. Really fun diving in with his explanations along the way.
- lenkite 4y ago"Java for Developers Pocket Primer" is a new book that ramps you up fast (~200 pages) assuming you are already a developer familiar with programming.
- alfalfasprout 4y agoNow in 2023 I'd strongly think twice before investing heavily in Java. For the vast majority of use cases where Java is utilized Go ends up being a better choice w/ cleaner codebases, static binaries (none of this JDK/JRE deployment mess), and phenomenal performance. Not to mention proper interop with native (C/C++) code without JNI funny business.
- slaymaker1907 4y agoI work at Microsoft and I'd use Java (not even C# and yes at work) a hundred times before I'd consider using Go again. Go dependency management is a bit better these days, but the build system is an absolute mess, logging is dreadful, and IDE support seems pretty primitive. Also, Exceptions are vastly superior for most services compared to returning an error outside of a few edge cases since most of the time I have no idea how to handle errors at the callsite and really just need to handle any errors at a high level (like reverting the transaction and returning an HTTP error code).
- miohtama 4y agoWhy do Go still insists no exceptions?
- fweimer 4y agoGo has exceptions, with the usual stack unwinding. The standard library does not use them (for the most part, panics are sometimes used to simplify error handling code, see encoding/gob). It's like Perl and Rust in this regard. Undocumented exceptions/panics are often considered security vulnerabilities by the Go team. The argument against exceptions is that non-local control flow can introduce obscure bugs, like forgetting to clean up resources on the (invisible) exceptional execution path. On the other hand, without exceptions, it's possible to end up with no error handling at all by accident, and that too is not visible in the source code (but linters can help, of course). Many languages which are anti-exception as a matter of principle still use them to report out-of-memory conditions, out-of-bounds array indices, integer division by zero, or attempts to access absent optional values. Not doing this results in code that is simply too verbose.
- vijucat 4y agoOther have great recommendations. Two of mine: 1. The Java Programming Language book: The K&R of Java https://www.amazon.com/Java-Programming-Language-4th/dp/0321349806 https://www.amazon.com/Java-Programming-Language-4th/dp/0321... 2. Zantorc's videos: https://www.youtube.com/@Zantorc/ https://www.youtube.com/@Zantorc/ He really gets into the nitty gritty. You can listen to this while commuting, etc; Just finish 1 video per 3 days, say. It adds up quickly.
- xdavidliu 4y ago#1 is really out of date though; looks like published in 2005. I recommend Horstmann's Core Java, which covers up to Java 17.
- willbw 4y agoEffective Java by Joshua Bloch is fantastic for covering up to Java 9. There have been incremental updates since then but this book will get you 95% of the way, and it is very well written.
- xdavidliu 4y agonot really good for learning Java though, more for intermediate Java programmers. A much better book for someone learning the language is Core Java by Horstmann, which starts from the beginning and goes into depth.
- zikohh 4y agoIn 2023 don't write java but kotlin code.
- speed_spread 4y agoKotlin has no community process and is the work of single company. The dev experience is mostly bound to IntelliJ. Java is picking up the slack every release and actually innovates over Kotlin in new features.
- pjmlp 4y agoOnly when targeting Android. When is JetBrains coming out with KVM?
- zorr 4y agoWhat do you mean with KVM? A Kotlin-specific VM? I don't see the need for that as Kotlin the language is rapidly evolving into a higher level language that runs on top of JVM, Android, web and native platforms (iOS, MacOS, windows, Linux)
- pjmlp 4y agoThus it isn't a Java replacement to start with, a minimum common standard library, without having a platform to call its own. Guest language everywhere besides Android.
- deleted 4y ago[deleted]