Classes and its controversy

Good night... First of all, I know this isn't the best place to ask what I'm about to ask, but I can't find a satisfying answer anywhere, and I bet the StackOverflow gurus that are out there can help me...

Basically: "Why do I see a lot of people pledging that we shouldn't use Python classes?". I'm still a 'novice' python programmer and to me classes actually look nice... I feel the answer to this question lies in a comprehension of the language that I yet don't own... Please enlighten me before too many guys down-vote my question :p


[edit] Being as straightforward as I can: Is it, or is it not, good to write python classes and to use OOP in Python?


There are a few ways we can interpret this. I see two.

  1. The idea to not use classes isn't a rejection of OOP in general. It's the acknowledgement it's a tool to be used when appropriate. Because Python isn't strictly object oriented, you can just use a function when a function is appropriate. You might be hearing people reject classes because they don't offer any advantage for the project and result in bloated code. This is the concept behind the Stop Writing Classes talk.

  2. Much to Guido's dismay, Python can be used for functional programming as well. Maybe the people you're talking to are interested in functional programming and avoiding state. Instead they want to focus on data and its transformations.

Need Your Help

How can I copy a record, changing only the id?

sql db2

My table has a large number of columns. I have a command to copy some data - think of it as cloning a product - but as the columns may change in the future, I would like to only select everything f...

Speed of cos() and sin() function in GLSL shaders?

optimization opengl glsl shader jogl

I'm interested in information about the speed of sin() and cos() in Open GL Shader Language.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.