<div dir="auto"><div>> Nice! Why not go ahead and change all System.out.println to IO.println?</div><div dir="auto"><br></div><div dir="auto">I'll do that once it's either totally set that they are doing plain println and I just need to deal or they make IO.println function. </div><div dir="auto"><br></div><div dir="auto">> I read through your transition to multiple files. It isn't clear to me whether up to this point, students always name their program Main.java. Maybe add a note that in general the name of the implicit class is the file name.</div><div dir="auto"><br></div><div dir="auto">Noted. I'll reread what I got with that in mind. What I noticed the most is kids with a mega vs code project where they name the files just whatever.</div><div dir="auto"><br></div><div dir="auto">I also don't think that the implicit class is supposed to have a defined name, so...hmm.</div><div dir="auto"><br></div><div dir="auto">> Just tell students to import module java.base when they use multiple files. I wouldn't get into import static java.io.IO.*. That's a lot of complexity just to save "IO." for three methods.</div><div dir="auto"><br></div><div dir="auto">Haven't had a need to yet. Some of this seems to be feedback to those who can actually make these choices. I'll re-add amber dev</div><div dir="auto"><br></div><div dir="auto">> Another unrelated point: Why cover arrays before array lists? Lists are more regular. No special syntax, just method calls. And in practice, arrays aren't all that common. Students hate gratuitous choice. When my students asked me when they should use an array and when an array list, I always told them: Use an array list unless your professor, or an API, insists you use an array.</div><div dir="auto"><br></div><div dir="auto">Yeah so when I was a student I had the same frustration. Why even bother with arrays? Just show me List!</div><div dir="auto"><br></div><div dir="auto">I think what I'm realizing is that I wasn't actually annoyed with arrays, I was shown both arrays and ArrayList before I had enough knowledge to understand why to use which.</div><div dir="auto"><br></div><div dir="auto">The rough order now is</div><div dir="auto">* Cover arrays first. Let's us do that deeply. All we really care about early on is grinding methods and loops so it's all the same.</div><div dir="auto">* Cover ArrayList as useful if "you want basically an array that you can .add to"</div><div dir="auto">* (To be done) Cover List and frame List as an abstraction over different kinds of lists including ArrayList + you can turn an array into a List with Arrays.asList + if you don't need to add or set you can use List.of</div><div dir="auto"><br></div><div dir="auto">So basically I just think I can build up to a non hand wavey answer to those questions.</div><div dir="auto"><br></div><div dir="auto">> Also consider covering maps early on.</div><div dir="auto"><br></div><div dir="auto">I am very frustrated with courses that don't teach people maps so 100% going to do it. I have a commented out "build your own hashmap" section just like the "build your own ArrayList" but I might replace it with just "here is a Map/hash map" or... I'm not sure yet.</div><div dir="auto"><br></div><div dir="auto">But I don't see a pedagogically sensible way to get them in real early unless I front load Object, generics, etc or start hand waving.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sun, Nov 10, 2024, 2:53 AM Cay Horstmann <<a href="mailto:cay.horstmann@gmail.com">cay.horstmann@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nice! Why not go ahead and change all System.out.println to IO.println?<br>
<br>
It's shorter. It's consistent with other methods such as Math.sqrt and Integer.parseInt. It works in JShell.<br>
<br>
I read through your transition to multiple files. It isn't clear to me whether up to this point, students always name their program Main.java. Maybe add a note that in general the name of the implicit class is the file name.<br>
<br>
Just tell students to import module java.base when they use multiple files. I wouldn't get into import static java.io.IO.*. That's a lot of complexity just to save "IO." for three methods.<br>
<br>
Another unrelated point: Why cover arrays before array lists? Lists are more regular. No special syntax, just method calls. And in practice, arrays aren't all that common. Students hate gratuitous choice. When my students asked me when they should use an array and when an array list, I always told them: Use an array list unless your professor, or an API, insists you use an array.<br>
<br>
Also consider covering maps early on.<br>
<br>
Cheers,<br>
<br>
Cay<br>
<br>
On 09/11/2024 18:01, Ethan McCue wrote:<br>
> Hi all,<br>
> <br>
> I've shared this with some folks separately, but it's at the point where it's "partially topic complete" enough that I think I can share it more widely.<br>
> <br>
> I have been writing a book for covering Java as a first language assuming all the anonymous main class changes have landed.<br>
> <br>
> <a href="https://javabook.mccue.dev" rel="noreferrer noreferrer" target="_blank">https://javabook.mccue.dev</a> <<a href="https://javabook.mccue.dev" rel="noreferrer noreferrer" target="_blank">https://javabook.mccue.dev</a>><br>
> <br>
> I still need to go back and integrate println, readln, etc. (and obviously go further)<br>
> <br>
> I am sharing it here partially because I assume some general interest, but mostly to highlight the section where I transition from single files with anonymous main classes to full classes in their own files.<br>
> <br>
> <a href="https://javabook.mccue.dev/multi_file_programs" rel="noreferrer noreferrer" target="_blank">https://javabook.mccue.dev/multi_file_programs</a> <<a href="https://javabook.mccue.dev/multi_file_programs" rel="noreferrer noreferrer" target="_blank">https://javabook.mccue.dev/multi_file_programs</a>><br>
> <br>
> If it's going to be how this goes, I think I need advice on how to also include enough pre-work so that import static java.io.IO.*; and import module java.base; won't be a jumpscare.<br>
> <br>
> This blurb from my README I think suffices for additional context<br>
> <br>
> My primary goals with this are<br>
> <br>
> * 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.<br>
> * Be a template for other people. This is a book. Not everyone likes books, some like youtube videos, some like over priced udemy courses, some attend College, etc. Everyone has different learning paths. I hope this to be of use to anyone looking to make a more up to date Java curriculum and hope that the vague order of things (which I consider superior to the content<br>
> produced with the Java of years' past) is carried through.<br>
> * Write as if the newest Java wasn't new. It's obvious when a book was written before Java 8<br>
> because it always has newer additions with "addendum: brand new stuff in Java 8." But<br>
> the order language features were introduced is hardly a good order to teach them. You have<br>
> to pretend that Java 21 has always been *the* Java. Does it really make sense to show terrible<br>
> C-style switch statements way before switch expressions?<br>
> * Write as if the words Object Oriented Programming, Functional Programming, etc. didn't exist.<br>
> While I understand that these all have definitions and are useful concepts to know about, introducing them early seems to lead to either dogma, rejection of said dogma, or some<br>
> mix thereof. None of them are actually needed to understand the mechanics of and motivation<br>
> behind what we would call "object oriented" or "functional" techniques. They certainly don't<br>
> work as justification for adding getters and setters to every class.<br>
<br>
-- <br>
<br>
Cay S. Horstmann | <a href="https://horstmann.com" rel="noreferrer noreferrer" target="_blank">https://horstmann.com</a><br>
<br>
</blockquote></div></div></div>