logoalt Hacker News

benj111today at 1:17 PM1 replyview on HN

Is this about premature optimisation or just good architecture?

The number of data formats I see that miss obvious things like alignment etc. it isn't something you can easily change later if it becomes widely used.

To me this post represents the minimum you should be thinking about when designing any kind of data structure/format.

The only time where I would say it strays into premature is inverting the received flag, but only because you're optimising it for a particular processor and in a way that isn't particularly obvious. The inversion can easily be hidden behind a function call.


Replies

jdw64today at 1:25 PM

>The number of data formats I see that miss obvious things like alignment etc.

After reading that sentence, I felt a little guilty. It's actually a basic principle of design, but in practice, I just don't pay much attention to it and only write code for readability

show 1 reply