4 ms·
I've written a fair bit of Python code, but I can't recall the time I last wrote a "class" in Python, and when I did, it was just a simple struct-type object wi
by exDM69 11y ago
I've written a fair bit of Python code, but I can't recall the time I last wrote a "class" in Python, and when I did, it was just a simple struct-type object with no inheritance or anything like that.
Most of the time my "objects" are just tuples, lists and dictionaries, with free functions to manipulate them.
In general, I dislike attaching complex semantics to types because that makes code more difficult to read. When you look at a function call and can't tell where it's leading by just looking at the code, there's an instant loss in productivity. At worst, you have to open the debugger and step through the code. This is particularly annoying when the problem domain requires no such abstractions, but they're in place just to shave a few lines of code.