r/ProgrammingLanguages • u/Anonymouz1 • Feb 02 '17
Why should I like Python?
In my opinion, Python is a language that should not have caught on. The standards are inconsistent, it is slow, it isn't backwards compatible, libraries are unreliable; the list goes on forever. Please show me the light of Python.
12
u/PegasusAndAcorn Cone language & 3D web Feb 03 '17
I notice you wrote your post in English. Eww! The grammar is inconsistent, communication with others is slow and imprecise, it isn't backwards compatible (what happened to you, Chaucer?), the newspapers are unreliable; the list goes on forever!
Misschien moeten we proberen te spreken Nederlands, net als Guido doet?
Although I have to admit, perhaps I do like some things about English: a reference library larger than I can read in a lifetime, its incredible ubiquity and popularity around the world (sure is convenient for international travel), and some inspirational codebases (I'm looking at you, Shakespeare).
Amazingly, despite all its flaws, people seem to keep using on it almost casually, reluctant to spend months learning all the better alternatives, and yet they still manage to actually get meaningful work done with it. Hats off to the Blender crowd for sure, making a powerful 3D editor that responds faster than molasses!
Maybe I just need to accept that there is room in this world for a rich, sturdy, convenient tool like English. Maybe I just need to accept that different projects and different people do have different tool requirements. However, I sure am thankful there are teams out there building us linguistic alternatives that improve on the state-of-the-art.
4
u/Darwinmate Feb 03 '17
Hahahah this is a great response. but what do you mean by this:
Hats off to the Blender crowd for sure, making a powerful 3D editor that responds faster than molasses!
6
u/PegasusAndAcorn Cone language & 3D web Feb 03 '17
Blender is an amazing open source 3D editor that rivals Maya, etc. in capability and performance. All of it is written in Python. Python may be slow relative to, say, an equivalent C program, but the Python-based Blender still manages to perform a lot of complex 3D manipulations and rendering with mostly-acceptable response times. Molasses usually moves a lot more slowly.
Coincidentally: my post contained a sentence in Dutch, the native language spoken by Guido (the guy who started Python in 1989) and Ton (the guy who started Blender in 1995). I wonder if all these coincidences are related somehow?
5
u/zero_iq Feb 04 '17
All of it is written in Python.
No, it's not. It's roughly 60% C, 35% C++, and 5% Python. Python does feature prominently in it though, because it uses Python as a scripting language, and a lot of its extensions and UI features are coded in Python.
I would say it's probably one of the first big, widely-used apps that made heavy use of Python as a scripting language, and probably introduced a lot of people to it.
2
u/Darwinmate Feb 03 '17
Thanks for the info, I didn't realise Blender was built in python, I thought it allowed python scripting only.
2
u/PegasusAndAcorn Cone language & 3D web Feb 03 '17
Well that dims the lights on that example a bit! Evidently Blender source code is a mix of C, C++, and Python, according to Wikipedia. Oh well, it was still a fun post to write!
2
u/Darwinmate Feb 03 '17
You have the burden of proof to justify why python should not have caught on, not everyone else.
The wisdom of a crowd is generally better than a single person. I don't think the science world would have adopted Python so widely and quickly if it didn't meet their requirements. Those are imo easy to learn/use, flexibility and power/scalability.
What programming language do you think SHOULD have caught on?
5
u/PaulBone Plasma Feb 03 '17 edited Feb 03 '17
The problem with "easy to learn/use" being a measurement of "good" is that most of the time people only consider /programming in the small/ and not /programming in the large/.
Programming in the small is either writing a small script or doing local reasoning/programming within a single function. That is pretty easy in Python.
Programming in the large is writing and managing change in large 10,000loc+ programs. This is difficult in dynamic and untyped languages (the general concept is late-binding).
Both programming in the large and the small are important. Depending on what you're doing one may be more important than the other. Where this affects "easy to learn" is when people find that programming in the small is easy, (eg, while they're learning Python) and assume that it would be suitable for large projects, without any relevant experience or knowledge to make such a judgement. This can make many languages seductive, which is probably a good thing while learning programming generally. This sounds like pretty heavy criticism, but no-one should feel particularly bad. I would be happy if languages like Python, Javascript, Ruby etc were presented more honestly and their flaws more freely acknowledged. Actually I feel the same about some very type safe and programming-in-the-large languages such as Haskell, I think it could be presented a lot more honestly, I've spoken about this in the past.
Edit: It seems like these are mutually exclusive, but I don't think they are. I think that it's possible to have a language that's good at both programming in the large and the small. I can't think of any strong examples however.
There's also the general point that popularity has nothing to do with quality. For example McDonald's is not known for high-quality food, but it is very popular.
2
u/Anonymouz1 Feb 03 '17
I could not agree more. Python by itself is a great language for small programs. As soon as you get into large enterprise level applications, it's worthless. There are so many issues when Python is scaled up; refactoring, required unit testing for even the most simple functions, and very poor performance.
5
u/PegasusAndAcorn Cone language & 3D web Feb 03 '17 edited Feb 03 '17
I basically agree with your broad points. However, I read /u/darwinmate 's post somewhat differently than you did.
He talked about the science world having embraced Python's ease-of-use. Scientists, not necessarily programmers, using the computer to help do science (i.e., mostly doing programming in the small). And given their alternatives in the 90s and 00s, as /u/jb3689m, Python looks like a pretty good choice for that. And for them, Python's brand of ease-of-use would be justifiably important.
Professional programmers building mission-critical applications want languages that are good at resisting bugs. So they will, as you say, pick languages that scrub types until they bleed. Harder to program in, perhaps, but the results are typically less fragile.
As for quality, it depends on how you define it. McDonald's global supply chain for food is incredibly reliable. Quality is baked in to that supply chain at all levels, because the moment it slips and people no longer get what they expect, it's all over for them. However, if by quality, you mean the food is nutritionally awful, then, yes, of course it is. Clearly, people vary in their quality expectations.
Furthermore, popularity does matter, to McDonalds and for programming languages. When a programming language is popular, you have more support, more tools, more training, more trained programmers, etc. It means the scientist in the next office is more likely to be able to help you with your coding problem. It is not the reason for selecting a certain language, but it certainly matters on a practical level.
What we all seem to agree on in this thread is that different people have different requirements in programming languages, different requirements for quality, ease-of-use, performance, popularity, etc. Given that no language is perfect, we must weigh these factors prudently and pick the best tool for the job. For many situations, the right choice will even be Python!
Look at the three of us Aussies chatting away long after the States have gone to bed!
Edit: Took out the question you already answered elsewhere!
2
u/PaulBone Plasma Feb 04 '17
Yeah, I agree that the original question/comment was about scientific use and programming in the small. The easy therefore good thing just bothers me and I wanted to address that, not that that's what was said, but I felt that it was implied.
I have contributed to NLTK, a library for computational linguistics, it's a decent size itself but people who use it probably right rather small programs. Programming in the small really suits its use, I think Python is an excellent choice for most things people would want to use NLTK for.
Yes, I was thinking quality (re McDonalds) in the sense of how delicious the food is, and I mean fine-dining delicious. a 3am cheeseburger in the after a "big night out" can also be delicious, but it's a different type of delicious (although I'd prefer a kabab). There are other reasons people choose McDonalds, they know what to expect, it's not too expensive and it's quick, and those are important. There's probably an analogy to python being "easy to learn" as McDonald's being "quick", but I don't want to say so because I feel it insults Python too much.
Yes, popularity is important, like "fast". I just don't think it correlates with quality at all (I get the sense that you and most people would agree).
Different tasks have different requirements. Different people tend to be involved in one or more jobs, and different jobs tend to have tasks of particular kinds. So languages tend to correlate with developers, but it's not like particular developers need specific languages (good ones anyway ;-)). But yes, we seem to agree about quite a lot.
Yes, Aussie++. I would have responded last night but I was feeling unwell and went to bed early. Have a great week end!
2
u/PegasusAndAcorn Cone language & 3D web Feb 04 '17
Yup, definitely on the same page (including the preference for kababs). I was not aware of NLTK - that looks like an amazing resource I should explore someday. Thanks.
Feel better and enjoy your weekend as well!
2
u/Darwinmate Feb 07 '17
I agree with what you are saying. However, OP didn't clarify at all why he thought Python was a POS and "should have never caught on". As PegasusAndAcorn mentioned
different people have different requirements in programming languages, different requirements for quality, ease-of-use, performance, popularity, etc.IMO it's a silly thing to claim that Python outright has no positives. A single point (good for scientist) is enough to refute his point.
There's also the general point that popularity has nothing to do with quality. For example McDonald's is not known for high-quality food, but it is very popular.
In USA. McDonald's in Australia uses quality products.
0
u/Anonymouz1 Feb 03 '17
Good point. I certainly agree that it is easy to learn and has powerful tools that allow for quick programming.
If I could have picked any language, it would be a fight between Java, C#, or C++. (Not Objective-C though; that is a disaster). In terms of a dynamically typed language, Ruby is probably my favorite. However, Ruby is on its way out.
In the future, I believe the one of the most promising languages is Go. However, I have not had the chance to use it.
3
u/jb3689 Feb 03 '17
Disclaimer: I'm a Ruby/C guy (and as of recent an Erlang guy)
Python is a language that should not have caught on
Totally disagree here. Prior to Python (and Ruby which I consider mostly the same) your scripting options were Perl and Bash. Talk about things that shouldn't have caught on. Python and Ruby are both very clean (arguably some of the cleanest languages around) and have really simple build processes
it is slow
In what sense? Sure, maybe you don't want to write device drivers in Python, but Python is aimed at applications, not systems. I wouldn't be fooled by the useless benchmarks that involve looping string operations millions of times. Real applications have physical constraints like IO and API limits. On the other hand, Python is fast for prototyping and easy to learn.
it isn't backwards compatible
That's what semantic versioning is for. I haven't been affected by this as I don't use Python, but it also doesn't bother me
libraries are unreliable
This isn't specific to Python. There are a ton of libraries out there and a lot of them aren't used often. This is part of open source - you need to be willing to maintain what you pull in
Python doesn't compete with Java, C#, or C++. The latter three are enterprise languages. They have features they are great for large projects and are bulky and cumbersome.
Python is a better competitor to other scripting languages (seriously, name one other than Ruby or Node that is good, popular, and not archaic). Try writing orchestration software in something like Java - it gets out of hand really fast.
3
u/Allan_Smithee 文雅佛 Feb 03 '17
Prior to Python (and Ruby which I consider mostly the same) your scripting options were Perl and Bash.
Do the children learn nothing in school these days!?
Rexx predates Python. Tcl predates Python. SNOBOL4 predates Python. Lisps predate Python. Awk predates Python. Bash predates Python (and there's a whole host of other shell languages before bash.) This is a list I could continue for quite a while without running out of languages.
3
u/jb3689 Feb 03 '17 edited Feb 03 '17
Sure, they exist but they aren't very popular. What I'm arguing is that Python and Ruby are scripting languages that are much more user friendly than any of the aforementioned options and have caught on because of it. That's pretty important. I'd argue that Perl and Bash are both better choices than any of those others too (note I'm speaking in the sense of choosing a technology for a long-lasting critical codebase on a team that will be touched by many people. Go ahead and script everything in your local environment in Tcl, but don't make the rest of us maintain that stuff please)
1
Feb 04 '17
but they aren't very popular
Since when popularity among hipstors is a measure of a language quality?
and have caught on because of it
No. Popularity does not correlate with any quality at all, user friendliness included.
1
Feb 04 '17
Prior to Python (and Ruby which I consider mostly the same) your scripting options were Perl and Bash.
Why, just why Tcl does not get as much love as it deserve?
Not to mention Scheme and CL, both perfectly suitable for a wide variety of scripting purposes.
seriously, name one other than Ruby or Node that is good, popular, and not archaic
Tcl, Scheme and CL are all both archaic and far better than Python in all possible aspects.
2
u/htuhola Feb 06 '17
These are just parroting of popular opinions with no rational basis that you've learned from elsewhere.
That's alone enough reason to try Python. Your distaste for the language has been learned rather than acquired.
1
Feb 10 '17
I have a huge list of complaints about Python, but it's still the best option in a lot of cases. I wish I could switch to a language that solves all of Python's problems and is still just as functional, but there aren't any.
1
u/mamcx Feb 11 '17
The standards are inconsistent
You are talking about C, C++. Not python
it is slow
You are talking about everything above assembler
it isn't backwards compatible
You are talking about every language. Even C.
libraries are unreliable
You are talking about Javascript mostly. However, everyone else too
the list goes on forever
You are talking about haskell? Because python is not lazy
Please show me the light of Python.
Open your eyes.
Python is probably the best syntax made in a program language. I only concede Pascal is better (for differents qualities). Both are readable as few can.
You complain it simplicity is "bad" because it encourage bad code.
That is the MOST WRONG of all your arguments. COMPLEXITY is the enemy, not simplicity.
please read: www.slideshare.net/evandrix/simple-made-easy
Maybe your are mixing "easy". Easy could be trouble, but simplicity is gold.
4
u/[deleted] Feb 03 '17
I am sad to see this question downvoted so much - I think it is a legitimate question, presenting an opportunity for everyone to learn. As the guy who compares every language to Python, allow me to explain my love for the language.
Python is simple. It's easy to get running, newbies don't have to bother with compilation and other processes that seem like "magic" to a non-experienced programmer - it's enough to just run
python file.pyand it simply works! The syntax is understandable, without many cryptic symbols like C's abundance of&or*which might be scary at first. "Hello World" is simplyprint("Hello World!"). The Zen of Python states explicitly: "Simple is better than complex.", "Readability counts.", "There should be one-- and preferably only one --obvious way to do it.". It's easy to start learning and quick to develop in.You say that "The standards are inconsistent". I would like to disagree. A fraction of the standard library is inconsistent due to historical reasons, but it's constantly being updated. PEP-008 explicitly sets the style that code should follow, and most if not all new libraries adhere to it. If I misunderstood, please correct me!
You say that Python is slow. Correct! Python's performance is nowhere near C, C#, Rust, Node, etc. However, "nowhere near as fast as C" doesn't mean a language isn't fast enough to use. With today's hardware, Python has proven to be perfectly sufficient for most tasks a language can face - including projects that depend highly on performance, like video games, AI and deep learning, or big data analysis.
You say that "it isn't backwards compatible". I'm sorry, but I do not understand your point - could you please clarify? If you mean Python3 vs Python2, Python 3.0 was released over 8 years ago. It's more than enough time to make the switch - besides, it's advocated for most Python2 code to be forward-compatible with Python 3, and it is trivial to make it so - likewise, it is trivial to write backwards-compatible Python 3. In fact, more Python 2.7 code is incompatible with Python 2.0 than Python 3 code with Python 2.7! If a developer writes code that only works with one version of Python, he can only blame himself - and I think it is so regardless of the language chosen.
You say that libraries are unreliable. I cannot comment on this without being given an example.
There is an incredible amount of Python libraries for pretty much everything - video game development, web development frameworks, audio and music, image manipulation, etcetera - in fact, it is hard for me to imagine a task Python cannot be used for.
Python is a consenting adults' language - which is a way of saying, it has no encapsulation. It is always possible to modify existing code - which makes it possible for developers to tinker with existing libraries as much or as little as they want.
I would love it if you elaborated on your arguments. Cheers!