I’m coming to this late, but: I’m not a big fan of allowing syntactic elements to be reordered arbitrarily and would prefer to come up with a “most logical” ordering to things and enforcing it for consistency across function declarations. That said, I’d also be very much in favor of having the compiler generate more helpful error messages like:
'throws' clauses must precede 'where' clauses in function signatures
when the programmer gets it wrong.
For me, the ordering:
- return type
- throws clause
- where clause
has a certain sense to it because the return type says most specifically / typically what the function returns / what the “type” of the function expression will be; the
throws clause is like an exceptional variation to the return type; and the where clause can be used to distinguish between multiple function definitions that otherwise have a similar signature. So these flow from a “most inherent to the function’s definition” to “least” order for me.