3 ms·
This site would really gain by having an upvote mechanism, this way users would know what is the "best" way of doing things. Plus, needs more languages.
by self_awareness 7y ago
This site would really gain by having an upvote mechanism, this way users would know what is the "best" way of doing things. Plus, needs more languages.
- jdmichal 7y agoThe problem with this is that best can change over time as languages evolve. For instance, formatting a date in Java: https://www.programming-idioms.org/idiom/99/format-date-yyyy-mm-dd/1112/java https://www.programming-idioms.org/idiom/99/format-date-yyyy... The first listing was using a `SimpleDateFormat`, which for a long time really was the best way to do this. But now I would never recommend that over `String.format`, especially with the potential threading problems in the former. But the latter was not available until Java 1.5.
- skellera 7y agoAnd that’s fine. It would get voted down when it was no longer the best case.
- jdmichal 7y agoRealistically it would just sit there. At least that's what places like StackOverflow evidence. Meaning that whatever momentum it built up over the potential years of being the "right" answer would need to be overcome. Downvotes are typically reserved for wrong, not merely suboptimal. Especially since optimal and thereby suboptimal can change based on circumstance.
- Timpy 7y agoLet users contribute idioms, or request idioms for their language and use case... and we've reinvented the StackOverflow wheel
- wruza 7y agoI don’t know what the exact process is, but one can simply create something like https://codesnippet.stackexchange.com https://codesnippet.stackexchange.com and benefit from the established network.