There should only be one — and preferably only one — obvious way to do it”, says the Zen of Python. Yet there are areas where even seasoned programmers debate what the right or wrong way to do things is. One of these areas is Python classes. Borrowed from Object-Oriented Programming, they’re quite beautiful constructs that you can expand and modify as you code. The big problem is that classes can make your code more complicated than necessary, and make it harder to read and maintain. So when should you use classes, and when should you use standard functions instead?…
This story continues at The Next Web
No comments:
Post a Comment