#comparator Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
Java Sorting with Comparator
`Comparator.comparing`, `thenComparing`, and `reversed()` chain into expressive multi-field sorts. Way cleaner than the old Comparable spaghetti.
Kotlin Sorting Collections
`sortedBy { ... }` returns a sorted copy. `sortedWith(compareBy { ... })` chains tie-breakers cleanly. Avoid `sortBy` (in-place) on read-only lists.