Skip to content

Add Some OOP-related Contents to the List #50

Open

Description

@lemorage

That's really a good tutorial to start with. After learning some of the basics of Python, however, classes seem to be a quite sophisticated topic. Do you think it would be better to add more conceptual stuff built on classes, like inheritance or polymorphism, etc?

Activity

  1. Akuli commented on Apr 1, 2024

    @Akuli
    Owner

    We could add more OOP stuff, but before doing that, we should explain when classes are used. Currently the tutorial does a good job explaining how classes work, but not so much when to use them. IMO you should use:

    • a plain old class when you end up with many functions that all access the same data
    • a dataclass when you just want to group together related data (similar to struct in other languages)
    • fancy OOP things (inheritance etc) only in some rare cases.

    Many people overuse fancy OOP things, and are too arfaid to break OOP's "rules" when it makes sense. Most of the time it's best to use a plain old simple class. That said, sometimes inheritance is the right tool for the job, and programmers should know it.

  2. lemorage commented on Apr 2, 2024

    @lemorage
    Author

    Yep, yep, really class is a quite complicated topic for me compared to those basic things in Python, and sometimes I just can't find a practical way to apply the OOP concepts to my case, and I can only handle a simple old class which seems pretty lame. We really need to make a good structure of these concepts and explain the possible use cases.

  3. gregorybosques20-rgb commented on Oct 2, 2026

    @gregorybosques20-rgb

    Me stnbt4bne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions