6 ms·
"Turning everything into an object can make a small program into a big program, so it’s maybe not such a good idea for small-scale stuff." In my experience OOP
by FpUser 7y ago
"Turning everything into an object can make a small program into a big program, so it’s maybe not such a good idea for small-scale stuff."
In my experience OOP actually makes programs smaller. Assuming of course they have good programmers/architects and the program itself is larger than "Hello world".
- darkerside 7y agoIn my experience, OOP makes programs different. Might be bigger or smaller, but the real difference is complexity. Not in that it makes things more or less complex, but in that it moves the complexity around to different places. Those places being complex (and others simpler) might make it easier or harder to maintain your program, which is what makes these decisions highly dependent on your particular systems and teams.
- FpUser 7y agoOOP does not "move" complexity. People do.
- mbrameld 7y agoA distinction without a difference.
- FpUser 7y agoThere is a difference. OOP is just one of many tools to help accomplish a task. Many other tools as well. It is up to the people how to use tools for a job and what tools for what job. You equating OOP with the dangerous things that should be kept away has no basis in programming.
- afiori 7y agoThe concept of footgun exists.
- mbrameld 7y agoThe way people use OOP causes them to move the complexity in a particular way. That's why the distinction doesn't make a difference in this context. You're right, technically it wasn't OOP that was writing the code, it was the person. We would have never figured that out without your guidance, we all just though OOP was banging away on the keyboard.
- FpUser 7y ago"The way people use OOP causes them to move the complexity" Why don't you try to read carefully what you've just said in the sentence above
- mbrameld 7y agoWhy? I wrote it, I know exactly what it means. Maybe you should take a closer look? If everyone who uses OOP moves the complexity in the same way because they're adhering to OOP, then it is a distinction without a difference because the complexity is moved regardless. It's a nuanced concept so don't beat yourself up if you don't understand.
- darkerside 7y agoI want taking a side here, just noting a tradeoff inherent to the choice in programming paradigm. When you make effective abstractions, you make your program bendy in all the right places. It's easy to add new objects where you will need them, and it's easy to extend behavior in places you need to do that. Of course, if you guess wrong, you're totally fucked. Well, either that, or you are smart and see it coming in time to rewrite the code that put the complexity in the wrong place. Hope that helps with the context. I'm not some anti-OOP zealot, and those do exist.
- FpUser 7y agoI am in total agreement with what you've just said. Basically it all comes down to programmer being either smart or stupid. OOP on its own has nothing to do with the overall complexity and where it is "moved". Shitty programmer will fuck things up no matter paradigm. And good programmer can use various paradigms to their advantage depending on particular situation. But no. From what I see we have crusaders here.
- darkerside 7y agoGuns don't kill people, people kill people. With guns.
- fouc 7y agoSounds pretty unlikely. You don't need OOP to have fairly DRY and well organized code that is nice and small.
- FpUser 7y agoYou do not need a lot of things to write software. Does not mean you can no benefit from those when applied with good reasons. OOP concepts can help while coding certain domains and yet other can benefit from a different style.
- ChrisMarshallNY 7y agoDon't get me wrong. I love OOP, and have been using it since before it was cool. It's been a standard wrench in my toolbox for decades. In fact, I have been running into folks, these days, that don't understand it, as, apparently, OOP is becoming "uncool." I've always been a "right tool for the right job" kind of guy. I started off with ML (Machine Language, not Machine Learning). I am quite comfortable, sitting down with a breadboard, and flashing an OS. But I remember the old days of OOP, where "classic" structured programmers didn't "get" OOP, and designed these horrific chimeras. I always make it a point to understand my methodology and drivers "to the bone." Just because someone at a conference said it, doesn't mean that I should use it for everything.
- jjgreen 7y agoPlease write a blog post called "Horrific OOP chimeras" and post a link on HN ...
- ChrisMarshallNY 7y agoOh...the stories I could tell... But I have made it a point of personal ethos not to post criticism or polemics, denigrating/excoriating the work of others. I know that could buy me a lot of clicks (and probably some considerable HN Above The Fold time), but I think we have enough negativity and finger-pointing on the Internet. If you read my stuff, you won't see much of that. I may, in a rather vague way, allude to something that gives me a frowny-face, but I don't want that to be part of my "personal brand," so to speak. I do take tremendous personal pride in my work; both coding and writing, and hold myself to a high bar. I may even project that bar onto others (only in some circumstances), but I don't think it's helpful to do so in public. I find it most gratifying to write a "This is how I do this..." post, as opposed to a "This isn't how you should do it..." post.
- FpUser 7y agoLots of words. What's the conclusion? OOP is bad? Or maybe it is incompetent people who manage to f.. things up no matter what you give them or people with the agenda going on holy crusades?