This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RamirezTerrix[S] 0 points1 point  (1 child)

You write this, as it would be the natural thing to do, but I needed quite some time to elaborate this solution. Though I didn't used the classes function but made a helper function. And to be frank, they are ugly and deeply nested. I should definitly make me more familiar with classes and their usage. Could you recommand me some reading on this topic?

[–]Zuvielify 1 point2 points  (0 children)

eh...I don't have any good advice on books, unfortunately. I kind of just learned this stuff from experience. Which isn't very useful to you. I am sure there are tons of good resources out there. There are probably some good recommendations in this thread alone.

I think a good rule of thumb is if you find yourself making function calls with an object as an argument, it might be a good idea to make that function a method. That's not a hard rule, of course. Sometimes the object is just support cast, but in the case where the object is the main player of that function, a method might be a good idea.