16 ms·
Why We Choose Python
- caioariede 14y agoAnd one of the best features of Python: The community The Python community allied with the good programming habits (aka PEP 8) really does the difference.
- dazzawazza 14y agoI LOVE PEP8. There it is I said it. I love that I can look at Python code I wrote eight years ago and it looks like I wrote it yesterday (apart from the fact I've got better and working with python). Even better I can look at someone else's code and if they've bothered to follow PEP 8 I am straight in, understanding the code and not their formatting. It removed a cognitive load that in C++ just kills me. It's bloody great.
- deleted 14y ago[deleted]
- calvinhp 14y agoI couldn't agree more, we actually posted on that a while back as well. We are huge code standards fans. http://www.sixfeetup.com/blog/why-pep8-for-plone-development http://www.sixfeetup.com/blog/why-pep8-for-plone-development
- mercurial 14y agoI love Python, but it's a rubbish article I regret to have upvoted. > Python is robust This paragraph does not feature a word about robustness. There are mentions of speed and scalability and some sort of benchmark showing a case where Python is faster than Ruby or PHP. Conclusion: "It's also very fast". The rest is less terrible but does not mention any of Python's shortcomings.
- johnsoft 14y agoAre there any widely-used languages that aren't robust? That seems like kind of shallow praise.
- mercurial 14y agoDepends what you call robust. If you mean "strongly typed", PHP and Javascript come to mind immediately.
- johnsoft 14y agoBy robust, I mean the language/compiler has a strong test suite and the runtime is known to work reliably in production settings. I've heard horror stories about Sun's HotSpot JIT crashing frequently, but that was what, 10 or 20 years ago? Now that I think about it, Scala might be a modern example of that, but I haven't kept up with how they might have improved.
- mercurial 14y agoIn this case, yes, real-world languages have a solid runtime/compiler. Though I'm surprised you have issues with Scala, at least the runtime part should be rock solid, given that it runs on a very much battle-tested JVM.
- Genmutant 14y agoPHP has a test suite, but it's released with over hundred tests failing. See here: http://gcov.php.net/viewer.php?version=PHP_5_5 http://gcov.php.net/viewer.php?version=PHP_5_5
- eliben 14y agoPlease don't use the TIOBE index as a measure of language popularity. It's trash. [Disclaimer: I love Python and if anything, it's more popular than TIOBE indicates. This comment expresses an opinion about TIOBE, not Python]
- aviraldg 14y agoBASIC is more popular than JavaScript on it O.O
- mertd 14y agoRatings The ratings are calculated by counting hits of the most popular search engines. The search query that is used is +"<language> programming" I wonder why BASIC is so popular :)
- pyre 14y agoI know. I feel like such a rube when people ask if I have the BASIC programming fundamentals down, and I have to answer, "No." ;-)
- pmelendez 14y agoFunny thing... that has a bias over syntax complexity of the language, easier to pick (and IMO better quality) languages wouldn't require to google about features that often. No wonder why Java is the first.
- deleted 14y ago[deleted]
- pyre 14y agoThey are using "number of searches people initiate," but "number of hits in the search engine." I would think that the number of hits in the search engine wouldn't be a function of how often one is required to Google for an answer.
- 14y ago
- xradionut 14y agoI thought that Google was migrating to more towards complied languages, (C++, Java, Go), and away from Python?
- munki 14y agoLink please?
- rodwyer 14y agoQuick, everyone copy Google.
- MostAwesomeDude 14y agoHaha, no. We absolutely write new Python code daily and it's one of our core languages.
- xradionut 14y agoThanks for the update. I was concerned that Guido leaving Google meant more than just Guido leaving Google.
- heidar 14y agoLast I heard it was: "Python where we can, C++ where we must"
- pyre 14y agoProbably depends on what section of the company you are in. Some probably never use Python, while others may make heavy use of it. I've heard claims ranging from "it depends," to "mostly C++ / Java," to "only Python as a glue language."
- michaelwww 14y agoIt would be strange if this guy had anything negative to say about Python since "Should you need assistance with your Python project, we'll be happy to help through a variety of professional services."
- PasserBy2 14y agoWhy would you need assistance when "Python is easy to learn and use"?
- davidroberts 14y agoI can vouch for 'easy to learn': if you can already program in another language, learning Python is like being reintroduced to an old friend who has grown up quite a bit since you last met him.
- EliRivers 14y agoI found the opposite. For example, I find it extraordinarily frustrating not to be able to know what kind of object something is by looking at the point in code where it is created; something like variable = somefunction(inputParameter) where variable did not exist before leaves me having to look up the documentation of somefunction to know what kind of object it is returning.
- davidroberts 14y agoHopefully, whoever defined somefunction did something like this: def somefunction(inputParameter): ''' inputParameter: List of seven positive integers representing a poker hand Returns: A positive integer used to score that hand relative to all other possible hands, better hands receive higher scores. '''
- EliRivers 14y agoYou know they didn't. These are programmers we're talking about :)
- deleted 14y ago[deleted]
- marcosdumay 14y agoWell, you'll hate it, but even after you discover what is the class of your object, you'll still have no idea what methods it implements, and what attributes it has. In Python any of that can (and do) change. Sometimes that is frustating. I suffered a lot until I understood the Django's forms API. But this feature is worth the cost.
- 14y ago
- robomartin 14y agoOne business metric that is worth considering is the cost of putting together a Python team vs., say, PHP. Here "cost" doesn't mean salaries as much as it means "cost function" or "difficulty score". Get away from Silicon Valley's reality distortion field and I think Python, today, might still have some issues in this regard. I am not talking about finding one developer. I am talking about finding one, scaling to five and then beyond that.
- fvox13 14y agoWell, to be fair, SixFeetUp is based in Fortville, Indiana (a bit far away from the "reality distortion field" you mention). Also, with more and more colleges switching to Python as their Computer Science major's language of choice, finding a team of competent Pythonistas is getting easier. I would think that it helps tremendously to be able to hire remote workers (especially since a town of 4,000 probably won't have more than a couple of people who are Plone experts, at most!)
- SixFeetUp 14y agoHah, Fortville is on the outskirts of Indianapolis, so we have a robust base of developers. Indiana's colleges produce a ton of IT students as well. We do also use remote developers, we are actually looking for a Python developer and a sys admin. Devs can be remote, the sys admin needs to be local. http://www.sixfeetup.com/company/jobs http://www.sixfeetup.com/company/jobs Also some of the big local companies like to use Python including Angie's List.
- robomartin 14y agoI prefer Python for a lot of reasons. The reality of the matter is that, by some accounts, there are over ten times more PHP programmers than Python. This is changing, which is good.
- lifeisstillgood 14y agoI always used to use Python as a metric of the quality of a developer. PHP on the resume - Meh. Python on the resume - now there is someone who cares enough about unusual languages to try one out, likes it and follows through. A strong developer. Of course thats a bit harder now, I would look for a functional language on there these days.
- adamors 14y ago> [Python is] rivaling PHP to become the most popular interpreted language Hahahaha. I love Python and loathe PHP but this is just ridiculous.
- portmanteaufu 14y agoI made it as far as ".... Python is the language of choice for serious developers" before I bailed. I love Python, but let's not make this a True Scotsman fallacy.
- bitwize 14y agoThing is, Python is becoming rapidly the language of choice for scientists, statisticians, and other knowledge workers who only do a bit of development.
- drzaiusapelord 14y agoIts really just filling the vacuum Perl is leaving. I imagine if you had the choice to learn Perl or learn Python, you'd probably go with Python. The syntax and code just look so much more manageable.
- nsmartt 14y agoThat has no relation to the idea that "serious developers" use Python.
- PasserBy2 14y ago...but it will generate flame on HN.
- PasserBy2 14y agoFor writing throw-away code that is. It's more of a scripting language than a development language. Unless you are a 'hawt' start-up in 'cisco'.
- roldenburger 14y agoI have been a PHP developer for more than 10 years. Since a couple of years Python has become my language of choice. I'm addicted to Python, every project I now start is in Python. But I don't see any real valid reasons in the article to convince people. Do I have a valid reason? Probably not, every project has their own reason to use a specific language. One valid reason to choose Python instead of PHP: Encoding. Never had any big problems in Python and a lot in PHP. Oh and multithreading.
- jonascopenhagen 14y ago> Encoding. Never had any big problems in Python and a lot in PHP Encoding is rarely a problem in PHP. Use UTF-8 everywhere, make sure every part of the system uses it (the database server, the database client in PHP, the web pages, etc.). If you're going to work with e.g. Japanese characters, use http://www.php.net/manual/en/mbstring.overload.php http://www.php.net/manual/en/mbstring.overload.php
- roldenburger 14y agoAgree, but sometimes you have to work with systems from other people. The fact that encoding issues can occur, means it will happen someday.
- jonascopenhagen 14y agoWhat kind of encoding issues are we talking about? I fail to see how PHP in itself should be specifically vulnerable to encoding problems.
- saosebastiao 14y agoThe thing that keeps pulling me toward python is the ecosystem. NumPy, SciPy, Pandas, Mapnik, Cython, PyPy, IPython, Jython, Sage, PyQt/PyGTK, PyCuda/PyOpenCL. I rarely have trouble finding a tool that I need. It is frustrating, because Ruby and Java are the standards where I work, and Clojure/Haskell are my favorite new toys. But I refuse to program in Java, and none of the others have ecosystems anywhere near as awesome as Python.
- leephillips 14y agoI agree about the awesome range of libraries for Python. But, in Clojure, doesn't access to the all the JVM libraries make up for this?
- xaa 14y agoNo, because JVM numeric libraries are awful, and, because the Clojure community leans toward things like web development instead of scientific computing, there are seldom Clojure wrappers available for them. Incanter, for example, isn't even maintained anymore. It is a shame, because Clojure is a better language.
- dataoverflow 14y ago> Python is now one of the fastest-growing programing languages I love Python but looking at the long term trends on TIOBE I am not sure I'd agree with the above statement http://www.tiobe.com/content/paperinfo/tpci/images/tpci_trends.png http://www.tiobe.com/content/paperinfo/tpci/images/tpci_tren...
- Aloisius 14y agoI use python because it is functional psuedocode. Before I learned python, my sketches for algorithms on whiteboards looked like python. Also, the community practices for coding style are so strong in Python that I can open up nearly any piece of code on the internet and have no problems reading it no matter how junior or senior the person was who wrote it. This is a big win for maintainability and one of the main reasons why I prefer Python over Ruby or Perl.
- lifeisstillgood 14y agoYou cannot write an article like this if you cannot first write an article on Python's warts http://web.archive.org/web/20070202012909/http://www.amk.ca/python/writing/warts.html http://web.archive.org/web/20070202012909/http://www.amk.ca/... http://www.rittau.org/python/warts http://www.rittau.org/python/warts in fact I would love a warts wiki for frameworks, libraries and more. Python or not. Its important to have these debates out loud.
- solistice 14y agoI just came here to praise python and hate on php, because that seems to be the popular thing to do. But I do like the idea of it being functional pseudocode, because my pseudocode usually starts approximating the syntax of the language, with progressively more erase marks and crossed statements due to getting a bracket wrong, or some other minor problem. Note: Yes, I write source code on paper. Alot.
- jamesseattle 14y agoI once joined a project that had been going on for 5 years with >100K lines of Python. At any given time we had more than 25 programmers. In my two years on the project I never had a problem reading someone else's code - it was great for maintainability. Our project was used by hundreds of engineers on a critical path of a multi-billion dollar project. Anyone who thinks Python doesn't work for serious development doesn't know what they're talking about.
- samuel1604 14y agothis is so 2005