Skip to content

Comment on Revisiting the principles of data-oriented programmingparent

Comments

I think it very much depends on what problems you're trying to solve and whether or not proper data types have been defined.

If your primary data structure is

  Map<Integer, List<String>>
we have a huge problem.

On the other hand, if your primary data structure is

  Map<CustomerId, List<Purchase>>
Then I'd rather see that than IPurchaseMappingByCustomerIdAbstractFactory or whatever other abomination OO priests will conjure. Generally speaking, generic structures are simpler and they allow for easier transformations.

The article doesn't explain, but links into a deeper one. The author really means you should use Map<Integer, List<String>>.

He also seems to be unaware that you can have generic code with specific types.

You can still use types, as long as they don't encapsulate the data. Admittedly this is hard to do in some languages.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.