Hacker News new | ask | show | jobs
by firasd 1911 days ago
Here's a Jan 2008 archive link for the article being responded to: https://web.archive.org/web/20080112111747/http://www.sics.s...

I'm surprised that the original anti-Object Oriented Programming article says "data structures and functions should not be bound together" since in functional programming (if we take that as the extreme opposite of OO) they are still kinda bound together. Like if you have a JS array ['cricket', 'football', 'badminton'] it is both data and almost like a function at the same time, since you can iterate through the items and make code execute for each

For example in a webpage if there is a div id=football then you can select it using:

['cricket', 'football', 'badminton'].forEach(function (i) { document.getElementById(i); } );

In my mind this type of code really blurs the line between variables and functions