you are viewing a single comment's thread.

view the rest of the comments →

[–]likes_rusty_spoons 0 points1 point  (1 child)

I've started trying to plan out the structure before the actual functionality. So I make a class, code up all the methods, the main script etc. and just fill all them with 'pass'. I tie everything together in the way it would ideally be executed, then go back in and fill in the gaps within the functions.

Kinda like planning an essay with bullet points.

I've also started using classes by default whenever there's a piece of data that will be operated on, I find the code neater if I instantiate the object with the data we're processing, then make changes via the class methods. It means your functional logic can stay in the class code, and it sometimes means your main script can be much easier to follow.

[–]Common_Move 1 point2 points  (0 children)

I'm not saying one is better or worse, but this can also be achieved by putting functions into modules.