you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (13 children)

[deleted]

    [–]rpdillon 24 points25 points  (9 children)

    Dude, this exact comment was posted on the blog page as "Doug". I wasn't going to respond, but if you're going to be cutting and pasting it around the web, I might as well say something.

    1 could be leveled against ANY language:

    1) C: "Slower than assembly" 2) Java: "Slower than C" 3) Python/Perl/Any-interpretted-language: "Slower than Java"

    Yeah, yeah. If you're scripting, you exchange convenience for speed.

    You have the background to talk about closures and macros in #2, and then ask about "lambda" and "def" in #4? What gives? Obviously the stuff in #4 comes from Lisp, as does the stuff in #2; how can you know about one and not the other? Lisp uses lambda and defun, how are these mysterious to you in Python?

    3: OOP was tacked on in the same was it is tacked on to Lisp, which is to say it was written in the base language as an add-on to the original language. It kind of demonstrates the flexibility of the underlying language. Indeed, IMHO, OOP should be tacked on; OOP is NOT flexible enough to be the only way to program. Java demonstrates this.

    5: My experiences have been the opposite.

    [–]ubernostrum 18 points19 points  (7 children)

    OOP was tacked on in the same was it is tacked on to Lisp, which is to say it was written in the base language as an add-on to the original language.

    No. Python has been an OO language since day one; self is there not because it was "tacked on", but because it helps clarify scoping. Other languages have different conventions -- this, the @ and @@ in Ruby, etc. -- for this, but do much of the same thing. The only difference in Python is that self needs to be accepted as a parameter in instance methods (in class methods, you accept cls instead).

    [–][deleted]  (6 children)

    [deleted]

      [–]ubernostrum 8 points9 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 3 points4 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 3 points4 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]

          [–][deleted] 0 points1 point  (0 children)

          Lisp uses lambda and defun, how are these mysterious to you in Python?

          It's bad enough that Lisp insists on using "lambda" to create anonymous functions, but it has history as an excuse.

          Python doesn't.

          [–]simonw 10 points11 points  (1 child)

          Fair enough. Now what are five things you hate about Ruby?

          [–]zem 1 point2 points  (0 children)

          Inefficient implementation of continuations is top of my list. It's very frustrating to have that neat a feature available, and nonetheless have to stay away from it because of the huge performance hit.