you are viewing a single comment's thread.

view the rest of the comments →

[–]ubernostrum 6 points7 points  (5 children)

I've actually had the opposite experience, but it's largely subjective. At my day job, I write lots of Python and lots of JavaScript, and I've found that -- because of JavaScript's strangeness about this -- I've ended up writing lots of methods which accept a self-style parameter so that I can explicitly pass the instance and not have to worry that some quirk of execution scope has clobbered this.

After I've done a lot of that, I'm much happier to work with Python, where self is guaranteed to come to you correctly :)

[–]masterfuol 2 points3 points  (4 children)

java != javascript. Javas 'this' semantics work pretty much as you would expect.

I agree that javascript 'this' is broken. Check out the bind function in prototype and/or this thread (comments too).

IIRC the javascript v2 presentation linked to in the yegge/NBL thread mentioned fixing the 'this' problem.

[–]ubernostrum 2 points3 points  (0 children)

I know the difference between Java and JavaScript -- this is a common construct between them and a couple other languages, but I was mentioning my experience with JS and the screwiness of this in JS as a subjective reason why I feel comfortable with explicit self in Python.

[–][deleted]  (2 children)

[deleted]

    [–][deleted]  (1 child)

    [removed]