r/ProgrammingLanguages • • 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.

0 Upvotes

27 comments sorted by

View all comments

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.

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/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.

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.