Hacker News new | past | comments | ask | show | jobs | submit login

Some `design patterns' are expressible even in very weak type systems.

For example, array of tuples vs tuple of arrays. In pseudo Haskell notation:

:: ([a], [b], [c])

:: [(a, b, c)]

The second option enforces that you have the same number of a's, b's and c's. The second option can be faster to access in, say, C.

(I wonder whether you can do a similar, but more complicated, analysis for internal vs external linked lists and other containers.)




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

Search: