• LavenderDay3544@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    6 hours ago

    I hate that schools basically teach students to over use classes for everything especially by using Java as a teaching language and then they get into the real world or grad school and we have to unteach them those terrible habits.

    I’m so glad a lot of the newer languages (Rust, Go, Zig, C3, V) don’t have classes in them at all.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      19 minutes ago

      Tbh if the average grad school student overused object oriented stuff they would produce vastly better code than the status quo.

  • HStone32@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    8 hours ago

    I’m currently taking the very last CS class my major requires. I can’t wait to leave OOP behind and focus on hardware completely.

  • tyo_ukko@sopuli.xyz
    link
    fedilink
    arrow-up
    9
    arrow-down
    4
    ·
    edit-2
    9 hours ago

    You did the right thing. OOP was invented by people who were worried about their job security, to obstruct others from understanding their code.

        • xigoi@lemmy.sdf.org
          link
          fedilink
          English
          arrow-up
          6
          ·
          edit-2
          5 hours ago
          BallsFactory ballsFactory = new BallsFactory();
          ballsFactory.setSuckable(true);
          Balls balls = ballsFatctory.create();
          
          • whats_all_this_then@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            edit-2
            22 minutes ago

            All of this is okay, but it’s not production ready. This is what real production code looks like:

            SuckableFactory suckableFactory = new SuckableFactory();
            Suckable balls = suckableFactory
                .setShape(SuckableShapes.round)
                .setCount(2)
                .create();
            
            SuctionProvider mouth = SuctionProvider.getInstance();
            
            SuckerFactory suckerFactory = new SuckerFactory();
            Sucker sucker = SuckerFactory.create():
            
            sucker.setSuctionProvider(mouth);
            sucker.setSuckable(balls);
            sucker.setIntensity(SuckerSuctionIntensities.medium);
            sucker.suckSuckable();