Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. What's python's claim to fame?

What's python's claim to fame?

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
csharppythonquestion
8 Posts 4 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MikeMarq
    wrote on last edited by
    #1

    I notice its popular for some scientific and ai programming which perks my interest but I've never tried it and wikipedia and other sites are kind of vague about what it can do. So what can python do or do better than a language like vb.net or c#?

    P M 2 Replies Last reply
    0
    • M MikeMarq

      I notice its popular for some scientific and ai programming which perks my interest but I've never tried it and wikipedia and other sites are kind of vague about what it can do. So what can python do or do better than a language like vb.net or c#?

      P Offline
      P Offline
      Paul Coldrey
      wrote on last edited by
      #2

      There are many great things about python, a few key points are: 1. well implemented internal data structures 2. great brevity of code - constructs like list comprehensions allow very concise and easy to read code 3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want) 4. it's interpreted and yet it is really fast 5. simple integration with C. If you agree with the idea that the cost of development is directly linked to the number of lines of code (which there are a lot of studies to support) then Python is a winner. I would generally expect to be able to write a Python app in about 20% of the lines required for C#. Python was designed as a teaching language and so it is very "pure" and orthogonal (ie no shortcuts to enhance performance). This makes it easy to learn and write and yet it is suprisingly fast when executing. For tight-loop, time critical sections it is easy to implement function in C that can be mapped in Python. Some people prefer Ruby (which is sort-of an evolution of Python).... but especially in the case of Ruby-on-rails the performance tends to be very limiting.

      Paul Coldrey http://www.lumient.com.au/

      M M 2 Replies Last reply
      0
      • P Paul Coldrey

        There are many great things about python, a few key points are: 1. well implemented internal data structures 2. great brevity of code - constructs like list comprehensions allow very concise and easy to read code 3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want) 4. it's interpreted and yet it is really fast 5. simple integration with C. If you agree with the idea that the cost of development is directly linked to the number of lines of code (which there are a lot of studies to support) then Python is a winner. I would generally expect to be able to write a Python app in about 20% of the lines required for C#. Python was designed as a teaching language and so it is very "pure" and orthogonal (ie no shortcuts to enhance performance). This makes it easy to learn and write and yet it is suprisingly fast when executing. For tight-loop, time critical sections it is easy to implement function in C that can be mapped in Python. Some people prefer Ruby (which is sort-of an evolution of Python).... but especially in the case of Ruby-on-rails the performance tends to be very limiting.

        Paul Coldrey http://www.lumient.com.au/

        M Offline
        M Offline
        MikeMarq
        wrote on last edited by
        #3

        Thanks for your reply, I'll have to look into it. I'm not sure what you mean by statement 3 though.

        Paul Coldrey wrote:

        3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want)

        thanks, Mike

        P 1 Reply Last reply
        0
        • M MikeMarq

          Thanks for your reply, I'll have to look into it. I'm not sure what you mean by statement 3 though.

          Paul Coldrey wrote:

          3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want)

          thanks, Mike

          P Offline
          P Offline
          Paul Coldrey
          wrote on last edited by
          #4

          Lots of languages have restrictions on certain types that stop you treating them as genuine objects. For example C# won't let you inherit an int or override any of its methods. The reason they do this is for speed because it means that for these "special" types they don't need to do any virtual function lookups. In Python everything is a "real" object. Hence when you say 1+1 Python goes off and does a virtual function lookup for the (int) + (int) function,... and you can override this function if you are insane. The clever thing is that because Guido knew this could be a performance issue he optimised the VF lookup really well and this is part of the reason why Python is so much faster than you would expect. All the VF lookups (And other object oriented overheads) are outrageously fast and they more than offset the extra calls that are required to keep the language clean. Obviously making 1+1 implement 1-1 is not a good idea,... however, suppose you want to count how many additions are happening in a given piece of code as an optimisation metric,.. in Python you can override '+' and add some code to count the number of times it is called. Sounds like a small thing,... but you would be surprised how many optimisation-based limitations there are in C# and some of them get really annoying when you are trying to write pretty mundane code.

          Paul Coldrey http://www.lumient.com.au/

          1 Reply Last reply
          0
          • P Paul Coldrey

            There are many great things about python, a few key points are: 1. well implemented internal data structures 2. great brevity of code - constructs like list comprehensions allow very concise and easy to read code 3. full object-orientation (you can make the '+' operand for integers implement '-' if you really want) 4. it's interpreted and yet it is really fast 5. simple integration with C. If you agree with the idea that the cost of development is directly linked to the number of lines of code (which there are a lot of studies to support) then Python is a winner. I would generally expect to be able to write a Python app in about 20% of the lines required for C#. Python was designed as a teaching language and so it is very "pure" and orthogonal (ie no shortcuts to enhance performance). This makes it easy to learn and write and yet it is suprisingly fast when executing. For tight-loop, time critical sections it is easy to implement function in C that can be mapped in Python. Some people prefer Ruby (which is sort-of an evolution of Python).... but especially in the case of Ruby-on-rails the performance tends to be very limiting.

            Paul Coldrey http://www.lumient.com.au/

            M Offline
            M Offline
            MikeBeard
            wrote on last edited by
            #5

            I agree. I would add that it has a LARGE library to chose from, so for many things, you don't need to write new components/libraries, but just find the one that fits. Also, from my point of view (C++ programmer) Python is just fun to code in. Not sure why, but have noted others say the same thing. -Mike

            1 Reply Last reply
            0
            • M MikeMarq

              I notice its popular for some scientific and ai programming which perks my interest but I've never tried it and wikipedia and other sites are kind of vague about what it can do. So what can python do or do better than a language like vb.net or c#?

              M Offline
              M Offline
              MikeBeard
              wrote on last edited by
              #6

              Some cool apps are written in Python -- Mozy backup, lots of the Google apps, Eve (if I remember right -- MMORPG space multiplayer game) and others. Lots of neat libraries and such. Fun to program in. As to what it can do better than vb.net or c#, not totally sure, but that would be like asking the same of any language. The answer will depend on what you think and like of any of the languages. Check out Guido van Rossun's (creator of Python) site http://www.blogger.com/profile/12821714508588242516\[[^](http://www.blogger.com/profile/12821714508588242516 "New Window")]">Python blogs "History of Python" and Neopythonic for some interesting insights from him. -Mike

              A 1 Reply Last reply
              0
              • M MikeBeard

                Some cool apps are written in Python -- Mozy backup, lots of the Google apps, Eve (if I remember right -- MMORPG space multiplayer game) and others. Lots of neat libraries and such. Fun to program in. As to what it can do better than vb.net or c#, not totally sure, but that would be like asking the same of any language. The answer will depend on what you think and like of any of the languages. Check out Guido van Rossun's (creator of Python) site http://www.blogger.com/profile/12821714508588242516\[[^](http://www.blogger.com/profile/12821714508588242516 "New Window")]">Python blogs "History of Python" and Neopythonic for some interesting insights from him. -Mike

                A Offline
                A Offline
                Anonymous
                wrote on last edited by
                #7

                Python doesn't have a claim to fame. Unlike the languages you referred to - C#, VB, and many others, Python is a scripting language. I know this site is primarily about Microsoft technologies, but Python isn't from Microsoft! It's very easy to learn, and has a great many uses. Projects than incorporate/written in Python: mod_python (Apache's python module) Sid Meier's Civilization IV Gentoo's Portage package management system Various NASA systems A large percent of Google products and in-house systems Youtube Mercurial (Hg) PyPy and a great many others. Enjoy!

                A 1 Reply Last reply
                0
                • A Anonymous

                  Python doesn't have a claim to fame. Unlike the languages you referred to - C#, VB, and many others, Python is a scripting language. I know this site is primarily about Microsoft technologies, but Python isn't from Microsoft! It's very easy to learn, and has a great many uses. Projects than incorporate/written in Python: mod_python (Apache's python module) Sid Meier's Civilization IV Gentoo's Portage package management system Various NASA systems A large percent of Google products and in-house systems Youtube Mercurial (Hg) PyPy and a great many others. Enjoy!

                  A Offline
                  A Offline
                  Anonymous
                  wrote on last edited by
                  #8

                  Python is NOT 'just a scripting language' - It can be compiled just the same as any java program, you can have it interpreted or whatever you like. It can use c libraries and can even be embedded into c programs. py2exe compiles windows python apps freeze compiles the linux equiv and py2app compiles the mac equiv.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups