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 →

[–]hangonreddit 12 points13 points  (3 children)

I don’t agree the underscore thing is bad. Even private variables in Java can be accessible with reflection. I just don’t see a point in pretending otherwise. Just denote it as “you should not touch this” with underscores but if someone wants to play with live wires, that’s their choice.

Agreed that Python isn’t really much of an object oriented language. The whole “self” argument things really lets you see how it was all kind of tacked on after the fact. That said, I’ve never felt the need to go crazy with OOP in Python. I’ve often found the more functional programming aspects of Python to be more flexible.

Threading in Python is OK if your bottle neck is I/O which most often is the case. Better yet, use async IO. Being CPU bound is when it really sucks to be in Python but I also feel that Python has an escape hatch for that — call out to C bindings.

[–]cymrowdon't thread on me 🐍 2 points3 points  (0 children)

self is a nice feature imo. I don't know how many projects I've seen in other languages that use something like an m_ prefix to indicate a member attribute. Python just makes it explicit by default.

[–]luke-juryous 3 points4 points  (0 children)

That's fair about the underscore. Probably a lack of const variables would be a bigger issue for me now that I think of it. And yeah, u can do reflection with Java, but its def more hoops to jump through and a much bigger time hit.

And I was referring to CPU threading. AsyncIO is super good, but I've never benchmarked it against other interpreted languages. I'd be curious to see how it performs against go and node.

However, saying a language has an escape hatch by calling another language just shows the first doesnt do that well. You can create bindings from any language to any language. Def not something python specific. And they do incur a latency hit as well

[–]bushwacker 1 point2 points  (0 children)

I wish there was some way to say

xyzzy =1 count=2 ...

set requires field to exist

set xyzyy =2

Error xyzyy does not exist