That’s the thing about JS. It’s popular because it was first and grew into a monopoly. The language itself is horrific. We are permanently stuck with a poorly designed language because it has momentum which can’t be overcome.
It's was my take in 2015, when saying it then got you bashed to death.
Now you can say it, since people have been burnt enough to admit it, but ironically it's actually less true.
Yes, the JS language is always hackish. The stdlib sucks and the ecosystem is a Jenga tower. A lot of JS projects are still what I call "disposable code bases".
But.
Modern JS is tolerable. Functions are now decent, you have let/const, map/filter... There are even some nice things:
• spread and destructuring, and they play well with the limited data structures.
• simplest async paradigm ever: immediate schedule, and returns a Future, may attach a callback or prefix with await.
• concise arrow functions.
• ? and ?? operators. I actually miss them in Python.
Tooling has improved tenfold:
• VSCode gives you good code intelligence out of the box.
• any build tool will solve imports, scoping, "this" weirdness, browser compat, etc.
• new gen builders, such as ViteJS (or anything based on rollup/esbuild), are fast, reliable, and have sane default. No more webpack trouble.
• new gen packagers, such as pnpm, are fast, reliable, and save a ton of disk space. No more "takes 10 minutes, download the entire internet 3 times".
• with VueJS (SPA), htmx (ajaxify Django, Rails, Laravel...) and petite-vue (progressive enhancement), front end dev is almost fun. And light.
• Typescript.
Now, I still avoid JS if I can. I don't like having to google simple things like type coercion or how to left trim a string.
As soon as I can go Python, I do so. It's hard to beat Django or FastApi for the web, Typer for scripting, pandas for data analysis, pytest and robotframework for testing, or just the stdlib/pypi.org for pretty much everything. And with shiv and nuitka, deployment is now on a different level.
But when I have to use JS, I don't dread it anymore.
And I think the article is largely correct even though I don't dread developing Javascript-based applications.
One of our Nuxt applications with default build configuration sometimes builds successfully and sometimes fails miserably for reasons not understood. So we just run the process until it succeeds. I would never tolerate this in Python or take it as lightly as I do here, but like a frog in hot water I've been conditioned to almost expect it or at least not get too bothered by it.
I think Javascript the language is fine. But the rest of ecosystem feels enormously creative, myopic and too often fragile.
The thing with Javascript is that it sucks so bad that there are what a dozen or so languages built on top of it that get transpiled to JS to run in a browser or on V8. It sucked so bad that nobody really wanted to use it, they'd rather build a compiler and write in something else and tranpile into JS. How can a language be "good" when there are so many attempts that take such effort just trying to avoid it.
Has Microsoft been particularly litigious of late? Pearl clutching over Microsoft’s use of telemetry (which Google never uses, by contrast) has turned into full-blown Slashdot-style insanity.
What you call insanity, I call keeping check on power abusers, and MS has decades of track record of that. The fact they started to play nicer the last few years doesn't magically erase lying, cheating, corrupting and trolling for 20 years. Also google gets it fair share of criticism.
In fact, I think we don't make enough noise given the few people outside of our bubble that knows about it.
Typer looks neat. I don't think it was well-established when I started on this, there were quite a few offerings but the only one I managed to find was python-fire. It didn't quite do what my team wanted and there were a few behaviours that we didn't quite like so we decided to make this.
Having said that bargeparse was meant to rely solely on stdlib as the environment we were operating in was tightly controlled and any 3rd party packages had to go through a lengthy review process to be whitelisted.
Additionally, since our team (and others in our organisation) were mostly using argparse, the goal was to provide a way to declaratively interact with it using existing features in the language itself.
I used typer as an example because it has a modern twist, yet is based on click which has been the leader for 7 years.
If you want something older and with a similar api (wrapping argparse), using only the stdlib, I can ask the same question with argh, which already worked in python 2.6.
I can make a guess: GP does not know, he started working on the software and pointlessly duplicated existing projects, but with worse quality, because he neglected to survey the landscape.
I have noticed that happening regularly and out of curiousity interviewed those fellow programmers. I found out it's not because of lack of diligence, or because they attribute no value to a survey, but because of a risk-loving psychology trait that expresses itself in staking out ground and claiming it as one's own. (Armchair psychology warning, I am not qualified to make that conclusion; leave the real work confirming this hypothesis to the scientists in the field.)
IMO, this behaviour is harmful and we should work together to socially shun it like we already do for compulsive hoarding of physical objects. We have trouble finding a piece of software that works well because we spend so much effort to repeatedly sift through the mountains of published software that is mostly garbage.
Brave is Blink not webkit - Blink has been developed by Google, Facebook, Microsoft, Intel and many others. It is the standard for web rendering just as linux is for web hosting. There is nothing wrong with open standards.
>everything that is wrong with browser monoculture
What exactly is wrong with open standards? Would you say linux creates a hosting monoculture? That's just ridiculous. Blink has been contributed to by just about every major tech company, that isn't a monoculture thats how open standards work.
Blink isn't a standard, it's an implementation of multiple standards.
An implementation cannot be a standard since a standard describes what a implementation needs to do while a implementation will need to both decide what parts of standards to implement and how to implement them and will do many things that are not described in standards. There are many behaviors, bugs and implementation details of Blink that should not and cannot be part of a standard.
As soon as a implementation becomes a standard we get ossification and implementation bugs in the standard as the only way to conform to the standard is the exact original implementation.
Besides all that while Blink has contributors from many individuals and companies it is clear that google steers the ship.
The web standards were built on the idea that multiple independent implementations were crucial, and it is a required step for a proposal to become a standard.
Linux isn't a standard either, the standard in that case would be POSIX and linux is "Mostly POSIX-compliant".
> Would you say linux creates a hosting monoculture?
Yes, obviously. The GNU/Linux hegemony is a pet peeve of mine, especially because it breeds this absurd "well the most common implementation does X, so screw everyone else" mindset that needlessly hinders alternatives.
It's not as open as one would think. The corporations have too much control over it that if someone forks it, they will be left behind. Check how syncing was disabled in chromium recently.
Is gecko any different in this regard? That is how forking works.
>The corporations have too much control over it
Blink seems better in this regard, it has received major contributions from just about every major tech company out there diversifying its control. Gecko has been primarily just mozilla (especially these days since it only represents about 3% of the market).
A trap for your dream world were you suddenly get google size ?
Because I have a 1 million unique users video streaming service still running python 2.7, using a few servers. The thing has a mobile version serving a different media on the fly, encodes user uploaded videos, features comments, tagging, and even has machine learning detection of content now.
It is still maintained by one single person, and he is not a professional dev.
And I'd say it's already very rare to reach that size in any project, in any company. Hell my last 3 paid projects as a freelancer have less than 20 concurrent users. And that's professional. That's people's real life.
2 out of 3 IT projects fail, no code is even shipped. I would worry about the scaling later. Once you do have the problem, pay the price for more hardware or a rewrite, you made it!
And if you do know for sure you will have the problem (you already work for a GAFAM), then not choosing python is ok, it's not a trap, it's a trade off.
But for the vast majority of us out there, having an easy, solid, battle tested and clean language with a huge ecosystem is worth a 10000 times more than some scaling potential in 5 years down the road.
I have seen so many big C++ or Java project fail I don't associate any language with big and failure anyway. I've seen devs arguing about the purity of this in Haskell, or that in Ocaml, and nothing gets to the end user because it's never perfect, or it's a toy, and doesn't handle IRL.
But what powers most companies ? Rail apps that you won't upgrade ever, but are still running. Spaghetti PHP code and wordpress that just won't dies. Horrible SAP scripts, VBA macros and excel sheets that actually deal with your real data.
I haven't worked at Google's scale, but I've heard a lot of critism about tools and programming languages from people who create architectures that are inherently slow. When a user login requires 8 http calls to distinct microservices or something else silly like that the problem isn't a lack of static types. So far in my career I haven't had a programming language ever be the reason why something can't scale, most often the problem is the initial developers lacking a understanding of relational databases and cache locality.
It's a variation on cargo cult; you WISH you had the scaling problems that could be solved by using something a bit more performant.
But solve the problem first, and solve it fast. It's why so many startups from the 2010's on used Ruby; they were productive in it, solving a real problem, rolling out features fast.
I've worked in a few projects where they dove onto the cargo cult, of wishing they had the kind of requests and load that e.g. a microservices architecture might help with. Massively overpriced projects too, because they hired lots of consultants and self-employed people.
The one time there was a guy who rocked up in a Maserati (used, lol); he took two weeks to build a page that was just a centered bit of text and a button, and it didn't even work.
Also, a lot of developers forget to it, but even if you start with a fast language down the line you will end up rewriting it. The problem is that requirements change a lot and because of that your application will often end up being a mess. For similar reason RDBMS is also better than NoSQL when starting a project.
When rewriting you already know how the project is now, so you can design your app around that, which makes things simpler and faster.
> Because I have a 1 million unique users video streaming service still running python 2.7, using a few servers.
Congratulations.
•How many servers 2, 5, 10?
•How many pure python libraries did you have to replace with a Cython extension after you realized that it cannot support your scale?
•How many external dependencies? How many of them did you replace after they were abandoned? Surely not all actively developed library are still using Python2.7.
> It is still maintained by one single person, and he is not a professional dev.
So he cannot upgrade the project to Python3.x along with all matching dependencies either, So the project stays with all bugs and vulnerabilities.
Not everyone would be happy with such a setup and aforementioned drawbacks, that's why I think the parent comment says Python is a trap at scale and I concur. I've faced issues at at scale (few hundred thousand) and there's no way a python project can meet that scale without relying upon Cython dependencies.
> A trap for your dream world were you suddenly get google size ?
So only Google size is a benchmark for scale? If I were to start a web project which has just 10 concurrent users I would choose Go because I know I can develop the entire project with little to no dependencies, it can scale to N users without touching the code and with the confidence that the number of servers required will be < than that of python.
I still use Python every day, for where it's good i.e. small scripts for personal use, prototyping algorithms. For professional products I use Python only as an Machine Learning endpoint(With all the bandages) because I have no other choice.
But the question is rather, whats the cost / ratio ? The 7 servers costs 7 less times money that they bring. The solo dev makes $150k/years with it, and doesn't need to work full time, have flexible hours and its own business.
> How many pure python libraries did you have to replace with a Cython extension after you realized that it cannot support your scale?
Many. Being extensible with compiled extension is a feature of Python. Numpy and co are part of the ecosystem. That's an awesome thing about it: I can code in Python and get c speed anyway.
> •How many external dependencies? How many of them did you replace after they were abandoned? Surely not all actively developed library are still using Python2.7.
Many. And the project still runs, with so little resource, bring the money in and serve its purpose, after 10 years of service.
> So he cannot upgrade the project to Python3.x along with all matching dependencies either, So the project stays with all bugs and vulnerabilities.
Sure he can, it's just an expense he won't do. Bugs are workaround, vulnerabilities are shielded by other parts of the system. Essential things like injections are dealt with. Some trade off are made, like always.
> So only Google size is a benchmark for scale? If I were to start a web project which has just 10 concurrent users I would choose Go because I know I can develop the entire project with little to no dependencies,
No you can't. Not if you want the first version to come out in a few months. Because you need a scrapper, and a bdd, and registration, and auth, and permissions, and screenshotting, and upload, and videos encoding, with background tasks, and load balancing all the videos and pics, tagging, i18n, xss protection, and search, etc. So either you pay to use cloud services to do all those things for you, or you leverage a rich ecosystem. Or you take a year to do it. Even if Go were the best language in the world, it can't beat 10 years of django plugins, 25 years of python modules and the iterative speed of a dynamic syntax. Well, it can, with AWS :)
In fact, Go is a very niche language. If you take it out of the I/O and concurrency specialty, it's quite average. Rust is better at raw perfs. At same perf, java has a better ecosystem. For simplicity and easy compilation, you have nim and zig that are more expressive. Resilience ? Erlang. And for speed of dev, python is better.
So for our use case it is not were it would shine, because:
> it can scale to N users without touching the code and with the confidence that the number of servers required will be < than that of python.
1 server only run the python code, the others are for the video hosting and the db. Python is not the bottleneck in this site. It almost never is in web dev. nginx serves the content, postgres and redis deals with the data.
There are still no "rails" or "django" for JS. There are frameworks emerging with the same features, but they don't have close to the ecosystem. Meaning every time you want auth, social integration, etc. you have to reinvent the wheel.
There is also the stdlib. JS doesn't have simple things built in like left trim a string, csv loading, uuid generation, etc.
Then there is the API. Sorting in JS requires this weird -1/1 function. Getting the last element or truthiness to manipulate length.
Suddenly not only you have to install tons of things, but libs and frameworks can't rely on a common ground, nothing seems to integrate well. You glue a lot of things manually.
The popularity of JS is because it has a monopoly on the browser, and so a lot of people must use it, and a lot of users know it by default, and look for it elsewhere.
But when you have Ruby, Python, or even modern PHP frameworks in front of it, it's not a great deal.
Of course, not all programming tasks are about the Web. And this is where JS collapses completely. Sysadmin, data analysis, pen testing or automation using JS is a pain compared to the fluent versatility of alternatives. You know, things like connect to this ftp, download the excel files every hour, put the average of every column in the mysql db then export the thing as a PDF and send that to the boss.
Depends. Mainly on what libraries you can make use of. For anything numerical or also ETL processes that deal with various document formats python is way more mature.
Since you don't know if your product will workout and you want to go fast you use a third-party service first. Of course, for some type of stuff, you might have to go with python but if both can equally do the job well in the backend and you need a web[mobile] frontend the...
Many (most?) web projects allow hiding performance issues by scaling horizontally, caching and offloading work to native implementations where necessary (like video encoding). Python can work great in such circumstances.
The best testament to this is the reality that popular web services were able to limp along on a slow language for a long time before they had to rewrite their code.
But if one is doing something that requires raw power or precise control over resources, or precise timing then not choosing Python is not merely a tradeoff to be considered, but an obvious architecture decision.
- speeds matters of that level matters only for a limited number of use cases. Most programming use cases are fine with python speed. They were fine, in fact, with it 20 years ago, before we got that hardware speed.
- people are starting to complain about speed in python only because of all the data science going up. Suddenly here speed matters. Before, you had to get to google level of infra to find use cases where python was too slow.
- dev are expensive. Hardware is cheap. If you have a slow website, paying $200 dollar more on your server is not a big deal. But taking 3 more month dev that features with your $300k pro is another thing entirely.
In fact, remove the browser monopoly, and give it to Visual Basic, and in 3 years, VB will be the most popular language of the world.