Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. OO is not all that and a bag of chips

OO is not all that and a bag of chips

Scheduled Pinned Locked Moved The Lounge
c++sysadminooptutoriallearning
112 Posts 36 Posters 41 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H honey the codewitch

    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

    M Offline
    M Offline
    Member_14774770
    wrote on last edited by
    #43

    You are quarantined for the next 2 weeks to work with only Vb6. :laugh:

    N H 2 Replies Last reply
    0
    • M Member_14774770

      You are quarantined for the next 2 weeks to work with only Vb6. :laugh:

      N Offline
      N Offline
      Nelek
      wrote on last edited by
      #44

      That's not a quaratine, that's a punishment :rolleyes: :laugh: :laugh:

      M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

      R 1 Reply Last reply
      0
      • M Member_14774770

        You are quarantined for the next 2 weeks to work with only Vb6. :laugh:

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #45

        NOOOOOOOOOOOOOOOOOOOO

        Real programmers use butterflies

        1 Reply Last reply
        0
        • N Nelek

          That's not a quaratine, that's a punishment :rolleyes: :laugh: :laugh:

          M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

          R Offline
          R Offline
          Rick York
          wrote on last edited by
          #46

          Punishment of a cruel and unusual nature.

          "They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"

          1 Reply Last reply
          0
          • H honey the codewitch

            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

            W Offline
            W Offline
            W Balboos GHB
            wrote on last edited by
            #47

            I do what I want to do - what makes sense for what I'm doing. Every now and then I'll be inspired to wrap functionality into a class - as much for readability as anything else. Probably because I grew up with that old fashioned idea of a .lib file or something.

            Ravings en masse^

            "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

            "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

            M 1 Reply Last reply
            0
            • Greg UtasG Greg Utas

              sickfile wrote:

              Do it in OOP and you will make it big.

              You might have a lot of boilerplate, which is a PITA but not "big". It would be big if, say, functional programming was a much better fit for the problem.

              Quote from Kevlin Henney:

              "Once you reach a particular size, anything beyond that is no longer a reflection of functionality."

              It's often true that inside a big system, there's a small system struggling to get out. But as a blanket statement, this quote is just a platitude.

              sickfile wrote:

              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?

              18000 classes is a joke. But you can't compare it to the portion of a game that renders graphics, which is highly algorithmic and doesn't require much OO, although your point might be that this wouldn't stop some people from trying to do it that way.

              Robust Services Core | Software Techniques for Lemmings | Articles

              M Offline
              M Offline
              Martin ISDN
              wrote on last edited by
              #48

              > 18000 classes is a joke. But you can't compare it to the portion of a game that renders graphics, which is highly algorithmic and doesn't require much OO, although your point might be that this wouldn't stop some people from trying to do it that way. Exactly. Lets not make it a bigger joke by adding more classes to it. What's your opinion. Is my judgement wrong that a single Quake core team member can make the whole FB app in less time, more robust, easier to expand, easier to understand, less buggy, space and time optimized without even using the class keyword vs the whole team of architects that put those 18k of classes in the app?

              Greg UtasG 1 Reply Last reply
              0
              • W W Balboos GHB

                I do what I want to do - what makes sense for what I'm doing. Every now and then I'll be inspired to wrap functionality into a class - as much for readability as anything else. Probably because I grew up with that old fashioned idea of a .lib file or something.

                Ravings en masse^

                "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

                "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

                M Offline
                M Offline
                Martin ISDN
                wrote on last edited by
                #49

                That's exactly what I do, even for the sake of encapsulation. The only difference being a translation unit instead of a class. Any way that gets the job done is fine.

                1 Reply Last reply
                0
                • M Martin ISDN

                  > 18000 classes is a joke. But you can't compare it to the portion of a game that renders graphics, which is highly algorithmic and doesn't require much OO, although your point might be that this wouldn't stop some people from trying to do it that way. Exactly. Lets not make it a bigger joke by adding more classes to it. What's your opinion. Is my judgement wrong that a single Quake core team member can make the whole FB app in less time, more robust, easier to expand, easier to understand, less buggy, space and time optimized without even using the class keyword vs the whole team of architects that put those 18k of classes in the app?

                  Greg UtasG Offline
                  Greg UtasG Offline
                  Greg Utas
                  wrote on last edited by
                  #50

                  This is speculation, but my guess is no. For one thing, they're very different application domains. And although it's easy to hoot at 18000 classes, we should hoot at the managers and the corporate culture, not the developers. It could undoubtedly be done with 20% of the staff if only they had a clue whom to keep. But when you have the revenues of this lot, productivity is irrelevant. I've seen similar things. Design documents (before coding, in a waterfall methodology) running to hundreds of pages. FFS, I've never stayed true to anything beyond a high-level design that could be described in 20 pages. When something has 18000 classes, either there';s no architect or there are way too many. I don't recall which, but one of the currently fashionable methodologies says that there shouldn't be architects. Utter drivel unless it's a very small group of skilled developers that agree on the design.

                  Robust Services Core | Software Techniques for Lemmings | Articles

                  <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                  <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                  M 1 Reply Last reply
                  0
                  • N Nelek

                    honey the codewitch wrote:

                    But also, with the failure rate of software I'm glad we don't build bridges and skyscrapers.

                    The % of "so-called" programmers is much, much, much bigger than the % of architechts.

                    M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                    T Offline
                    T Offline
                    Tom Deketelaere
                    wrote on last edited by
                    #51

                    I wouldn't be so sure. For one off my previous jobs I had to write a program that calculates the thickness (not sure if that's the word) for glass so that it could support a given weight. When I asked the structural engineer about how to implement the formula for this, so a step by step calculation he replied: I have no idea I just enter the numbers in this program and it gives me the solution. So this structural engineer was entirely counting on a programmer (who I hope was counting on a actual structural engineer) somewhere.

                    Tom

                    N K M R 4 Replies Last reply
                    0
                    • H honey the codewitch

                      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

                      C Offline
                      C Offline
                      CPallini
                      wrote on last edited by
                      #52

                      Let's face it: C is a successful programming language. C++ has its drawbacks. Java is a pile of crap. In this regard, how good is OOP? :-D

                      H M 2 Replies Last reply
                      0
                      • C CPallini

                        Let's face it: C is a successful programming language. C++ has its drawbacks. Java is a pile of crap. In this regard, how good is OOP? :-D

                        H Offline
                        H Offline
                        honey the codewitch
                        wrote on last edited by
                        #53

                        C# is pretty great, but then I'm just being difficult. :)

                        Real programmers use butterflies

                        C 1 Reply Last reply
                        0
                        • H honey the codewitch

                          C# is pretty great, but then I'm just being difficult. :)

                          Real programmers use butterflies

                          C Offline
                          C Offline
                          CPallini
                          wrote on last edited by
                          #54

                          C# enforces OOP. That's no good.

                          H K 2 Replies Last reply
                          0
                          • C CPallini

                            C# enforces OOP. That's no good.

                            H Offline
                            H Offline
                            honey the codewitch
                            wrote on last edited by
                            #55

                            OO isn't a problem unless you turn it into a problem. Unfortunately, a lot of people manage to.

                            Real programmers use butterflies

                            C 1 Reply Last reply
                            0
                            • C CPallini

                              C# enforces OOP. That's no good.

                              K Offline
                              K Offline
                              kalberts
                              wrote on last edited by
                              #56

                              CPallini wrote:

                              C# enforces OOP. That's no good.

                              I think the real world is similar. They always want me to, say, distinguish between different people when I see them as a homogenous grey map. They even try to tell that this "object" belongs to "that" object, while I think I should be free to use anything the way I want to. They even say that there are things I am not allowed to look at, it is their "private life". This idea of the world being split into distinct "objects" really bothers me.

                              C 1 Reply Last reply
                              0
                              • H honey the codewitch

                                OO isn't a problem unless you turn it into a problem. Unfortunately, a lot of people manage to.

                                Real programmers use butterflies

                                C Offline
                                C Offline
                                CPallini
                                wrote on last edited by
                                #57

                                Lua (and C++), for instance, doesn't do that and it simply feels better sometimes.

                                H 1 Reply Last reply
                                0
                                • K kalberts

                                  CPallini wrote:

                                  C# enforces OOP. That's no good.

                                  I think the real world is similar. They always want me to, say, distinguish between different people when I see them as a homogenous grey map. They even try to tell that this "object" belongs to "that" object, while I think I should be free to use anything the way I want to. They even say that there are things I am not allowed to look at, it is their "private life". This idea of the world being split into distinct "objects" really bothers me.

                                  C Offline
                                  C Offline
                                  CPallini
                                  wrote on last edited by
                                  #58

                                  Now you are going philosophical. :)

                                  1 Reply Last reply
                                  0
                                  • T Tom Deketelaere

                                    I wouldn't be so sure. For one off my previous jobs I had to write a program that calculates the thickness (not sure if that's the word) for glass so that it could support a given weight. When I asked the structural engineer about how to implement the formula for this, so a step by step calculation he replied: I have no idea I just enter the numbers in this program and it gives me the solution. So this structural engineer was entirely counting on a programmer (who I hope was counting on a actual structural engineer) somewhere.

                                    Tom

                                    N Offline
                                    N Offline
                                    Nelek
                                    wrote on last edited by
                                    #59

                                    Jerks and morons are overall But still, there is much more less prepared programmers than architechts. Alone due to college. Note: And I am not saying that having a degree makes you automatically better professional, it is just about the numbers of people working in each field.

                                    M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                                    T 1 Reply Last reply
                                    0
                                    • H honey the codewitch

                                      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

                                      P Offline
                                      P Offline
                                      patvdwal
                                      wrote on last edited by
                                      #60

                                      Agree... More and more I'm starting to think we have been going the wrong way. The article that really had me started thinking about this was this one: https://medium.com/better-programming/object-oriented-programming-the-trillion-dollar-disaster-92a4b666c7c7 Excellent article. The simplest pieces of code we try to make so abstract that at some point it doesn't make sense anymore and gets hard to understand. You end op with classes like: OrderManagerProviderOrchestrator or OrderFactoryStrategy. And all of this because, you know, SOLID, KISS, abstraction, dependency injection, blah blah blah,... We spend so much time making code that way, making it independent, scaleable, etc. But in the end, whenever some change it necessary: oh no, this means we have to refactor everything!

                                      H M 3 Replies Last reply
                                      0
                                      • N Nelek

                                        Jerks and morons are overall But still, there is much more less prepared programmers than architechts. Alone due to college. Note: And I am not saying that having a degree makes you automatically better professional, it is just about the numbers of people working in each field.

                                        M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                                        T Offline
                                        T Offline
                                        Tom Deketelaere
                                        wrote on last edited by
                                        #61

                                        True, but all the same I'm staying away from glass buildings types in my area these days ;P

                                        Tom

                                        N B 2 Replies Last reply
                                        0
                                        • H honey the codewitch

                                          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

                                          K Offline
                                          K Offline
                                          KateAshman
                                          wrote on last edited by
                                          #62

                                          Same. After doing C++ for a couple of years, I've mostly restricted object design to db models and very rudimentary abstractions over external services and data sources. I feel like in OO design, too often we build abstractions on top of abstractions in a weird attempt to clean up ugly datasets, that somehow feel wrong to us on a basic level. 95% plain data and 5% esoteric? You can bet someone over-engineered a solution so the 5% can now be deduced from model-state alone. Every year I spend more and more time reversing situations like that, just to keep projects manageable. Cutting factories, flattening inheritance trees, and sometimes even re-introducing the dreaded 2% data redundancy that took 15 objects to solve. IMO, people are inherently bad at abstraction, so it's in our best interest to KISS.

                                          H 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups