Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
freddo ( freddo@feddit.nu )  to Programmer Humor@programming.devEnglish · 9 months ago

OOP at home:

feddit.nu

message-square
25
link
fedilink
197

OOP at home:

feddit.nu

freddo ( freddo@feddit.nu )  to Programmer Humor@programming.devEnglish · 9 months ago
message-square
25
link
fedilink
  • Valmond ( Valmond@lemmy.dbzer0.com ) 
    link
    fedilink
    arrow-up
    3
    ·
    9 months ago

    That’s wild. What did you use it for?

    • tatterdemalion ( tatterdemalion@programming.dev ) 
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      Some legacy Python code that already used inheritance. I had to extend it, and it was pretty infeasible to refactor the whole thing to not use inheritance. Not sure if I technically regretted that decision, but it was definitely painful, since Python inheritance makes it really hard to follow program control flow.

      • Valmond ( Valmond@lemmy.dbzer0.com ) 
        link
        fedilink
        arrow-up
        1
        ·
        9 months ago

        Non typed inheritance, what could go wrong eh. You can just ‘add’ a function to a class dynamically in python, that is so bad.

        Done any C++ classes & inheritance?

        • tatterdemalion ( tatterdemalion@programming.dev ) 
          link
          fedilink
          arrow-up
          1
          ·
          9 months ago

          It was actually typed. Python had type annotations at the time.

          I only wrote C++ very early in my career so I don’t remember much, but I’m sure I at least tried some inheritance in toy games I would write. All of that code was trash though by my standards today.

          • Valmond ( Valmond@lemmy.dbzer0.com ) 
            link
            fedilink
            arrow-up
            1
            ·
            9 months ago

            Still does, but you don’t have to.

            So you haven’t had much experience with oop?

            • tatterdemalion ( tatterdemalion@programming.dev ) 
              link
              fedilink
              arrow-up
              1
              ·
              9 months ago

              I have used OOP design patterns many times, but that doesn’t mean I use inheritance a lot. I almost always reach for interfaces instead.

              • Valmond ( Valmond@lemmy.dbzer0.com ) 
                link
                fedilink
                arrow-up
                2
                ·
                9 months ago

                Well then I understand why inheritance isn’t your thing, I yet have to see an interface in need of inheritance.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 632 users / day
  • 2.84K users / week
  • 5.18K users / month
  • 8.26K users / 6 months
  • 463 local subscribers
  • 33.9K subscribers
  • 1.62K Posts
  • 26.8K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code