7 ms·
Ask HN: Suggestions for an exemplar Java project to showcase in class
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.
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?
Ideally, I'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 (< 100k LoC, ideally < 10k LoC).
- marcuskaufmann 8y agoIf 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 8y agoThe 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 8y agoThen log4j might be an option since people will probably use it someday anyway.
- DSpinellis 8y agoI'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 8y agoNot strictly adhering to you ideal needs, check out: - Apache Commons lib - OpenJDK - JabRef