4 ms·
> What if a programming language would provide us with a structure that would act like an array of structs, but internally it would really behave like a struct
by gumby 6y ago
> What if a programming language would provide us with a structure that would act like an array of structs, but internally it would really behave like a struct of arrays?
I do this all the time (well, it’s not uncommon) in C++. The nice thing is I can mix the two with a bit of manual glue so callers don’t even have to know (though if you are doing this it’s often worth letting some callers know for the reasons described in this post.