Hacker News new | ask | show | jobs
by Someone 1322 days ago
I think doing secondary sorting within such sections might have a benefit. That’s what Java does for documentation (example: https://docs.oracle.com/javase/8/docs/api/java/util/Abstract...)

Going fully alphabetical is consistent with the go documentation, though (example: https://pkg.go.dev/bufio@go1.19.3)

A third option is what Rust does. Its documentation follows source code order (example: https://doc.rust-lang.org/std/vec/struct.Vec.html). I like that best, but it requires programmers to do more work.

Also, if alphabetical order is deemed the way to go, I would make this a formatter, not a linter.

1 comments

> Going fully alphabetical is consistent with the go documentation, though

Nope, look how initializers are at the top of each section. That is not fully alphabetical at all.