
Ask HN: Suggestions for an exemplar Java project to showcase in class - DSpinellis
Turbo Pascal included the source code of a working spreadsheet written in Pascal. Reading it was a revelation for me: I quickly understood how to structure code in small procedures and functions.<p>I see that my students have trouble structuring their code in classes and methods, and I think that going through an exemplar project in classroom would help them a lot. Which projects would you recommend?<p>Ideally, I&#x27;d want something:
 non-trivial in size (tens of classes) and structure (use of composition, inheritance, dynamic dispatch, containers, enumerations, maybe interfaces, threads, generics, streams);
 useful in everyday situations that the students can readily appreciate;
easy to build;
 written with impeccable style in terms of structure, naming, commenting, and formatting;
 accompanied with unit tests;
 not dauntingly complex (this made me rule out the JDK libraries);
 of manageable size (&lt; 100k LoC, ideally &lt; 10k LoC).
======
marcuskaufmann
If your stundents have trouble with the most basic part of programmging I
would suggest that they should do more exercice to gain experience. Just by
seeing "good code" doesn't teach them anything.

A couple of years ago I had a lot of fun solving problems (e.g.
[https://projecteuler.net/](https://projecteuler.net/)) with friends and to
compare and discuss the solutions we've chosen.

~~~
DSpinellis
The students can by now program OK in the small, but I feel they will benefit
from some good examples regarding programming in the large.

~~~
marcuskaufmann
Then log4j might be an option since people will probably use it someday
anyway.

~~~
DSpinellis
I'm going through the source code. It looks indeed well-written and
structured. Its function is a bit difficult to catch the students'
imagination, but I think I can make a good case for it.

------
johny_bee
Not strictly adhering to you ideal needs, check out: \- Apache Commons lib \-
OpenJDK \- JabRef

