4 ms·
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 reall
by throwawayplz 15y ago
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.
- there 15y agodo you have any code online that shows how you prefer to write? i'm curious to see how you organize things without objects (or mvc) and maybe being able to use your code to explain things may make it clearer.
- devs1010 15y agoYou can just think of objects as containers, if you have a bunch of functions that are related, but don't need to hold a specific "state" around them, then the class is essentially just a grouping (i.e. classes that just hold static methods), if nothing else, having them in a static class makes code more readable and organized, IMO. Its always been my belief that OO makes code easier to understand in a large codebase but I would agree that not everything necessarily fits cleanly into an object, however I can't envision any other way of making a large project work for a higher level business application, I can see why they may not be as needed in lower level programming. You mention that you're a systems guy, so maybe the type of programming you do isn't necessarily best suited for OO, but for some domains, like business-specific web apps I don't think there would be another logical way of organization, it is a form of fairly "high abstraction" from the 1's and 0's so it only lends itself to certain uses
- reuser 15y agoIf you write some gnarly asynchronous GUI code, it is a lot easier to point to why it is nice to have objects. (And MVC, for that matter). I think this is part of why objects blew up in the 80s
- davidhansen 15y agoBut, what's always baffled me is the insistence on the Nouns as a central point of focus in our programs As opposed to what? LISP has lists, C has structs. These are both nouns, and they are represented as memory-backed data structures in exactly the same manner that objects are. The boxes on a turing machine tape are nouns. What mystical language or platform supports verb-only development? I am completely missing the point of your objection to nouns, here. Please enlighten me.
- reuser 15y agoPossibly as opposed to 'verbs' (e.g. processes, mutations, transformations, open-ended mappings - descriptions of what is being done)
- throwawayplz 15y agobingo. 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.
- jinfiesto 15y agoThis is a fair point, but internal representation of the input can create drastic differences in how it's processed. Try writing an interpreter without tokenizing and parsing the text into some kind of AST. While this could be described as process, I think it proves that the internal representation of data matters.
- throwawayplz 15y agoNo 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."