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. The Lounge
  3. Why Python?

Why Python?

Scheduled Pinned Locked Moved The Lounge
questionlearningcsharppythonphp
66 Posts 43 Posters 2 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.
  • J JimmyRopes

    mikepwilson wrote:

    Frankly I'd be using it now [Python] if my code base wasn't already in perl.

    That explains a lot. :~ Before you go off on me I have coded in perl because I am a code whore and will code in any language you are willing to pay me to code in, but it is not my first choice of language.

    Once you lose your pride the rest is easy.
    The report of my death was an exaggeration - Mark Twain Simply Elegant Designs JimmyRopes Designs
    I'm on-line therefore I am. JimmyRopes

    M Offline
    M Offline
    mikepwilson
    wrote on last edited by
    #36

    My real first language of choice is C++. But for just about everything I do (multi-platform ETL and light servers) a true scripting language is absolutely the right choice. There's so little excuse to use C++ nowadays. Makes me sad. So that pretty much means perl or python. Given that I had 15 years of perl under my belt and 2 years of python, that decided that. I won't involve myself in microsoft's toolchain unless I'm writing a gui.

    W 1 Reply Last reply
    0
    • L Lost User

      Why Phyton? Hisotry; 20 years ago the only programming languages at school would be the ones that'd be non-microsoft and free. It was said uni doesn't want a vendor-lock in. Hence, they schooled people in Turbo Pascal (real world used Delphi, but that ain't free) and Java (in the VB6-days).

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #37

      Eddy Vluggen wrote:

      20 years ago ... non-microsoft ... doesn't want a vendor-lock in.

      Well, it was a little more than twenty years ago, but most of my college classes (at three different colleges) used VAX/VMS. I did have some classes in Turbo Pascal and Turbo C, though. Microsoft was (and is) merely an annoying upstart. :-D

      You'll never get very far if all you do is follow instructions.

      1 Reply Last reply
      0
      • M mikepwilson

        My real first language of choice is C++. But for just about everything I do (multi-platform ETL and light servers) a true scripting language is absolutely the right choice. There's so little excuse to use C++ nowadays. Makes me sad. So that pretty much means perl or python. Given that I had 15 years of perl under my belt and 2 years of python, that decided that. I won't involve myself in microsoft's toolchain unless I'm writing a gui.

        W Offline
        W Offline
        W Balboos GHB
        wrote on last edited by
        #38

        mikepwilson wrote:

        There's so little excuse to use C++ nowadays

        Actually, when teaching of of the C??'s, I think C++ is a better choice than C#. Granted, C# will be easier to learn. But, at least if you're a professional, you should know what you're really doing. Eg.

        This.that.somewherelse; // C#
        class.value;

        vs

        This::that::somewherelse; // C++
        class.value;
        class->value;

        Also methods various other similar things. You're not distinguishing a name space from the various other separation options. Fewer mistakes but less understanding in what the meaning is of what you're doing. When the pedal hits the metal. An opinion.

        "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

        "As far as we know, our computer has never had an undetected error." - Weisert

        "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

        1 Reply Last reply
        0
        • M mikepwilson

          Python is really well structured, especially for a beginner. It's forgiving, multi platform and pretty powerful. I know of a major bank that uses python to do their risk analytics, after doing rather a lot of technology performance comparisons. PHP is a godawful mess, and C# is tightly platform specific. It's a really nice language. Sure, people whine about the whitespace/tab thing. But once you get over it (it takes about 2 hours), it yields a much cleaner block of code. Frankly I'd be using it now if my code base wasn't already in perl. I'd say give it a shot. It'll almost certainly surprise you.

          F Offline
          F Offline
          Frank R Haugen
          wrote on last edited by
          #39

          mikepwilson wrote:

          PHP is a godawful mess, and C# is tightly platform specific.

          Yes, PHP is a mess, but I like it, (I had to learn it, and I found it fantastic after a while), though nowadays I believe a "from scratch" re-writing of PHP in it's entirety might be in order. C# is no longer Windows exclusive, due to Mono, and if I understand the news coming from Microsoft, C# will get a "native" compiler, making it much more flexible. I have had a look at it, just to help my friend with some of the concepts, but I don't see the attraction. I feel this joke I heard:

          Two programmers are standing at a bar talking shop, when a teen swagers over, and join the conversation. He asks the two older programmers what languages they are using. One of the guys answers: "I do OS development, mostly in C++". The other Guy answers: "I mostly do enterprise applications development in C#", The kid then says: "Coool, I myself program in Py...". In the Police report, the kid fell 14 times against the two programmers' fists.

          -Sums up my attitude towards Python. But hey, arguing over programming languages, (and IDE's, text editors, code formatting, etc,), is sometimes like arguing politics :P -Frank

          1 Reply Last reply
          0
          • F Frank R Haugen

            A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

            S Offline
            S Offline
            SkysTheLimit
            wrote on last edited by
            #40

            When I was in South Africa I taught a first year university course called Fundamental Algorithmic Concepts which also included some basic programming skills. It was a school-side decision that Python was considered to be the best first language and so that's what I had to use. (We used C on Unix platforms when I took the course). I put a lot of thought into that question because it seemed to me a dumbing down of the course content. Don't get me wrong, Python is a powerful language that is not overly platform dependent and it allows feature-rich programs to be developed quickly. The problem that I have with it is that it masks a lot of the internal workings of programming languages and compilers. Syntactically, once a person knows Python, it is fairly easy to convert a Python program to C but end up with inefficient or even dangerous code as a result. I guess Python allows the instructor to abstract out just the programming aspects of the content without having to pay attention to the architecture/memory aspects of the system(s) that program is going to run on. But I think that ultimately, if your friend wants to transition to a job beyond merely coding to a spec, he would need to get familiar with some C-like language.

            1 Reply Last reply
            0
            • F Frank R Haugen

              A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

              J Offline
              J Offline
              jesarg
              wrote on last edited by
              #41

              Python is considered a great beginner programming language. People learn basic concepts in Python and then move to other languages for more advanced concepts. Everyone learns programming in little bits at a time, and Python makes the basic, early bits easy to digest.

              1 Reply Last reply
              0
              • F Frank R Haugen

                A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

                V Offline
                V Offline
                V 0
                wrote on last edited by
                #42

                Python is replacing IDL more and more in the scientific world. I know some Python and although it can be compiled I do see it more as a scripting language. It´s pretty good, well documented and quite powerful, though some getting used too. It has many libraries and apparently can plugin C++ code pretty well. (never tried it) I´m happy they learn Python instead of VBScript or something similar :p

                V.
                (MQOTD rules and previous solutions)

                F 1 Reply Last reply
                0
                • V V 0

                  Python is replacing IDL more and more in the scientific world. I know some Python and although it can be compiled I do see it more as a scripting language. It´s pretty good, well documented and quite powerful, though some getting used too. It has many libraries and apparently can plugin C++ code pretty well. (never tried it) I´m happy they learn Python instead of VBScript or something similar :p

                  V.
                  (MQOTD rules and previous solutions)

                  F Offline
                  F Offline
                  Frank R Haugen
                  wrote on last edited by
                  #43

                  Do VbScript even exist anymore? I always saw it as the "slightly more retarded" cousin of JavaScript :P

                  1 Reply Last reply
                  0
                  • F Frank R Haugen

                    A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #44

                    Frank Reidar Haugen wrote:

                    Why Python?

                    Teacher probably likes it.

                    Frank Reidar Haugen wrote:

                    but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable

                    When I went to university I was taught, at a very basic level, several languages. If this is a university why are they not doing that? If it is some technical school where the intent is solely to get someone working then a fixed focus single language might be better.

                    Frank Reidar Haugen wrote:

                    The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages?

                    Definitely. C is procedural Java/C#/C++ are OO SQL itself is different than others and extensions to that are procedural (but attempting on procedural concepts is a big mistake.)

                    1 Reply Last reply
                    0
                    • F Frank R Haugen

                      A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #45

                      Frank Reidar Haugen wrote:

                      But am I wrong?

                      It doesn't matter what you think, only that your friend use the tools/technologies offered by the instructor. Even if you are 100% right, that would not get him a passing grade. When he gets out into the real world, then he can use what he wants (per your suggestions).

                      "One man's wage rise is another man's price increase." - Harold Wilson

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                      1 Reply Last reply
                      0
                      • M mikepwilson

                        yeah I'm not sure I'd trust mono in a production environment. "Maybe it's fine"

                        L Offline
                        L Offline
                        LloydA111
                        wrote on last edited by
                        #46

                        I read a comment from someone who works at a company that has C# running on Mono that runs on Fortune 500 comapny servers without issue.

                               .-.
                              |o,o|
                           ,| \_\\=/\_      .-""-.
                           ||/\_/\_\\\_\\    /\[\] \_ \_\\
                           |\_/|(\_)|\\\\  \_|\_o\_LII|\_
                              \\.\_./// / | ==== | \\
                              |\\\_/|"\` |\_| ==== |\_|
                              |\_|\_|    ||" ||  ||
                              |-|-|    ||LI  o ||
                              |\_|\_|    ||'----'||
                             /\_/ \\\_\\  /\_\_|    |\_\_\\
                        
                        1 Reply Last reply
                        0
                        • M Mike Hankey

                          Frank Reidar Haugen wrote:

                          Why Python?

                          Because Rattlesnake just won't do? :)

                          If first you don't succeed, hide all evidence you ever tried!

                          R Offline
                          R Offline
                          Roger Wright
                          wrote on last edited by
                          #47

                          And ASP was already taken...

                          Will Rogers never met me.

                          A 1 Reply Last reply
                          0
                          • M mikepwilson

                            yeah I'm not sure I'd trust mono in a production environment. "Maybe it's fine"

                            F Offline
                            F Offline
                            Florian Rappl
                            wrote on last edited by
                            #48

                            Mono is definitely fine.

                            T 1 Reply Last reply
                            0
                            • F Frank R Haugen

                              A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

                              I Offline
                              I Offline
                              irneb
                              wrote on last edited by
                              #49

                              Python isn't bad, especially compared to C-like languages like C#/Java. You get (out the box) at least the same libraries as you do for DotNet/JVM, and then some (as Python's own built-in libs are enormous compared to most others). The thing which Python does "really" well is the ease of using much more complicated data structures (lists, hashtables, etc. are no more complicated to use than arrays in C). Other stuff are things like a REPL (though not as perfect as Lisp/Hasskell's). Really clean code - it's sometimes referred to as an exact 1:1 translation of pseudo code. It provides some functional paradigms, but not a full fledged FP language. No strict OO - i.e. a function need not be part-n-parcel of a class. Much less code to write than C#/Java to get the same thing. OO concepts in it's imports statement, e.g. you can import an entire "package" normally, then refer to it's internals using the OO-dot-notation, or using the * wildcard to import the internals as if loaded locally, or import a single internal without the rest of the package. It has a very large community, thus mentors and examples are not difficult to find. There are some issues with Python: Dynamic typing - though this isn't necessarily a problem. But for someone coming from a C-like language you'd probably miss the explicit typing. The biggest possible issue I can see with this is some error checks are impossible which are possible in a explicitly- (C) or inferred (Haskell/F#) typed language. Though there are alternatives - e.g. PyLint. It's interpreted by default, though some of its implementations do compile. E.g. CPython compiles to pyc files on the fly (these are similar to Java's class files in that they're bytecode to be run through the PVM. Others also add high optimization (e.g. PyPy), compiling to other VM's (e.g Jython for JVM, IronPython for DotNet), and binary compiling comparable to most other languages (e.g. Nuitka). Non-pure closures, it's version of lexical scoping is a bit weird - and therefore pure FP isn't possible. But this you only notice if you're used to a full FP language (like Scheme / F# / Haskell / etc.) - you'd not notice the difference if you come from a procedural language like C. This has been alleviated a bit in Py 3 with its nonlocal keyword though. Python (as is) doesn't do multi-threading, not easily at least. But there is the multiprocess interface, easy to use, but means more RAM for processes than threads. Only single-line lambdas are possible. It's OO method's a bit "strange" in that

                              F 1 Reply Last reply
                              0
                              • OriginalGriffO OriginalGriff

                                Keith Barrow wrote:

                                I often think whether there is space for a programming language specifically for teaching,

                                Problem with that is that no-one will want to learn it - as it has no commercial use. And if it gets picked up as a commercial language, everyone will just belittle it in the same way they do VB (and probably for the same reasons)

                                Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952) Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

                                U Offline
                                U Offline
                                User 7862375
                                wrote on last edited by
                                #50

                                There have been plenty of "teaching" languages in the past BASIC, LOGO, Pascal, Modula 2 to name just 4.

                                1 Reply Last reply
                                0
                                • F Frank R Haugen

                                  A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

                                  J Offline
                                  J Offline
                                  John Clegg
                                  wrote on last edited by
                                  #51

                                  I currently work mostly under Windows in a variety of languages. I prefer C# for getting things done more quickly (and reliably) but often end up having to use Python. You can get off the ground far faster in Python but your maximum altitude, range and reliability are more limited. As an introduction to programming it's OK, especially for students who don't plan on going any further. But I wouldn't use it too much before moving on to something more "structured" for anybody looking at a career in programming.

                                  1 Reply Last reply
                                  0
                                  • J Jorgen Andersson

                                    Odd that, at my old school (where I studied EE, not CS) they taught ML, not because it was popular but rather because it wasn't popular, which meant that the teachers could teach programming instead of a language. The students had lots of opinions about that.

                                    Wrong is evil and must be defeated. - Jeff Ello[^]

                                    S Offline
                                    S Offline
                                    SortaCore
                                    wrote on last edited by
                                    #52

                                    Jörgen Andersson wrote:

                                    the teachers could teach programming instead of a language

                                    They should see the Guide to Being a Programmer.

                                    1 Reply Last reply
                                    0
                                    • F Frank R Haugen

                                      A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

                                      J Offline
                                      J Offline
                                      jibalt
                                      wrote on last edited by
                                      #53

                                      You're ignorant. Leave your poor friend alone.

                                      1 Reply Last reply
                                      0
                                      • F Frank R Haugen

                                        A friend of mine has started his journey to become a programmer. His class is learning Python, and I mus wonder, Why Python? I want him to have a look at C-like languages in-stead, (for when he's finished with his current course), but he is adamant that his teacher must be correct in saying that Python is what the programmers need today, to be hireable. I am a big fan of C# and PHP, and I see little in Python that makes them comparable, (granted I haven't used much time with Python), But I can't see it even begin to compete with the big ones, (The C-like languages). But am I wrong? The real question is really: are there really any big differences between the top 15 or 20 most popular programming languages? -frank

                                        F Offline
                                        F Offline
                                        Fabio Franco
                                        wrote on last edited by
                                        #54

                                        Frank Reidar Haugen wrote:

                                        Python is what the programmers need today

                                        That's very debatable. It depends on where and what he wants to work with. There is no silver bullet. Having said that, I'd urge him to learn C, not because of the style, but of what he can learn with it. Working with pointers and manual memory management can prepare his mind to develop much more efficient code in high level languages. Once you can program in C, you can program in virtually anything else (except lower level assembly and the sorts). It's a great common ground to have.

                                        To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson ---- Our heads are round so our thoughts can change direction - Francis Picabia

                                        1 Reply Last reply
                                        0
                                        • I irneb

                                          Python isn't bad, especially compared to C-like languages like C#/Java. You get (out the box) at least the same libraries as you do for DotNet/JVM, and then some (as Python's own built-in libs are enormous compared to most others). The thing which Python does "really" well is the ease of using much more complicated data structures (lists, hashtables, etc. are no more complicated to use than arrays in C). Other stuff are things like a REPL (though not as perfect as Lisp/Hasskell's). Really clean code - it's sometimes referred to as an exact 1:1 translation of pseudo code. It provides some functional paradigms, but not a full fledged FP language. No strict OO - i.e. a function need not be part-n-parcel of a class. Much less code to write than C#/Java to get the same thing. OO concepts in it's imports statement, e.g. you can import an entire "package" normally, then refer to it's internals using the OO-dot-notation, or using the * wildcard to import the internals as if loaded locally, or import a single internal without the rest of the package. It has a very large community, thus mentors and examples are not difficult to find. There are some issues with Python: Dynamic typing - though this isn't necessarily a problem. But for someone coming from a C-like language you'd probably miss the explicit typing. The biggest possible issue I can see with this is some error checks are impossible which are possible in a explicitly- (C) or inferred (Haskell/F#) typed language. Though there are alternatives - e.g. PyLint. It's interpreted by default, though some of its implementations do compile. E.g. CPython compiles to pyc files on the fly (these are similar to Java's class files in that they're bytecode to be run through the PVM. Others also add high optimization (e.g. PyPy), compiling to other VM's (e.g Jython for JVM, IronPython for DotNet), and binary compiling comparable to most other languages (e.g. Nuitka). Non-pure closures, it's version of lexical scoping is a bit weird - and therefore pure FP isn't possible. But this you only notice if you're used to a full FP language (like Scheme / F# / Haskell / etc.) - you'd not notice the difference if you come from a procedural language like C. This has been alleviated a bit in Py 3 with its nonlocal keyword though. Python (as is) doesn't do multi-threading, not easily at least. But there is the multiprocess interface, easy to use, but means more RAM for processes than threads. Only single-line lambdas are possible. It's OO method's a bit "strange" in that

                                          F Offline
                                          F Offline
                                          Fabio Franco
                                          wrote on last edited by
                                          #55

                                          irneb wrote:

                                          but at some point you need to look deeper into the details also - thus it might be very good to move onto C after Python, and then onto a more "normal" OO like Java/C#. And then to really get into the FP bracket, Scheme/Haskell.

                                          That :thumbsup:

                                          To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson ---- Our heads are round so our thoughts can change direction - Francis Picabia

                                          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