HN user

throwawayplz

9 karma
Posts1
Comments6
View on HN

No argument here - not arguing against data structures, or standards for manipulating them. Mostly saying I prefer "Programs that operate on ASTs" than "ASTs have methods to operate on themselves."

The consistent interface point is well taken, and I think that's the main reason for OO's commercial success. If you force everyone to be verbose in their interface definitions, code is far less likely to break across distributed teams of devs.

I take issue with your "functions/methods are data." remark. They are not. If they were, they'd be mutable, and I could process them, make copies of them, and change them the way I do other data. This is the wannabe lisper in me getting out, but there's a world of difference between treating your methods as data that you can pass around, and having them be data items that you can actually transform.

In C I can pass function pointers around, and do with some regularity, without making everything in my programs objects.

I realize that some OO languages have this ability, but the mainstream ones (java, C++, python, ruby) generally do not.

I suppose my allergy is to the verbosity and code vomit that comes out in most production java/C++ and even OO Python code I've seen.

In C I would use structs and pass around pointers, then have functions that take those as arguments. This obviously sucks in the asynchronous case, but that paradigm has always felt more natural to me.

Put it another way: two examples. A) class Point with locals x,y,z and method 'distance' which takes a parameter that is another point. B) struct Point with components x,y,z. Then we have a function 'distance' which takes pointers to two Points.

Case B's - int d = distance(p1,p2); feels way more natural to me than Case A's - int d = p1.distance(p2);

Totally agree with the toolbox mentality, I've just rarely felt like the object hammer has felt like the right tool.

bingo.

In my mind, a program is something that accepts input, does some processing on that input, and produces output. To me, the "programming" should revolve around the processing, rather than around the internal representation of the input, intermediate data, or output.

Maybe a little hard to describe, but why should everything be an object? Why should everything I want to operate on have to have methods? Etc.

I actually really see the benefit of inheritance in many OO settings, in that it encourages abstraction. But, what's always baffled me is the insistence on the Nouns as a central point of focus in our programs.

To throw more heresy on the fire, I think the MVC paradigm is absolute crap, and don't want to see it ever again if I can avoid it.