Skip to content
  • The OG PC Programmer Teaches Real OOP

    The Lounge c++ com oop question
    9
    0 Votes
    9 Posts
    0 Views
    J
    Gary Wheeler wrote: Since OOP largely predates my college education (1979-1984, Wright State University, go Raiders) I learned it on the fly at work. I was less than a year old when you went to college then. Don't hold it against me though. :laugh: Gary Wheeler wrote: You can use OOP principles in assembly language or a Windows batch file if that serves the problem at hand. Amen, brother. Gary Wheeler wrote: I've always viewed academic purists(*) with skepticism, and Alan Kay's opinion triggers me. He has a chocolate hammer, and seems to think it is the only thing for nails even when they're pesto-flavored. True dat, man. Acedamia is great and needed, but you don't _really_ learn something until you apply it and use it. Even Einstein said at some point you gotta get your face out of the books and start doing. Never stop reading, but do something already... otherwise you're just repeating crap you don't really know. Personally, I think OOP (even the version we know that's not the same) is cool. I like the way Java/C# organizes things, for instance. Nothing against the theories. But, you can also accomplish the same concepts with functional programming, etc. Then you get peeps that don't even understand what they're doing acting all superior. Welcome to life I guess... Gary Wheeler wrote: (*) Don't even mention Grady Booch. I'll have to Google him, but I dare not mention it. :laugh: :laugh: Jeremy Falcon
  • What's the object-oriented way to become wealthy?

    The Lounge oop question
    51
    0 Votes
    51 Posts
    0 Views
    N
    It was more to tease you than anything else. I think this thread already had given its fruits and it is a good moment to stop it here. Let's hijack another thread, when an interesting point is made ;) ;P :-D 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.
  • Anyone care to take a stab...

    The Lounge c++ css com oop question
    8
    0 Votes
    8 Posts
    0 Views
    R
    Here is my stab with a rusty spoon (i.e. a very bad analogy based on the link you provided) Particles are like boats on a flat lake, the 2D surface of the lake representing our 3D universe. Without an anchor (massless objects) they go racing about the lake, as the current directs them. If they have mass then they have an anchor hanging down into the lake. This will not simply hang down, as the water is not thick enough, but will swing back and forth like a pendulum. This will cause the boat to oscillate and that will cause ripples. (Just about everything in the analogy is wrong, I'm afraid, but I was trying to emphasize the role the anchor plays and how something can be stationary and still cause ripples.)
  • Mars declared unsafe

    The Lounge c++ html com oop question
    33
    0 Votes
    33 Posts
    0 Views
    A
    But how could the super rich turn that into a pissing contest?
  • Takes Me Back to Childhood

    The Lounge c++ com oop question
    15
    0 Votes
    15 Posts
    0 Views
    J
    never heard this band before, good drum mix. "A little time, a little trouble, your better day" Badfinger
  • 0 Votes
    4 Posts
    4 Views
    C
    Thank you guys indirection was the problem
  • Ok, so this one goes out to C...

    The Lounge data-structures oop performance
    14
    0 Votes
    14 Posts
    0 Views
    J
    Nelek wrote: "step back", "walk away" :omg: Nelek wrote: I'll need to ask Santa for a report Good luck, I paid Santa off so he could make his sleigh electric. :suss: Jeremy Falcon
  • Brainless Ad People

    The Lounge c++ com oop help question
    28
    0 Votes
    28 Posts
    0 Views
    D
    haughtonomous wrote: The only useful thing about Marketing is it keeps useless people off the streets. I'd rather they left them on the streets to starve to death. Any concomitant increase in crime can (and should) be dealt with by bringing back the hanging judges. Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
  • Explaining how LLMs work in 7 levels of abstraction

    The Insider News com oop
    2
    0 Votes
    2 Posts
    0 Views
    N
    Another option: Magic[^] Kent Sharkey wrote: My brain's in 'lyrics mode' today. I am more in a sarcastic mood ;) 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.
  • Like Us Or Else!

    The Lounge c++ com collaboration oop question
    24
    0 Votes
    24 Posts
    0 Views
    J
    You can think whatever the hell you want, Richard. I'm not wasting time with you. Jeremy Falcon
  • Inheritance and STL containers

    C / C++ / MFC question c++ graphics docker oop
    4
    0 Votes
    4 Posts
    10 Views
    M
    Let me expand a bit on my previous answer[^]. As I said, you can convert a pointer (or reference) to pointer (or reference) to the base class. This called "upcasting" because you are moving "up" in the inheritance tree. The conversion is "non-destructive", in other words you can later on "downcast" (move from base to derived) as long as you know what type of object was in the first place. An example: struct Unit { Unit (int tag) : dog_tag(tag){}; virtual std::string kind () = 0; int dog_tag; }; struct Soldier : public Unit { Soldier (int tag) : Unit(tag) {}; virtual std::string kind() {return "soldier";}; float running_speed; } struct Sailor : public Unit { Sailor (int tag) : Unit(tag) {}; virtual std::string kind() {return "sailor";} int life_jackets; }; std::vector actors {new Soldier(555), new Sailor(666);}; int main () { Unit* u0 = actors[0]; std::cout << "Actor 0 is a " << u0.kind() " with tag " << u0.dog_tag << std::endl; If you would look with a debugger at u0 you would see a memory layout something like this: u0 0x1234 -------> pointer to vtable of Soldier dog_tag ----------------------------- running_speed ------------------------------ You can see now why the code works: no matter what kind of object you deal with, the first part of the memory layout is the same. Compiler simply ignores whatever is after the dog_tag field. A few more lines of code (please ignore that I didn't initialize other fields): Soldier *s = (Soldier *)u0; std::cout << "Running speed " << s->running_speed << std::endl; s has exactly the same value as u0 but compiler considers it a pointer to a Soldier object so it uses the value from the running_speed field. I could have written: Sailor *ss = (Sailor*)u0; std::cout << "Sailor has " << ss->life_jackets << " life jackets"; And compiler wouldn't have cared at all. It would have accessed the memory at lif
  • 0 Votes
    2 Posts
    0 Views
    Greg UtasG
    Spaghetti underlies speedy development, and abstraction can make it hard to tell how a system works unless it has a function tracer. Robust Services Core | Software Techniques for Lemmings | Articles The fox knows many things, but the hedgehog knows one big thing.
  • Inheritance and arrays

    C / C++ / MFC c++ docker data-structures oop help
    8
    0 Votes
    8 Posts
    13 Views
    L
    Thank you for your comment.
  • A reddit chuckle

    The Lounge c++ com oop question
    3
    0 Votes
    3 Posts
    0 Views
    D
    Not according to Bezos... :laugh: :laugh: :laugh: Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
  • Techno-melon!

    The Lounge c++ com oop question
    10
    0 Votes
    10 Posts
    0 Views
    T
    charlieg wrote: no no no - that was not my point! :) I am not going to watch a video named Techno Melon. Something is just wrong with that. :laugh: <--- see? :-D So watch the video referenced from the post you were replying to :-) Religious freedom is the freedom to say that two plus two make five.
  • Today I Learned...

    The Lounge c++ com oop question
    6
    0 Votes
    6 Posts
    0 Views
    N
    The crap of getting older is that once you start thinking you know everything, you start forgetting it. 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.
  • 0 Votes
    3 Posts
    0 Views
    D
    Oops! Sorry! Fixed, thanks! Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • First good belly laugh in a while

    The Lounge c++ com oop question
    7
    0 Votes
    7 Posts
    0 Views
    S
    Thanks for my morning smile :)
  • 0 Votes
    7 Posts
    0 Views
    D
    abmv wrote: 6,49,000 Sq-Foot There'll be some artificially intelligent in there! Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver