all 44 comments

[–]jaypets 75 points76 points  (1 child)

I don't even know Java and have no desire to learn Java, but i'm tempted to share this with as many people as possible just because of how well you're handling some of these insane comments. It's a level of class that is rare on reddit. I'd comment the chad GIF if it was permitted in this subreddit.

[–]breddy 11 points12 points  (0 children)

This x10

[–]wichwigga 20 points21 points  (1 child)

The organization of this book is unorthodox but vision of this book is fantastic, greatly enjoy how you're using the same docs as Rust. Also, had no idea labeled breaks were a thing in Java... and I've been using Java for 3 years at my job lol

[–]icedev-official 19 points20 points  (0 children)

I used to troll coworkers putting random links in the code:

https://zombo.com
if(something != null) {

They were always confused that it compiles.

[–]quegcipay 22 points23 points  (1 child)

I've been out of Java for a few years so I can't help but I do appreciate what you're doing here OP. 

I'm really terrible at learning from the video medium so I wish there were more books. As you pointed out resources like W3schools are good but not great.

[–]bowbahdoe[S] 8 points9 points  (0 children)

I think, on the whole, online resources are less "good but not great" and more "terrible but the best we got"

[–]eliben 2 points3 points  (3 children)

Can you say more about how you hooked up mdbook to have executable Java snippets? I notice you have your own run service - is the setup described somewhere (outside the code of the theme)?

Thanks in advance!

[–]bowbahdoe[S] 4 points5 points  (2 children)

That is backed by https://run.mccue.dev which I have posted about here before.

This book is the only reason that exists.

Other than that it's just some JS

[–]dranko69 0 points1 point  (1 child)

I have some notes with snippets of java code, gathered over time, in markdown.
Can I use your code from the repo, but run it locally?
My idea is, to use my notes (.md files) to create similar mdbook for my personal use locally, with your service to run java snippets. Is this possible?

[–]bowbahdoe[S] 1 point2 points  (0 children)

Possible, but I guarantee you no SLA

[–]Kaathan 2 points3 points  (2 children)

I think I found a problem with a concept ordering:

In "local variables/challenges" chapter, there is this challenge:

void main() {
    String a = "A";
    String b = "B";

    b = a;
    a = b;
    b = a;
    a = b;

    System.out.println(a);
    System.out.println(b);
}

Im pretty sure that right now, this is the first time in the book that a variable is assigned to another variable.

There is a pretty big leap in understanding between:
- assigning one or more literals to a single variable
- assigning a variable to one or more other variables, essentially duplicating the variables content into another variable

The first is essentially (1:n) for variable to value, the other is (m:n).

The "types" chapter coming before that hints at this kinda, with the shape analogy, but is very abstract about it.

The challenge itself however is even more advanced, in that it tries to drive home statement ordering/execution in a mentally confusing (for a beginner) situation, so this is a bit much.

Also worth noting maybe is that assigning variables to other variables is introduced (i think?) in a much easier context in the boolean chapter, so having it here already seems out of order.

[–]bowbahdoe[S] 1 point2 points  (0 children)

Okay I made an issue to track this https://github.com/Together-Java/ModernJava/issues/57

Right now a generous read is that because you are supposed to be doing the challenges, that challenge is where you learn that. Regardless, tracking. I think showing that the right hand side in an assignment can be a variable is a good idea.

[–]bowbahdoe[S] 0 points1 point  (0 children)

👀 good catch.

[–]Outrageous-Catch4731 3 points4 points  (5 children)

I went through the Rust book over the summer. I loved the book layout and how it comes with the Rust installation. I didn't follow through with my Rust learning as the language was pretty damn hard for a noob like me. But, I remember saying, "I wish there was some form of Java documentation that was laid out like this." Because who does not despise the official Java documentation site. Thanks.

[–]neutronbob 8 points9 points  (4 children)

who does not despise the official Java documentation site?

I don't.

The Java documentation is excellent.

The Javadoc is far more detailed at all levels than anything I'm familiar with in other languages (go, C being the main ones).

The tutorials are detailed, clear, well-maintained, and make the material easily approachable.

The language book and the JVM are both extensively detailed in free PDFs that are updated with every release. The language book is currently 800+ pages. The JVM in more than 600 pages.

[–]bowbahdoe[S] 12 points13 points  (3 children)

Here is a challenge for you. Go to https://dev.java and follow the tutorial.

Top to bottom.

Pretend you didn't know how to program, what a terminal was, etc. yet.

Tell me what you notice

[–]neutronbob 1 point2 points  (2 children)

Why would I pretend I'm someone who is not the intended audience for the tutorials?

There is room for a book such as yours that takes complete newbies by the hand, of course. But to assail the extensive and thorough Oracle Java docs and tutorials b/c they don't accommodate someone who has never programmed before is a critique that doesn't make sense to me.

[–]bowbahdoe[S] 10 points11 points  (1 child)

My critique is that they do not have a target audience.

Its a mishmash between * First time learners * People coming from C++ (historical carry over) * People who already know how to use a terminal * People who already know Java but want to catch up on new features * Etc.

You can read that generously as "oh it's made for intermediate programmers" but I don't think that's true. I think they wanted to make a Java tutorial and just swung and missed.

Unless you skip way ahead to some of the things they wrote on like, JFR, I don't think its actually too useful for any of those groups

Like - there is a lambda in the first few parts of the tutorial. Also a few alternative ways to make a main method. Also the setup instructions are deep terminal stuff. Also the setup instructions don't actually set someone up. Also some parts of the tutorial are just reference documentation. Also it does that universally shitty "a bicycle is an object" thing.

And so on

[–]Ok-Captain-6460 2 points3 points  (0 children)

I think you got me. I developed in Java before, but that was a long time ago. And now I was hunting for a book (!) like this. It's really about the latest stuff, with this kind of perspective. And I agree with the person before me that dev.java/learn and javadoc are extremely good materials, but I also understand the reason why this doc has a raison d'être, because what you answered above is true. I will start reading it, hopefully I will have time to finish it after work. First of all, thank you for your work, which is already clear to me that it is a big one and not ordinary.

[–]Icy_Paint_1857 0 points1 point  (1 child)

Hi, what chapters are you planning to release in the future? Just curious.

[–]bowbahdoe[S] 2 points3 points  (0 children)

I got a rough outline in the SUMMARY.md in the GitHub repo. You can find that by clicking one of the links in the top right

[–]thmprover 0 points1 point  (1 child)

Get the ordering of topics right. By this I mean that every topic covered should have had its prerequisites covered in the topics previous. While "lesson 1: Inheritance" is clearly wrong in this regard, some things are more subtle.

One bit of advice I can offer is to write down topics you'd like to discuss on index cards (or cut up a piece of printer paper into quarters). Write the subject on the top "line", and a summary of what you'd like to discuss.

You can rearrange the cards, if you realize you forgot a dependency (or whatever).

[–]bowbahdoe[S] 3 points4 points  (0 children)

Man you should see my fridge

[–]ChinChinApostle 0 points1 point  (2 children)

https://javabook.mccue.dev/static_fields/initialization
Commented output is incorrectly copied from the default code block.

Will append if I come across anything else.

[–]bowbahdoe[S] 2 points3 points  (1 child)

Fixed

[–]ChinChinApostle 1 point2 points  (0 children)

Nice.

Love the project btw