Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If your target audience is C, packing 3 values into one might even be the easiest to reason about, you get a single value that you can compare with the usual < and > etc. operators.


At some point, someone needs to point out the nonsense and just accept operator overloading...

Or maybe writing a version_cmp function or similar.


I don't understand your exact point, but the GNU C library ships with the strverscmp() and versionsort() functions, which do the same thing as `ls -v`.


The language already has an incredibly simple facility to compare version numbers (that GP mentions, but also there's macros), but you want to do it in a more complex way?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: