Turns out being No. 2 language for all domains leads to being No. 1
What is fascinating that Classic Visual Basic jumped from 19 to 11. TIOBE is like that
I've been teaching Python for the last few years and there has been a marked increase in using Python to "Automate the boring stuff".
Adult students come to tell me that Pascal or C++ taught in school was just not something they could use practically, however Python is very practical across many disciplines.
Of course if we could solve the deployment issue on a fresh computer...
Remember folks, the Tiobe Index is a ranking of how many web searches are being done for a language. The farther you get from that metric the more you are speculating.
Which ranks languages based on number of tutorials searched for (via Google trends). It also has python at number 1.
I lucked out and learnt python 10 years ago so feel "ahead of the game". It's a language that feels so malleable...
Thre only negative is that type annotations aren't part of the core language. You have to run a separate tool (mypy) to check your types. Feels like it should be a flag on CPython or something.
> Are we going to pretend that there are really more searches for C and Visual Basic than for Javascript?
Probably. A lot of things I would add the language name to while searching for another language I qiickly learned tagging MDN on instead gets the best JS info, and once on MDN, navigating between topics rather than doing a new search for a related topic os much more common than the haphazard set of resources that you end up with for many languages.
Of course, that's a minor reason among the vast number of reasons why number of web searches explicitly targeting the language is a horrible measure of language popularity or impact.
> The ratings are calculated by counting hits of the most popular search engines. The search query that is used is +"<language> programming". The number of hits determines the ratings of a language.
Whatever they do TIOBE Index methodology is flawed. MATLAB at #13 ahead of Ruby #16 and Swift #17 makes no sense. MATLAB is a niche language popular mostly among Electrical and Mechanical Engineers while Ruby and Swift are general purpose and have much larger user and project base.
It actually counts number of search results. I think the intent was to use number of web pages as a proxy to measure popularity of languages, but since large chunks of the web are behind walled gardens (e.g. social networks that are invisible to bots), this metric might not be as relevant as it used to be.
You may want to also consider other data points like the annual Stack Overflow Developer Survey [0]. Again, it's not necessarily the perfect stat reflecting actual real-world language use (since it's really more about languages used by visitors to SO), but I'd say it's a pretty decent proxy.
It seems clear that the worse the documentation for a language is, the more a programmer will make searches. Not a linear relation, but it is common sense.
It seems clear that the harder a language is to understand, the more a programmer will make searches. Not a linear relation, but it is common sense.
It seems clear that [reason somebody would do a search] ...
So Javascript, SQL and PHP hover around at 2.5%. This index does not seem to be very meaningful. More akin to "confirmed by Netcraft" (a Slashdottism).
Python has one giant plus over pretty much every other popular language:
The syntax
I was reluctant to to meaningful whitespace for a long time. But after doing some projects in Python I have to admit the code looks so much better than C style languages with all the {, } and ;s
And it has one giant plus over PHP:
The module system
PHP went down the wrong road (of insanity) by deciding that the way to avoid naming conflicts is to use longer classnames. Because that is what namespaces in PHP are. Comfort tools to make your class names longer.
There is still one giant benefit of PHP over Python:
Performance
Currently, PHP is about 6x faster than Python.
Let's hope that the Python devs will focus on performance so we get the best of all worlds at one point!
You can avoid curly braces and semicolons and also not have indentation determine the control flow. Julia, Fortran, Visual Basic, and other languages do this.
Visual Basic and Classic Visual Basic are in spots 6 and 11. I am not against Python's use of indentation, but I don't think it's better than having keywords such as endif or next terminate blocks.
The only negative is that type annotations aren't part of the core language. You have to run a separate tool (mypy) to check your types. Feels like it should be a flag on CPython or something.
But anyone using typescript would just be Googling JavaScript syntax. Rarely is there anything Typescript-specific you need to look up while writing TS code.
Why do people care about so much lambda? If you want a function, use a real one. Python makes it easy to create throwaways everywhere. The only thing it enforces is proper indentation. What advantage should a lambda give you?
Naming things, especially functions that you tend to use in lambdas, is often hard. Imagine if you had to name a for loop to us it. That's how it feels.
filter(lambda x: x < 10, map(lambda x: x * x, [1, 2, 3, 4]))
But even for more complicated logic, it also doesn't seem like it's that burdensome to just throw a name on the lambda:
def square(x):
return x * x
def less_than_ten(x):
return x < 10
filter(less_than_ten, map(square, [1, 2, 3, 4]))
Which I find to be more readable/maintainable.
That's probably the most underrated feature of python. Decisions about how the language should function like this which seem "restrictive" from one perspective, and yet force you down the avenue of good decision-making for readability/maintainability. Sure, it's possible to write terrible python, but you're generally cutting against the grain to do it.
Yes you can do simple examples like the one I gave, but when it gets more complex you have to do what you did and name the functions, which is pretty horrible when they're just one-offs. It also makes the code read in a weird order.
That looks like a Ruby one-liner which is very OO (calling methods with blocks on everything, everything also being an object is very Smalltalk-esque).
Python's problem isn't a lack of lambdas, it's a lack of consistency; for some things you use functions and for others methods.
I know what lambda is, I just don't see any usecase where the limitation is a problem. If your lambda is so complex that you need more than a oneliner, then what's big thing with using a nested function?
The list defined above is [1, 4, 9], but the one you just defined is [1, 4, 9, 16]. It's interesting how the shift in notation subtly confused the semantics of what's going on.
Good point. I missed that and made a mistake. It should have been:
[x * x for x in [1, 2, 3, 4] if x * x < 10]
There is a subtle shift in semantics. The functional form defines a sequence of function applications whereas the list comp notation is more of a declaration.
You can write this as a oneliner too. But the problem here is not lambda, but the lack of map/filter-methods on list. Disputable whether this is good or bad.
I thought what you wrote wasn't valid because xx isn't defined in the scope of the inequality... however I now realize that's because Hacker News deletes the asterisks. In any case, it's
[x [asterisk] x for x in [1,2,3,4] if x[asterisk] x < 10]
which is still a little annoying because the x [asterisk] x gets computed twice. This is one of those little details that really annoys mathematicians, as I saw with SageMath for decades (I started SageMath -- which uses Python -- and got no end of complaints about the above). In the Magma programming language there is a "where" version of comprehensions that eloquently solves this problem as explained here: http://magma.maths.usyd.edu.au/magma/handbook/text/10
If it's too complicated for a lambda, you shouldn't be using a lambda. Define a separate function if it takes you more than a line or it's harder to reason about.
People all know lambdas are expressions only, it's not a biggie really. In all honesty you rarely inline complex lambdas with all you mentioned, it would become hard to read or debug.
In a 100KLOC codebase, 99% of the performance issues are going to come down to 5 or 10 lines of code.
Don't get me wrong, I'm extremely happy that MS is funding a multi-year project to improve Python performance, and I think it will confer enormous benefits to the ecosystem. And frankly I think that it's absolutely needed.
But for me it would also be weird to choose languages based on some notion of average performance. Like sure, a line of Go might be faster than a line of Python on average, but if the entire bottleneck of your codebase revolves around one line of regex then what is doing a rewrite actually going to accomplish?
80/20 rule? Probably. Then 80% of CPU time is spent in 20K lines of code.
But 1%? I don't think so.
A web project of 100KLOC will be a shit ton of features and CPU time will be spent in hundreds of different places.
Another issue is what I would call "code depth". Even if you find a few lines deep down in a framework or library that makes your specific use case slow - what can you do? Patch the framework? That comes with a ton of issues on its own.
one can argue about how much of an exact science Tiobe or other indices are but Python definitely is everywhere and has continued to grow in a lot of domains. And I think deservedly so because to me it is by far the most pleasant and versatile general purpose language around. People have their legitimate gripes about performance but a language that is used for everything from scripting to gigantic industy scale applications (largest I'm aware of is a ~30 million LOC codebase at JPMorgan) has done some things right.
30MKLOC in Python? Largest I've seen is 500K and that was one overcooked codebase. So problematic. They were looking at a Java rewrite. I'd love to read a lengthy insider exposé on that JPM codebase.
How do you know? Maybe there's an endless army of programmers supporting ancient one off VB programs written for various odd tasks across many organizations.
With tons of ready-to-use libraries for string processing, machine learning, images, graphics, game development, web, etc., there is not much to dislike about it. It is my goto language for quick scripts -- works flawlessly on Windows/Linux/Mac.
The only downside is efficiency and being one-threaded, but if you are gluing together library calls, which you are most of the time, then it is good enough.
I disagree. Python's popularity is actually kind of tragic. The package ecosystem leads many to choose Python, which has both maintenance and performance scalability issues (not to mention the sorry state of packaging, distribution, and parallelism). So it causes plenty of headaches, despite its friendly syntax. In those senses, choosing Python is like a trap.
I absolutely agree, but this sort of tragedy is a bit unavoidable. What language would you choose to have that ecosystem instead? The next thing right now is probably JS which is even worse. Every language has plenty of issues. Python's worst IMO is how C extensions and other stuff are tied to an interpreter definitely unsuited for it's popularity. Parallelism shouldn't really creep in considering how most code is written. The only language I can think of being better is Lisp if somehow the lisp curse wasn't a thing.
Kind of. Python definitely has more legacy cruft, but also has an npm equivalent PEP 582 with a working example, pdm. I don't see how JS is better unless you include web browsers as distribution. It's mostly people thinking bare `pip install` is a reasonable way to add various applications to your system that complain about python packaging.
I'm not saying Python packaging doesn't suck, it definitely does. But so does JS and the mess that the npm ecosystem is makes working with it it much more painful.
> Python definitely has more legacy cruft, but also has an npm equivalent PEP 582 with a working example, pdm
That's part of the problem. Python has lots of things that cover lots of things, but nothing does everything.
> It's mostly people thinking bare `pip install` is a reasonable way to add various applications to your system that complain about python packaging.
It is reasonable in JS, and I think it should be. Having to worry about virtual environments is a pain, and having to learn new tools to avoid that is a pain too.
> I'm not saying Python packaging doesn't suck, it definitely does. But so does JS and the mess that the npm ecosystem is makes working with it it much more painful.
I don't think that's a good point. The JS ecosystem adapted quickly to TypeScript, while Python is lagging behind. Most of the new JS features are reasonable, and the backwards compatibility is top-notch. Meanwhile, Python is spending brain power on pattern matching and :=. JS is missing something like Django, but on the other hand Python has no React equivalent. All of that without mentioning speed or the fact that JS has multiple implementations that works very well with almost all the ecosystem.
It's not. Even if npm install -g happened to work for you, it's insane to rely on it. These language package managers have a purpose in isolated environments but are incapable of building reliable, modifiable and updatable systems on their own. It's a good thing pip fails quickly so people don't attempt this.
I've always wished that Ruby had the place of Python. For all the love that Python syntax gets, Ruby syntax and the gem system are an absolute joy to work with.
I think it definitely depends on where you are and what you're doing. In 3 of my 4 years of professional Python experience, we have run up against scaling, maintenance, and parallelism issues constantly.
Well it's basically Visual Basic for adacemics and it excels at that. Aside from it's obvious problem: Python is a very practical, though almost generic language, with a rich collection of useful libraries -- so why not?
It's also the better shellscript for administrators. And user-friendly, like basic. It excels on many fronts. The surprise is more that it took so long to reach that point, considering how old and widely used it is.
What is fascinating that Classic Visual Basic jumped from 19 to 11. TIOBE is like that
I've been teaching Python for the last few years and there has been a marked increase in using Python to "Automate the boring stuff".
Adult students come to tell me that Pascal or C++ taught in school was just not something they could use practically, however Python is very practical across many disciplines.
Of course if we could solve the deployment issue on a fresh computer...