Suggestions for a Java programmer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ray

    #1

    Suggestions for a Java programmer

    Hello there,

    I've been programming in Java for about 8 years now, but lately I've
    been hearing a lot about Python and I'm really interested in learning
    more about it. I've read the tutorial, and some books (core python
    programming is one), but there's one thing that's still missing: how to
    use Python the "Python" way.

    I found learning C# was a breeze for me because the language shares a
    lot of concepts and notions with Java--I can always say: "I do X this
    way in Java, I should be able to do X this way too in C#", and usually
    I'm not far off the mark.

    But Python is different enough that, even though some basic concepts do
    translate easily, idioms and effective usage of it don't come easy. I
    can't help thinking that when I'm writing Python, I'm actually writing
    Java in Python. Not Python in Python.

    Can you point me to "Python for Java Programmers" resources? I found
    one blog, but that only touched the tip of the iceberg, I feel. I know
    that as I use Python more and read more books and read how experienced
    Python programmers code, eventually I'll find it out. But I'd like to
    expedite that process if possible. What are your suggestions?

    Thank you!
    Ray

  • Christos TZOTZIOY Georgiou

    #2
    Re: Suggestions for a Java programmer

    On 24 Mar 2005 00:22:09 -0800, rumours say that "Ray"
    <ray_usenet@yah oo.com> might have written:
    [color=blue]
    >Can you point me to "Python for Java Programmers" resources? I found
    >one blog, but that only touched the tip of the iceberg, I feel. I know
    >that as I use Python more and read more books and read how experienced
    >Python programmers code, eventually I'll find it out. But I'd like to
    >expedite that process if possible. What are your suggestions?[/color]

    Searching google for "python for java programmers" (without the quotes)
    produces:

    Python for Java programmers - Irmen's Python wiki
    Python & Java: Side by Side Comparison
    Jython Home Page (which you might like a lot)
    dirtSimple.org: Python Is Not Java (some useful pointers)

    among others. You didn't specify which blog you found, so HTH.
    --
    TZOTZIOY, I speak England very best.
    "Be strict when sending and tolerant when receiving." (from RFC1958)
    I really should keep that in mind when talking with people, actually...

    Comment

    • bruno modulix

      #3
      Re: Suggestions for a Java programmer

      Ray wrote:[color=blue]
      > Hello there,
      >
      > I've been programming in Java for about 8 years now, but lately I've
      > been hearing a lot about Python and I'm really interested in learning
      > more about it. I've read the tutorial, and some books (core python
      > programming is one), but there's one thing that's still missing: how to
      > use Python the "Python" way.
      >
      > I found learning C# was a breeze for me because the language shares a
      > lot of concepts and notions with Java--I can always say: "I do X this
      > way in Java, I should be able to do X this way too in C#", and usually
      > I'm not far off the mark.
      >
      > But Python is different enough that, even though some basic concepts do
      > translate easily, idioms and effective usage of it don't come easy. I
      > can't help thinking that when I'm writing Python, I'm actually writing
      > Java in Python. Not Python in Python.
      >
      > Can you point me to "Python for Java Programmers" resources? I found
      > one blog, but that only touched the tip of the iceberg, I feel. I know
      > that as I use Python more and read more books and read how experienced
      > Python programmers code, eventually I'll find it out. But I'd like to
      > expedite that process if possible. What are your suggestions?[/color]

      These two books should help you to get a grasp of Pythonic idioms:


      Explore the power of Python in the 2026: see our free tutorials and obtain the "Dive into Python" book by Mark Pilgrim in PDF and Kindle version.




      --
      bruno desthuilliers
      python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
      p in 'onurb@xiludom. gro'.split('@')])"

      Comment

      • Ville Vainio

        #4
        Re: Suggestions for a Java programmer

        >>>>> "bruno" == bruno modulix <onurb@xiludom. gro> writes:

        bruno> These two books should help you to get a grasp of Pythonic idioms:

        ....

        Regarding a Java programmer moving to Python, a lot of the mindset
        change is about the abundant use of built in data types of Python. So
        a Java programmer, when confronted with a problem, should think "how
        can I solve this using lists, dicts and tuples?" (and perhaps also my
        new favourite, sets). Class-based solution should be chosen only after
        seeing that the problem can't be trivially solved with built-in types.

        --
        Ville Vainio http://tinyurl.com/2prnb

        Comment

        • Ray

          #5
          Re: Suggestions for a Java programmer

          Hi Christos,

          Christos TZOTZIOY Georgiou wrote:[color=blue]
          > On 24 Mar 2005 00:22:09 -0800, rumours say that "Ray"
          > <ray_usenet@yah oo.com> might have written:
          >
          > Searching google for "python for java programmers" (without the[/color]
          quotes)[color=blue]
          > produces:
          >
          > Python for Java programmers - Irmen's Python wiki[/color]

          Yes, I feel that this wiki touches more on how Java compares to Python
          (as opposed to how to *think* in Python). Maybe I should get the Python
          Cookbook to absorb more of the Python way of thinking, you think?
          [color=blue]
          > Python & Java: Side by Side Comparison[/color]

          This also compares Java & Python, the differences of which I am already
          aware of.
          [color=blue]
          > Jython Home Page (which you might like a lot)[/color]

          Thanks, I've used it before, but I feel that I was using it to "write
          Java in Python"
          [color=blue]
          > dirtSimple.org: Python Is Not Java (some useful pointers)[/color]

          This is the one I was referring to. I'm looking for something like this
          (how some common idioms in Java is not the best way to do it in Python,
          and how to do things the Python way).

          Thanks!
          Ray

          Comment

          • Ray

            #6
            Re: Suggestions for a Java programmer


            bruno modulix wrote:[color=blue]
            > These two books should help you to get a grasp of Pythonic idioms:
            >
            > http://www.mindview.net/Books/TIPython[/color]

            Will read this later.
            [color=blue]
            > http://diveintopython.org/[/color]

            I just downloaded this one and am reading it now. Thanks bruno!
            [color=blue]
            >
            >
            >
            > --
            > bruno desthuilliers
            > python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')])[/color]
            for[color=blue]
            > p in 'onurb@xiludom. gro'.split('@')])"[/color]

            Comment

            • Ray

              #7
              Re: Suggestions for a Java programmer


              Ville Vainio wrote:[color=blue]
              > Regarding a Java programmer moving to Python, a lot of the mindset
              > change is about the abundant use of built in data types of Python. So
              > a Java programmer, when confronted with a problem, should think "how
              > can I solve this using lists, dicts and tuples?" (and perhaps also my
              > new favourite, sets). Class-based solution should be chosen only[/color]
              after[color=blue]
              > seeing that the problem can't be trivially solved with built-in[/color]
              types.

              Hmmm, but isn't it the same as a Java programmer who's familiar with
              the Collection Framework? (Which has list, dict (map), and set)?

              Comment

              • Kent Johnson

                #8
                Re: Suggestions for a Java programmer

                Ray wrote:[color=blue]
                > Ville Vainio wrote:
                >[color=green]
                >>Regarding a Java programmer moving to Python, a lot of the mindset
                >>change is about the abundant use of built in data types of Python. So
                >>a Java programmer, when confronted with a problem, should think "how
                >>can I solve this using lists, dicts and tuples?" (and perhaps also my
                >>new favourite, sets). Class-based solution should be chosen only[/color]
                >
                > after
                >[color=green]
                >>seeing that the problem can't be trivially solved with built-in[/color]
                >
                > types.
                >
                > Hmmm, but isn't it the same as a Java programmer who's familiar with
                > the Collection Framework? (Which has list, dict (map), and set)?[/color]

                Python collections are vastly easier to work with. In particular for creating, iterating and nesting
                collections there is really no comparison between Python and Java. As a result, my Python programs
                use collections much more than Java programs.

                To respond to the OP, I recommend the book "Python Cookbook" as a way to learn the Pythonic view. It
                doesn't contrast Python with Java, but it gives many examples of idiomatic Python

                Kent

                Comment

                • Jeremy Bowers

                  #9
                  Re: Suggestions for a Java programmer

                  On Thu, 24 Mar 2005 00:22:09 -0800, Ray wrote:[color=blue]
                  > Can you point me to "Python for Java Programmers" resources? I found one
                  > blog, but that only touched the tip of the iceberg, I feel. I know that as
                  > I use Python more and read more books and read how experienced Python
                  > programmers code, eventually I'll find it out. But I'd like to expedite
                  > that process if possible. What are your suggestions?[/color]

                  Also don't be afraid to post a "this ought to be easier" post here. While
                  it will most like rapidly turn into an unofficial contest for regulars to
                  post the niftiest solution, the first few messages will be helpful, and
                  you'll leave Google fodder for future people with that concern. And
                  besides, the contest might teach you several other things as well.
                  Basically, everybody wins :-)

                  Comment

                  Working...