• Gutek8134@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    9 months ago

    My Java classes at uni:

    Here’s a piece of code that does nothing. Make it do nothing, but in compliance with this design pattern.

    When I say it did nothing, I mean it had literally empty function bodies.

    • boletus@sh.itjust.works
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      9 months ago

      Yeah that’s object oriented programming and interfaces. It’s shit to teach people without a practical example but it’s a completely passable way to do OOP in industry, you start by writing interfaces to structure your program and fill in the implementation later.

      Now, is it a good practice? Probably not, imo software design is impossible to get right without iteration, but people still use this method… good to understand why it sucks

    • e8d79@discuss.tchncs.de
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      So what? You also learn math with exercises that ‘do nothing’. If it bothers you so much add some print statements to the function bodies.

      • Gutek8134@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        9 months ago

        I actually did do that. My point was to present a situation where you basically do nothing in higher education, which is not to say you don’t do/learn anything at all.