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

While the article is rant-y and some details sloppy, I have to admit his core point is pretty good. Rather the writing #ifdef'd code, why not write code that works the same regardless of endianness?

That seems like a good idea. Not for -all- the reasons he mentions, but for the simple reason that it's one code path so easier to code and easier to get right.




If you're using C++, you can dispose of the ifdefs completely and check at compile time the union of a uint16_t and two uint8_ts.


The C++ is just an interface... I'm just nice like that!




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

Search: