OO is not all that and a bag of chips
-
Disclaimer: Unpopular opinion A lot of coders spend a lot of lines of code dividing things into tiny steps which they then make whole classes for and abstract everything to the Nth degree, often even when the abstraction is not helpful. Back when I was a green coder, I used to write OO code somewhat like this. Then C++ changed me. I stopped relying on objects so much. This bled over into other languages. Now my code is about expedience. For example, I created a little HTTP server that does the request/response cycle in a single method, with two support structs instead of a dozen classes. My code is smaller, faster, easy enough to understand if you aren't a beginner and overall better for it. It's getting to the point where I think OO is an ill conceived paradigm - and not even because it's Broken As Designed (it's not) but because it gets way overused to the point where the dev world may have been better off with something else.
Real programmers use butterflies
-
Disclaimer: Unpopular opinion A lot of coders spend a lot of lines of code dividing things into tiny steps which they then make whole classes for and abstract everything to the Nth degree, often even when the abstraction is not helpful. Back when I was a green coder, I used to write OO code somewhat like this. Then C++ changed me. I stopped relying on objects so much. This bled over into other languages. Now my code is about expedience. For example, I created a little HTTP server that does the request/response cycle in a single method, with two support structs instead of a dozen classes. My code is smaller, faster, easy enough to understand if you aren't a beginner and overall better for it. It's getting to the point where I think OO is an ill conceived paradigm - and not even because it's Broken As Designed (it's not) but because it gets way overused to the point where the dev world may have been better off with something else.
Real programmers use butterflies
Like everything else involving programming, you use the right tool for the job. Fortunately, we can build our own tools for this job without needing special equipment or unreasonable amounts of electricity, and we don't leave a lot of wasted material laying around.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
Disclaimer: Unpopular opinion A lot of coders spend a lot of lines of code dividing things into tiny steps which they then make whole classes for and abstract everything to the Nth degree, often even when the abstraction is not helpful. Back when I was a green coder, I used to write OO code somewhat like this. Then C++ changed me. I stopped relying on objects so much. This bled over into other languages. Now my code is about expedience. For example, I created a little HTTP server that does the request/response cycle in a single method, with two support structs instead of a dozen classes. My code is smaller, faster, easy enough to understand if you aren't a beginner and overall better for it. It's getting to the point where I think OO is an ill conceived paradigm - and not even because it's Broken As Designed (it's not) but because it gets way overused to the point where the dev world may have been better off with something else.
Real programmers use butterflies
I agree. And have done since the The Beginning (Turbo Pascal 5.5 and Turbo C++ 1.0). No language should be purely OO, multi-paradigm (ptui) is the only true path. Use OO when it makes sense, but not wen it doesn't. You're not alone out here. Requisite link: Stevey's Blog Rants: Execution in the Kingdom of Nouns[^]
-
Disclaimer: Unpopular opinion A lot of coders spend a lot of lines of code dividing things into tiny steps which they then make whole classes for and abstract everything to the Nth degree, often even when the abstraction is not helpful. Back when I was a green coder, I used to write OO code somewhat like this. Then C++ changed me. I stopped relying on objects so much. This bled over into other languages. Now my code is about expedience. For example, I created a little HTTP server that does the request/response cycle in a single method, with two support structs instead of a dozen classes. My code is smaller, faster, easy enough to understand if you aren't a beginner and overall better for it. It's getting to the point where I think OO is an ill conceived paradigm - and not even because it's Broken As Designed (it's not) but because it gets way overused to the point where the dev world may have been better off with something else.
Real programmers use butterflies
I find it interesting that you now use objects less than when you first started to code. I would've thought that it would work the other way around. But maybe that's for us dinosaurs who first learned structured programming and later had to think in terms of objects. If you learn objects first, I can see it progressing in the opposite direction. I'm curious as to what you meant by C++ changing your attitude towards objects. Maybe you started to use them less because C++ has too much boilerplate! Sure, a standalone piece of code will be smaller, faster, and easier to understand if it isn't broken up into many little objects. But you called it a "little HTTP server". What if it had to be big? Or support other protocols? Or be integrated with a large system? The larger the system, the more important it is to achieve reuse and abstraction, which means separating concerns and using polymorphism, inheritance, and encapsulation. Without this, developers clone and tweak code that can't be reused because it's admixed with other concerns. It also becomes harder and harder to add new capabilities, because they have to interwork with components that exhibit superfluous diversity. A maze of twisty little passages, all different. That said, OO can get overused and won't solve everything. It would be great if it could be coupled with aspect-oriented programming, but I haven't seen a good way to do that, and aspects may simply be intractable when it comes to cleanly separating concerns.
Robust Services Core | Software Techniques for Lemmings | Articles
-
Disclaimer: Unpopular opinion A lot of coders spend a lot of lines of code dividing things into tiny steps which they then make whole classes for and abstract everything to the Nth degree, often even when the abstraction is not helpful. Back when I was a green coder, I used to write OO code somewhat like this. Then C++ changed me. I stopped relying on objects so much. This bled over into other languages. Now my code is about expedience. For example, I created a little HTTP server that does the request/response cycle in a single method, with two support structs instead of a dozen classes. My code is smaller, faster, easy enough to understand if you aren't a beginner and overall better for it. It's getting to the point where I think OO is an ill conceived paradigm - and not even because it's Broken As Designed (it's not) but because it gets way overused to the point where the dev world may have been better off with something else.
Real programmers use butterflies
You are beating the wrong horse. Do you think the JavaScriptors are better off, chasing after a new framework every week? Or maybe the the real Java guys? They are the most fanatic bunch I have ever seen and become totally helpless when they have a problem that should not exist in their dogmatic little world. Go over to Q&A and you will see the real problem. For quite some time programmers have been homogenized, sterilized and, most important of all, been taught not to waste much time thinking for themselves. Instead, their heads have been stuffed with rules, conventions and dogmas. Ask them why they think that something MUST be done in a certain way. Always, no exceptions allowed. It's a rule, they say. Or maybe a convention. Whose rules or conventions? When do they apply? What do they acomplish? Dunno, ask Guru Soandso or company xyz. Anyway, some of these mass produced idiots tend go overboard with the beliefs of their particular religion and make life more interesting for all who are not quite as fanatic as they are.
I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
-
You are beating the wrong horse. Do you think the JavaScriptors are better off, chasing after a new framework every week? Or maybe the the real Java guys? They are the most fanatic bunch I have ever seen and become totally helpless when they have a problem that should not exist in their dogmatic little world. Go over to Q&A and you will see the real problem. For quite some time programmers have been homogenized, sterilized and, most important of all, been taught not to waste much time thinking for themselves. Instead, their heads have been stuffed with rules, conventions and dogmas. Ask them why they think that something MUST be done in a certain way. Always, no exceptions allowed. It's a rule, they say. Or maybe a convention. Whose rules or conventions? When do they apply? What do they acomplish? Dunno, ask Guru Soandso or company xyz. Anyway, some of these mass produced idiots tend go overboard with the beliefs of their particular religion and make life more interesting for all who are not quite as fanatic as they are.
I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
I wouldn't say I'm being a fanatic about it. I use OO sometimes myself. For example, I'll typically expose the surface area of my APIs as objects, even if behind the scenes they don't work that way. I've seen a lot of otherwise decent developers overuse objects.
Real programmers use butterflies
-
I find it interesting that you now use objects less than when you first started to code. I would've thought that it would work the other way around. But maybe that's for us dinosaurs who first learned structured programming and later had to think in terms of objects. If you learn objects first, I can see it progressing in the opposite direction. I'm curious as to what you meant by C++ changing your attitude towards objects. Maybe you started to use them less because C++ has too much boilerplate! Sure, a standalone piece of code will be smaller, faster, and easier to understand if it isn't broken up into many little objects. But you called it a "little HTTP server". What if it had to be big? Or support other protocols? Or be integrated with a large system? The larger the system, the more important it is to achieve reuse and abstraction, which means separating concerns and using polymorphism, inheritance, and encapsulation. Without this, developers clone and tweak code that can't be reused because it's admixed with other concerns. It also becomes harder and harder to add new capabilities, because they have to interwork with components that exhibit superfluous diversity. A maze of twisty little passages, all different. That said, OO can get overused and won't solve everything. It would be great if it could be coupled with aspect-oriented programming, but I haven't seen a good way to do that, and aspects may simply be intractable when it comes to cleanly separating concerns.
Robust Services Core | Software Techniques for Lemmings | Articles
I can't really find much to argue with here, as I do believe OO has its place, even if i wonder if it hasn't made a mess of things too. I moved away from objects with C++ once I learned STL which led me to generic programming which deals in aspects moreso than objects.
Real programmers use butterflies
-
Like everything else involving programming, you use the right tool for the job. Fortunately, we can build our own tools for this job without needing special equipment or unreasonable amounts of electricity, and we don't leave a lot of wasted material laying around.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013But also, with the failure rate of software I'm glad we don't build bridges and skyscrapers. :laugh:
Real programmers use butterflies
-
I find it interesting that you now use objects less than when you first started to code. I would've thought that it would work the other way around. But maybe that's for us dinosaurs who first learned structured programming and later had to think in terms of objects. If you learn objects first, I can see it progressing in the opposite direction. I'm curious as to what you meant by C++ changing your attitude towards objects. Maybe you started to use them less because C++ has too much boilerplate! Sure, a standalone piece of code will be smaller, faster, and easier to understand if it isn't broken up into many little objects. But you called it a "little HTTP server". What if it had to be big? Or support other protocols? Or be integrated with a large system? The larger the system, the more important it is to achieve reuse and abstraction, which means separating concerns and using polymorphism, inheritance, and encapsulation. Without this, developers clone and tweak code that can't be reused because it's admixed with other concerns. It also becomes harder and harder to add new capabilities, because they have to interwork with components that exhibit superfluous diversity. A maze of twisty little passages, all different. That said, OO can get overused and won't solve everything. It would be great if it could be coupled with aspect-oriented programming, but I haven't seen a good way to do that, and aspects may simply be intractable when it comes to cleanly separating concerns.
Robust Services Core | Software Techniques for Lemmings | Articles
:thumbsup:Couldn't agree more! A bit of personal history: once upon a time when I was a young student of programming (an a fairly brilliant one if I may modestly say so :laugh: ) I started arguing with one of my professors about the merits of structured programming which I thought it led to far more bloated programs compared with the self-modifying code that I was able to churm. He was wise enough to just encourage me to stick with the structured code even if sometimes my unorthodox style would led to very efficient programs. In time I've got to see the error of my ways specially when I started working with a team and having to share code with humans not only with computers. When I learned OO it was equally hard at first to get used to it and my programs would have all the flaws a beginner OO programmer would do: too many classes, ill-defined responsibilities, multiple inheritance... you name it, I've done them all. Generic programming came along and I thought in the beginning that I need a debugger for the obscure error messages that the compiler threw at me. To make a long story short, each one of these steps brought something to my understanding and now I think I can choose the right tool for each problem. Throwing one of them away would not make me a better programmer. To the man with a hammer everything looks like a nail!
-
You are beating the wrong horse. Do you think the JavaScriptors are better off, chasing after a new framework every week? Or maybe the the real Java guys? They are the most fanatic bunch I have ever seen and become totally helpless when they have a problem that should not exist in their dogmatic little world. Go over to Q&A and you will see the real problem. For quite some time programmers have been homogenized, sterilized and, most important of all, been taught not to waste much time thinking for themselves. Instead, their heads have been stuffed with rules, conventions and dogmas. Ask them why they think that something MUST be done in a certain way. Always, no exceptions allowed. It's a rule, they say. Or maybe a convention. Whose rules or conventions? When do they apply? What do they acomplish? Dunno, ask Guru Soandso or company xyz. Anyway, some of these mass produced idiots tend go overboard with the beliefs of their particular religion and make life more interesting for all who are not quite as fanatic as they are.
I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
There is a name for that: Cargo Cult Programming.
-
I can't really find much to argue with here, as I do believe OO has its place, even if i wonder if it hasn't made a mess of things too. I moved away from objects with C++ once I learned STL which led me to generic programming which deals in aspects moreso than objects.
Real programmers use butterflies
The STL is definitely generic programming, but I don't see what it has to do with aspects. By aspects, I mean things that are orthogonal to a class's purpose but that are impossible to decouple from its implementation. Here are some examples[^]. If you use the code described in that article, without modification, you'll also drag in a pile of other things, whether you want them or not. Even if you do want them, it becomes a question of whether their implementations are what you want.
Robust Services Core | Software Techniques for Lemmings | Articles
-
There is a name for that: Cargo Cult Programming.
I'd never heard of that term being applied to programming. :laugh:
Robust Services Core | Software Techniques for Lemmings | Articles
-
The STL is definitely generic programming, but I don't see what it has to do with aspects. By aspects, I mean things that are orthogonal to a class's purpose but that are impossible to decouple from its implementation. Here are some examples[^]. If you use the code described in that article, without modification, you'll also drag in a pile of other things, whether you want them or not. Even if you do want them, it becomes a question of whether their implementations are what you want.
Robust Services Core | Software Techniques for Lemmings | Articles
I know what aspects are. To be clear: Where they tie in here, is you create "services" for your classes - implemented as templates that take your own class as a template argument. Those allow you to encapsulate orthogonal class services to a degree. It doesn't always allow for complex cross-cutting scenarios, and arbitrarily wrapping methods with pre and post code takes some vtbl foolery (microsoft takes this approach with certain ATL internals) but you get your aspects this way. It's kind of primitive and just as "kludgy but powerful" as templates are. Between the above and using type traits and such you can get it to do a lot of what you would do with aspect oriented builtins in a higher level language
Real programmers use butterflies
-
:thumbsup:Couldn't agree more! A bit of personal history: once upon a time when I was a young student of programming (an a fairly brilliant one if I may modestly say so :laugh: ) I started arguing with one of my professors about the merits of structured programming which I thought it led to far more bloated programs compared with the self-modifying code that I was able to churm. He was wise enough to just encourage me to stick with the structured code even if sometimes my unorthodox style would led to very efficient programs. In time I've got to see the error of my ways specially when I started working with a team and having to share code with humans not only with computers. When I learned OO it was equally hard at first to get used to it and my programs would have all the flaws a beginner OO programmer would do: too many classes, ill-defined responsibilities, multiple inheritance... you name it, I've done them all. Generic programming came along and I thought in the beginning that I need a debugger for the obscure error messages that the compiler threw at me. To make a long story short, each one of these steps brought something to my understanding and now I think I can choose the right tool for each problem. Throwing one of them away would not make me a better programmer. To the man with a hammer everything looks like a nail!
I think I probably muddied my point with my lament at the end about coding being worse off for OO. It was intended as a kind of rye way of saying it's been overused so much that maybe it has been harmful overall. I use OO myself where I find it's appropriate. My post shouldn't be read as a universal condemnation of it. It's more about how it's often used.
Real programmers use butterflies
-
Disclaimer: Unpopular opinion A lot of coders spend a lot of lines of code dividing things into tiny steps which they then make whole classes for and abstract everything to the Nth degree, often even when the abstraction is not helpful. Back when I was a green coder, I used to write OO code somewhat like this. Then C++ changed me. I stopped relying on objects so much. This bled over into other languages. Now my code is about expedience. For example, I created a little HTTP server that does the request/response cycle in a single method, with two support structs instead of a dozen classes. My code is smaller, faster, easy enough to understand if you aren't a beginner and overall better for it. It's getting to the point where I think OO is an ill conceived paradigm - and not even because it's Broken As Designed (it's not) but because it gets way overused to the point where the dev world may have been better off with something else.
Real programmers use butterflies
My thoughts is that overusing since a mantra in developer circle... For example, my pet peeve, I think Web developer culture is often very prone to over use interfaces and DTO... Old code in the web app I am working on, to do a return a simple select statement, can go through 6 interfaces, 4 data copy in the simplest case... :((
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
-
My thoughts is that overusing since a mantra in developer circle... For example, my pet peeve, I think Web developer culture is often very prone to over use interfaces and DTO... Old code in the web app I am working on, to do a return a simple select statement, can go through 6 interfaces, 4 data copy in the simplest case... :((
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
That's what I'm talking about. And for what? Does it help anyone understand the code? Help anyone maintain it (the opposite)? Is it efficient (not nearly as much as it could be) It seems like pointless busywork that makes the code less than what it could be so it's worse than not caring.
Real programmers use butterflies
-
That's what I'm talking about. And for what? Does it help anyone understand the code? Help anyone maintain it (the opposite)? Is it efficient (not nearly as much as it could be) It seems like pointless busywork that makes the code less than what it could be so it's worse than not caring.
Real programmers use butterflies
The worst when I simplify the code to what it is I am sometimes criticised for making the code "more complex" by not following "the architecture"! :laugh: Here there is a fine balance between politics and simplicity.... It did cost me my job once to disagree with accepted practice and it did cost me my sanity and I left another time. My current job is good. I am paid a lot and I progressively convinced them my code not only look simpler, it is also, indeed, simpler! :)
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
-
Disclaimer: Unpopular opinion A lot of coders spend a lot of lines of code dividing things into tiny steps which they then make whole classes for and abstract everything to the Nth degree, often even when the abstraction is not helpful. Back when I was a green coder, I used to write OO code somewhat like this. Then C++ changed me. I stopped relying on objects so much. This bled over into other languages. Now my code is about expedience. For example, I created a little HTTP server that does the request/response cycle in a single method, with two support structs instead of a dozen classes. My code is smaller, faster, easy enough to understand if you aren't a beginner and overall better for it. It's getting to the point where I think OO is an ill conceived paradigm - and not even because it's Broken As Designed (it's not) but because it gets way overused to the point where the dev world may have been better off with something else.
Real programmers use butterflies
Disclaimer: The Big Brother is watching you! There was a time when at least you could lose your job for such claims, at worst you could have get killed by an angry mob of mostly rookie developers who want to show of. I remember how much impressed I was with multiple inheritance, assignment overloading and copy constructors... One day I realized what I have always known as a kid. Programming is data processing. "in C++ as in Simula a class is a user defined type." "Every language that uses the word class, for type, is a descendent of Simula" Bjarne Stroustrup They should have called OOP - class oriented developing, because it's appealing to class obsessed chauvinists. Contrary to popular belief, objects are only data. You could have a pointer to an array of pointers to functions here and there or a reference to a function, but that's data too. No matter what language you use it all gets down to the same assembly language. Even before that, in the compilation process, programs are translated to a common language neutral data representation. So, for EVERY program in Java you could write a program in C that gets translated into the same assembly code the CPU will execute. But, you could hardly write a Java program for ANY C program that will be translated into the same assembly code. "The very first Java compiler was developed by Sun Microsystems and was written in C using some libraries from C++. Today, the Java compiler is written in Java, while the JRE is written in C." "The Sun JVM is written in C" Provided as is from Stackoverflow. C implements Java, but Java cannot implement C. Back to topic, this is what I find most appealing. "We don’t have a mathematical model for OOP. We have Turing machines for imperative (procedural) programming, lambda-calculus for functional programming and even pi-calculus (and CSP by C.A.R. Hoare again and other variations) for event-based and distributed programming, but nothing for OOP. So the question of “what is a ‘correct’ OO program?”, cannot even be defined; (much less, the answer to that question.)" It was given as an answer at Quora to the question 'Why did Dijkstra say that “Object-oriented programming is an exceptionally bad idea which could only have originated in California.?"' Greetings.
-
Disclaimer: Unpopular opinion A lot of coders spend a lot of lines of code dividing things into tiny steps which they then make whole classes for and abstract everything to the Nth degree, often even when the abstraction is not helpful. Back when I was a green coder, I used to write OO code somewhat like this. Then C++ changed me. I stopped relying on objects so much. This bled over into other languages. Now my code is about expedience. For example, I created a little HTTP server that does the request/response cycle in a single method, with two support structs instead of a dozen classes. My code is smaller, faster, easy enough to understand if you aren't a beginner and overall better for it. It's getting to the point where I think OO is an ill conceived paradigm - and not even because it's Broken As Designed (it's not) but because it gets way overused to the point where the dev world may have been better off with something else.
Real programmers use butterflies
The problem isn't OO; slavish fanatical adherence to anything at all screws everything up -- and it's certainly non-evolutionary. Doing things one way and one way only results in restrictions to growth and expansion. Given the above immutable fact, rigid adherence to OO practices is obviously wrong before even going into details, so I won't waste my time going into any (plus I don't have a week to spare).
I wanna be a eunuchs developer! Pass me a bread knife!
-
I find it interesting that you now use objects less than when you first started to code. I would've thought that it would work the other way around. But maybe that's for us dinosaurs who first learned structured programming and later had to think in terms of objects. If you learn objects first, I can see it progressing in the opposite direction. I'm curious as to what you meant by C++ changing your attitude towards objects. Maybe you started to use them less because C++ has too much boilerplate! Sure, a standalone piece of code will be smaller, faster, and easier to understand if it isn't broken up into many little objects. But you called it a "little HTTP server". What if it had to be big? Or support other protocols? Or be integrated with a large system? The larger the system, the more important it is to achieve reuse and abstraction, which means separating concerns and using polymorphism, inheritance, and encapsulation. Without this, developers clone and tweak code that can't be reused because it's admixed with other concerns. It also becomes harder and harder to add new capabilities, because they have to interwork with components that exhibit superfluous diversity. A maze of twisty little passages, all different. That said, OO can get overused and won't solve everything. It would be great if it could be coupled with aspect-oriented programming, but I haven't seen a good way to do that, and aspects may simply be intractable when it comes to cleanly separating concerns.
Robust Services Core | Software Techniques for Lemmings | Articles
> I'm curious as to what you meant by C++ changing your attitude towards objects. Maybe he meant that C++ is multiparadigm programming language as opposed to Java which selling point was that it's true and only OOP? "I actually never said that [C++ is an object oriented language]. It's always quoted, but I never did. I said that C++ supports object oriented programming and other techniques." Bjarne Stroustrup, Artificial intelligence Podcast 42:20 > What if it had to be big? Do it in OOP and you will make it big. "Once you reach a particular size, anything beyond that is no longer a reflection of functionality." Kevlin Henney, GOTO 2016 • Small Is Beautiful 55:40 The Facebook iOS app has over 18000 classes. How do you compare it to Quake 3 that can render 30FPS of a 3D world on Pentium 3? My guess is that the Quake team could have developed that fb app with 5 or no classes in 10x less time, the app being 10x less buggy and working at 10x speed vs the current iOS fb app. At the same time the iOS FB team could hardly construct a PAC-MAN type game. (No disrespect to pac-man coderz) It is always supposed by OOP supporters that the only pure moral way to write code is OOP and that elite developers do only OOP.