Skip to content

Latest commit

 

History

History
27 lines (25 loc) · 6.54 KB

Libs.adoc

File metadata and controls

27 lines (25 loc) · 6.54 KB

Libs

My recommendations concerning various libraries.

  • Google Guava: “new collection types (such as multimap and multiset), immutable collections, a graph library, functional types, an in-memory cache, and APIs/utilities for concurrency, I/O, hashing, primitives, reflection, string processing, and much more”. You should definitely use their preconditions helpers. Then check whatever else you might have a use for.

  • Parse CSV files: FastCSV 2014 to 2024, very simple, 524 stars; commons-csv 2005 to 2024 and 374 stars; CSVeed 2013 to 2024 and using beans and 99 stars; flatpack 2005 to 2024 and 57 stars; SuperCSV is old; uniVocity is abandoned; more references

  • Parse command line arguments: I have used Apache Commons CLI, but I’d encourage you to check out JCommander, or perhaps JOpt Simple.

  • iCalendar (ical, ics) files: according to SO, biweekly is better than iCal4j. I found that iCal4j has very scarce documentation. A minor inconvenience of both is that they use old date-time java objects rather than the new java.time API.

  • XML parsing: see DOM

  • Graphs: Guava (see above) has nice Graph structures, but few algorithms.

  • Personaly, I refrain from using vʌvr (despite its very cool name), because it uses sneaky throws (this position is debated). Same for Faux Pas, NoException and fge’s throwing-lambdas.

  • Native system information: OSHI

  • JSON parsing: although I like spec-driven APIs, I do not recommend JSON-B anymore (I use Jackson but have not tried much alternative libraries). Here are the reasons.

    • The spec process is painfully slow. In June 2021 discussions started about supporting records officially; it was soon clear that implementations in fact did support them already, but more than three years later (Jan 2025), still nothing in the spec.

      • Jackson: similar discussion started in June 2021, issue completed in January 2023.

    • The spec wording is often unclear, it seems to not have been reviewed by fluent English speakers.

    • The discussions to improve the spec are painfully slow and non-converging. I have spent unreasonable efforts making a simple point (close() throws Exception, it shouldn’t), to no avail; here are other examples.

    • There is a huge difference between the number of users of JSON-B and its main alternatives (GSON and Jackson), judging by the number of artifacts in Maven central using them. This lets me think that JSON-B will evolve slower than the alternatives, so that the gap will grow.

    • More voices for Jackson VS JSON-B here.

    • In case you want to use it anyway, here is some (somewhat outdated) doc about JSON-B.