• Lucid Dreaming - Dream Views




    View Poll Results: Favourite Language(s)?

    Voters
    35. You may not vote on this poll
    • ADDA

      0 0%
    • Fortran

      1 2.86%
    • BASIC and all derivatives (VB, QB...)

      11 31.43%
    • C

      10 28.57%
    • C# and all derivatives (Cocoa, Carbon...)

      3 8.57%
    • C++

      11 31.43%
    • Java

      3 8.57%
    • Pascal

      1 2.86%
    • Assembly (MIPS, Intel, PPC...)

      3 8.57%
    • HTML and all derivatives (XML, XHTML...)

      15 42.86%
    Multiple Choice Poll.
    Results 1 to 25 of 56

    Hybrid View

    1. #1
      Member Identity X's Avatar
      Join Date
      Mar 2004
      Gender
      Posts
      1,529
      Likes
      7
      Quote Originally Posted by dsr View Post
      What's wrong with object.method() being a synonym of Class.function(object)?
      I don't like it, because it turns encapsulation on its head. Encapsulated methods become special-case static methods instead of just encapsulated methods. It doesn't make sense. What's wrong with "encapsulated except where static"?

      Also, since Python is interpreted, everything needs to be written "in-order"... I'm used to sticking anything everywhere. I like writing the main functions of a class before the auxiliary ones, for instance.

    2. #2
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      Quote Originally Posted by Identity X View Post
      I don't like it, because it turns encapsulation on its head. Encapsulated methods become special-case static methods instead of just encapsulated methods. It doesn't make sense. What's wrong with "encapsulated except where static"?
      Python's double underscore name mangling is enough in the way of encapsulation for me. Unless I am misunderstanding you, since the programmers still call methods in Python by the usual object.method() syntax, the only oddity with which one could fine fault is the explicit "self" parameter. See my last post for more on this.

      Quote Originally Posted by Identity X View Post
      Also, since Python is interpreted, everything needs to be written "in-order"... I'm used to sticking anything everywhere. I like writing the main functions of a class before the auxiliary ones, for instance.
      Actually, the very opposite is true. Unlike some static-typed languages that require either "in-order" definitions or prototypes (e.g. C), Python allows you to define functions and methods in whatever order makes the most sense to you.

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •