learning python idioms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • conkerll@gmail.com

    #1

    learning python idioms

    After several years developing in Java, I've begun to switch to Python
    for several of my new projects as I have found the language quite
    interesting. I've read several tutorials and implemented a few sample
    programs and I've found that Python enables one to program in a variety
    of different styles (I'm not sure if this was the original intention or
    not). Thus, I find myself occaisionally slipping into the "Java"
    mindset when writing Python code and I wonder if this is not optimal.
    Python is not Java and there must be more "correct" ways of doing this
    in Python that simply writing Java code with different syntax. Is
    there a good reference on the internet about Python-specific idioms and
    just good Python style in general. Which language constructs are
    efficient and which aren't?

    Thanks in advance,
    Ben

  • vbgunz

    #2
    Re: learning python idioms

    > After several years developing in Java, I've begun to switch to Python[color=blue]
    > for several of my new projects as I have found the language quite
    > interesting. I've read several tutorials and implemented a few sample
    > programs and I've found that Python enables one to program in a variety
    > of different styles (I'm not sure if this was the original intention or
    > not). Thus, I find myself occaisionally slipping into the "Java"
    > mindset when writing Python code and I wonder if this is not optimal.
    > Python is not Java and there must be more "correct" ways of doing this
    > in Python that simply writing Java code with different syntax. Is
    > there a good reference on the internet about Python-specific idioms and
    > just good Python style in general. Which language constructs are
    > efficient and which aren't?[/color]

    I completely agree with this. I wish some people would gather and
    create a site dedicated to efficient Python idioms. This would be truly
    awesome! I hope you get good news on this!

    Blogger is a blog publishing tool from Google for easily sharing your thoughts with the world. Blogger makes it simple to post text, photos and video onto your personal or team blog.


    Comment

    • bayerj

      #3
      Re: learning python idioms

      Hi,

      If you switched from java to python the best point to start is
      http://dirtsimple.org/2004/12/python-is-not-java.html.

      Greets,
      -Justin

      Comment

      • gene tani

        #4
        Re: learning python idioms


        conkerll@gmail. com wrote:[color=blue]
        > After several years developing in Java, I've begun to switch to Python
        > for several of my new projects as I have found the language quite
        > interesting. I've read several tutorials and implemented a few sample
        > programs and I've found that Python enables one to program in a variety
        > of different styles (I'm not sure if this was the original intention or
        > not). Thus, I find myself occaisionally slipping into the "Java"[/color]

        i googled "Python idioms":

        http://www.gungfu.de/facts/wiki/Main/PythonIdioms

        also look at the OReilly Python cookbook and the online repository it's
        based on


        Comment

        • gene tani

          #5
          Re: learning python idioms


          bayerj wrote:[color=blue]
          > Hi,
          >
          > If you switched from java to python the best point to start is
          > http://dirtsimple.org/2004/12/python-is-not-java.html.
          >
          > Greets,
          > -Justin[/color]

          yup, you could spend weeks reading the Language Wars:

          Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.




          Comment

          • bayerj

            #6
            Re: learning python idioms

            > yup, you could spend weeks reading the Language Wars:

            Actually, that link is not about language wars. It's about making the
            switch from java to python. Nothing more, nothing less.

            Comment

            • James Stroud

              #7
              Re: learning python idioms

              conkerll@gmail. com wrote:[color=blue]
              > After several years developing in Java, I've begun to switch to Python
              > for several of my new projects as I have found the language quite
              > interesting. I've read several tutorials and implemented a few sample
              > programs and I've found that Python enables one to program in a variety
              > of different styles (I'm not sure if this was the original intention or
              > not). Thus, I find myself occaisionally slipping into the "Java"
              > mindset when writing Python code and I wonder if this is not optimal.
              > Python is not Java and there must be more "correct" ways of doing this
              > in Python that simply writing Java code with different syntax. Is
              > there a good reference on the internet about Python-specific idioms and
              > just good Python style in general. Which language constructs are
              > efficient and which aren't?
              >
              > Thanks in advance,
              > Ben
              >[/color]

              As an experiment, I googled 'python idioms' and got a few good hits
              right at the top. I probably should have done this a long time ago.

              James








              --
              James Stroud
              UCLA-DOE Institute for Genomics and Proteomics
              Box 951570
              Los Angeles, CA 90095


              Comment

              Working...