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 50 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.
  • T Tom Deketelaere

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

    Tom

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

    If I knew where a couple of classmates have been working I would avoid some products too :rolleyes:

    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.

    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

      M Offline
      M Offline
      milo xml
      wrote on last edited by
      #70

      I think you'd be surprised at how many rely on Autocad to do their structural calculations for them.

      S 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

        O Offline
        O Offline
        obermd
        wrote on last edited by
        #71

        This is how I feel about almost all frameworks. As soon as you try to apply them outside their original purpose you end up with bloated, slow, and unmaintainable code. OO is a tool to organize your code, but like all tools it can be misused.

        1 Reply Last reply
        0
        • S Stuart Dootson

          But we *do* build software that [keeps aircraft in the sky](https://en.wikipedia.org/wiki/Boeing\_737\_MAX\_groundings) (that's a system failure, arguably, but involves the software), keeps nuclear reactors from melting down, and [calculates dosages for medical devices](https://en.wikipedia.org/wiki/Therac-25)... I've developed software that is currently flying on passenger aircraft and I can tell you with certainty that the practices and processes used for those lines of code were vastly different than what's used for most software - the [NASA Software Engineering Handbook](https://swehb.nasa.gov/display/SWEHBVC/Book+A.+Introduction) is a pretty good example of this.

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

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

          Don't even get me started on the dosages one. A multithreading issue killed 3 people (as i recall) connected to machines delivering chemo treatments.

          Real programmers use butterflies

          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

            B Offline
            B Offline
            BryanFazekas
            wrote on last edited by
            #73

            Codewitch, from the replies, your opinion isn't all that unpopular. In specific uses cases, OO is a great technique. Thinking about encapsulation is helpful in identifying all the pieces-n-parts, even in situations where the solution is procedural. But as others have stated, it's not a universal tool and it's amazing how badly people use and mis-use it. I've seen co-workers spend months shoe-horning a solution into an inheritance model, when a procedural solution was completed in 2 weeks (after the OO solution failed). It's like everything else -- when the only tool you have is a hammer, everything looks like a nail ...

            1 Reply Last reply
            0
            • M Mike Winiberg

              I found much the same - although it was C++ that finally convinced me that OO wasn't 'all that' 8) After 'objectifying' some intricate real-world code (for an airline/shipping booking system) I realised that in order to get the behaviour of the objects right I was creating what were in effect object 'global' variables that could (due to inheritance) easily get accidentally 'hidden' by a variable with the same name in the dependent module. In other words - because it was a legal thing to do in C++ - variable scope could be overridden without warning (fortunately compilers these days do warn about such things). When the fiasco that was manipulators (which I used extensively!) hit when going from Ver1 to Ver2, which then got corrected again in Ver3 (FFS!) I decided that C++ and its vision of OO was getting far more complex and difficult to manage correctly (for me anyway - my failing perhaps, not the language itself?) that I switched to Java for my next OO projects. Very verbose cf C++ but much more stable at the level I was using. However, other programmers of long-standing who I respect have gradually formed similar views to mine about OO and C++ in particular so I don't feel too downhearted. 8) Quite by chance all my work now is in either Visual Basic for Applications (Access), SQL Server or Python, so go figure! If I had to go back to something close to the machine I would almost certainly go for C rather than C++ (or maybe Go etc).

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

              I'd argue that C++ doesn't have a real vision of OO. It is capable of doing OO but wasn't really made for it. Rather than OOP, CPP is geared for generic programming, like how STL is laid out.

              Real programmers use butterflies

              1 Reply Last reply
              0
              • K KateAshman

                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 Offline
                H Offline
                honey the codewitch
                wrote on last edited by
                #75

                I profoundly agree

                Real programmers use butterflies

                1 Reply Last reply
                0
                • P patvdwal

                  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 Offline
                  H Offline
                  honey the codewitch
                  wrote on last edited by
                  #76

                  Agreed, and thanks for the link. It gives me some reading for this morning =)

                  Real programmers use butterflies

                  1 Reply Last reply
                  0
                  • P patvdwal

                    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 Offline
                    H Offline
                    honey the codewitch
                    wrote on last edited by
                    #77

                    your link links back to the lounge btw. I had to copy it out to get it

                    Real programmers use butterflies

                    P 1 Reply Last reply
                    0
                    • C CPallini

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

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

                      I've seen plenty of people, including profs who should darn well know better try to use C++ as an object oriented language. It's one of my peeves. I want to buy anyone that does it a copy of Accelerated C++ by Andrew Koenig and Barbara Moo, so that they can learn the more effective way to abstract in C++

                      Real programmers use butterflies

                      C 1 Reply Last reply
                      0
                      • D Daniel Pfeffer

                        honey the codewitch wrote:

                        I'm glad we don't build bridges and skyscrapers.

                        We've been building physical structures for thousands of years, and writing software for less than 80. Architecture and civil engineering are obviously more mature disciplines than software engineering. Assuming civilization survives, I am certain that our software development efforts will be viewed by future engineers in the same manner that the builders of mud huts are viewed by modern civil engineers. (But we do build some very impressive mud huts! :-\ )

                        Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

                        E Offline
                        E Offline
                        englebart
                        wrote on last edited by
                        #79

                        I think you are giving too much credit with the "mud". Mud + straw bricks will last a very long time! More like straw huts with a few sticks. This is making me think of software before memory protection. I imagine a village with thatched roofs side by side by side. Each house is an app. The thatched roofs are the ram for that app. The village is the whole machine. A fire in one house would rapidly jump roofs and take out the entire village.

                        D 1 Reply Last reply
                        0
                        • H honey the codewitch

                          your link links back to the lounge btw. I had to copy it out to get it

                          Real programmers use butterflies

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

                          Ok, my bad haha

                          H 1 Reply Last reply
                          0
                          • H honey the codewitch

                            I've seen plenty of people, including profs who should darn well know better try to use C++ as an object oriented language. It's one of my peeves. I want to buy anyone that does it a copy of Accelerated C++ by Andrew Koenig and Barbara Moo, so that they can learn the more effective way to abstract in C++

                            Real programmers use butterflies

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

                            The problem with professors is they want to teach their students 'low level stuff', like, for instance, arrays, using C++. It can be done, of course, but it isn't, in my opinion, the smartest way to start teaching C++. Might be there are also very-old-school teachers that don't appreciate (or simply are unaware of) the powerful OOP support C++ provides. But I believe this is a negligible minority.

                            H 1 Reply Last reply
                            0
                            • C CPallini

                              The problem with professors is they want to teach their students 'low level stuff', like, for instance, arrays, using C++. It can be done, of course, but it isn't, in my opinion, the smartest way to start teaching C++. Might be there are also very-old-school teachers that don't appreciate (or simply are unaware of) the powerful OOP support C++ provides. But I believe this is a negligible minority.

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

                              generic programming is something anyone can learn easily for about $25-$30 using Accelerated C++ - too bad it's not a textbook

                              Real programmers use butterflies

                              C 1 Reply Last reply
                              0
                              • P patvdwal

                                Ok, my bad haha

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

                                it was worth it. Thanks for the link :)

                                Real programmers use butterflies

                                1 Reply Last reply
                                0
                                • H honey the codewitch

                                  generic programming is something anyone can learn easily for about $25-$30 using Accelerated C++ - too bad it's not a textbook

                                  Real programmers use butterflies

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

                                  That's self-teaching. Professors, on the other hand, exist for different purpose (produce chaos in student minds).

                                  1 Reply Last reply
                                  0
                                  • E englebart

                                    I think you are giving too much credit with the "mud". Mud + straw bricks will last a very long time! More like straw huts with a few sticks. This is making me think of software before memory protection. I imagine a village with thatched roofs side by side by side. Each house is an app. The thatched roofs are the ram for that app. The village is the whole machine. A fire in one house would rapidly jump roofs and take out the entire village.

                                    D Offline
                                    D Offline
                                    Daniel Pfeffer
                                    wrote on last edited by
                                    #85

                                    englebart wrote:

                                    Mud + straw bricks will last a very long time!

                                    Yes, in the right climate. It is not well suited to climates with heavy rains. This is beside the point. No modern architect would seriously consider using mud (or mud + straw) for a building, and likewise no future software engineer would think of using the techniques (or lack of them :sigh: ) used in most current software.

                                    Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

                                    S 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

                                      B Offline
                                      B Offline
                                      Bitbeisser
                                      wrote on last edited by
                                      #86

                                      I don't think that OO in general is "ill conceived" but I do agree that is by far overused and misused since it was "invented". There are certainly benefits to encapsulate both code and data, and to some degree, abstraction can help to make code more readable and thus maintainable. But in far too many cases, this leads nowadays just to a royal mess where people do this ad nauseam, creating totally unreadable and incomprehensible code (beside the original coder, at the time they creating that piece of code) and are even proud of it. It's simply has turned into "too much of a good thing"...

                                      H 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

                                        R Offline
                                        R Offline
                                        Robert Not The Pirate
                                        wrote on last edited by
                                        #87

                                        I had similar experience early in my career and now have another. I worked on a banking application where I needed to calculate APR (annual percentage rate). I asked several mortgage bankers how they do the calculation, not a one knew. Each stated the rate was on the docs they received from the intake clerk. I asked the clerk, she said she used her mortgage calculator, a hand held device. Currently, I am investigating solar panels for my home. I have 4 companies responding each with proposing different configurations despite using the same utilization rates published by my electric provider. Accuracy, it appears, is in the math of the beholder.

                                        1 Reply Last reply
                                        0
                                        • B Bitbeisser

                                          I don't think that OO in general is "ill conceived" but I do agree that is by far overused and misused since it was "invented". There are certainly benefits to encapsulate both code and data, and to some degree, abstraction can help to make code more readable and thus maintainable. But in far too many cases, this leads nowadays just to a royal mess where people do this ad nauseam, creating totally unreadable and incomprehensible code (beside the original coder, at the time they creating that piece of code) and are even proud of it. It's simply has turned into "too much of a good thing"...

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

                                          That's why i say it was ill conceived. At least perhaps. Is software development better or worse off because of it? I'm not so sure it's better. I don't know though.

                                          Real programmers use butterflies

                                          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