18

after 20 years of programming i finally understand objects, classes and methods. what a waste i am!

Comments
  • 8
    Good! You're now ready to have a look at functional programming 😇
  • 6
    Look at the bright side, 20 years and you did not give up!
    *feeling optimistic today*
  • 2
    @irene i don't know, it just made 'click' somehow. suddenly everything makes sense and implementing and calling methods makes the code so much more readable.
    i just did a simple javascript cookie handler with set, get and unset methods and am ridiculously happy about it. nothing special in general for sure, but for me it is.
  • 5
    It made sense to me when someone showed me classes in production code. The lights came on.

    Before that it was stuff like Car classes with Color properties and StartEngine methods. I could follow it all, but it wasn't apparent how it related to anything I would do.

    Looking back the production classes I saw probably weren't that great. But I needed something to get me out of the fog created by the Car/Animal/Employee examples.
  • 0
    @irene at least this seems quite easy. same for python. calling methods in php is less readable but still ok. this said i reached the limit of my languages... is the concept of objects different in other languages? i don't know that.
  • 3
    Now you could write a book how to grasp OOP in less than 20 years
  • 0
    In a classless language, that's kinda ironic! 😁
  • 1
    my friend and i always wondered what it all was about and never got the concept when we began. everything could be done with functions as well. i still have an idea how our old projects would look like with recent knowledge.
  • 1
    I googled "what is a class .NET." (don't know why I added the .NET part. Habit.)

    Examples used in all of the first results returned:
    Employee
    Employee
    Geeks(?!)
    Dog
    Car
    Car
    MyClass
    BoxTester (?!?!)
    Person
    Student

    Examples are difficult, especially if you're trying to introduce someone to a completely new concept. Even a "real" class would likely be confusing.

    But something about these just makes it worse. Barking dogs, student ages, Toyotas that inherit from cars - it just creates a weird, confused concept of what someone would do with a class.

    I wonder if there's even a good answer. You have to learn the concept, the mechanics of how they work, what they're for, and how to put the right stuff in one, and any subset of that will be frustrating and difficult without all the rest.

    I suppose that's a tiny snapshot of why getting started is difficult.
Add Comment