Hacker News new | ask | show | jobs
by caspii 1650 days ago
I firmly hope that javascript has peaked. The complexity of the tooling has increased by a factor of 10 in the last 10 years with subjectively very little to show for it.

Anyone starting out with backend webdev should learn Python Flask. There is no gentler and more thorough way of learning web fundamentals, whilst still being productive from day 1.

5 comments

Flask is arguably objectively an extremely poorly written library and there are lots of alternatives out there that are much better, like FastAPI.

This is also pretty much obvious from the get-go. When handling a HTTP request, the morally correct function is something like a function which takes a request as a parameter and returns a response.

In flask, for no good reason, a lot of things that are only accessible inside a request get put into global objects, and if you try writing code that accesses them outside of the right context, it will simply crash. You might accidentally refactor such code to the wrong place and you will have no idea until it crashes. This kind of design on top of a dynamically typed language is kind of like drinking poison and then shooting yourself.

Flask is full of insane things like this and it boggles the mind that it ever got as popular as it has. I suppose there weren't many alternatives.

IIRC, Flask was originally written as a joke. It was also created in the era when using thread locals was still somewhat common but going out of style. I've always been a bit stumped as to how it got so popular. I usually recommend Django + DRF, Pyramid + SQLAlchemy, or FastAPI, depending on the project.
Yeah I’m not sure I agree with you. Spinning up a web server in Node.js using Koa takes minutes. You don’t need TypeScript or anything else really.

Everyone talks about the complexity of the tooling and I have no clue what they’re talking about. This is from a backend perspective. If you jump on the TypeScript bandwagon, which makes everything infinitely harder, then maybe, sure, I’d agree with you. But JavaScript is dead simple to use.

Even now in frontend land there’s still innovation. Vite has been an absolute pleasure to use and spinning up a React app takes minutes. The irrational hate for JavaScript is really weird.

It's funny that at the same time the language evolved so things got much easier without any dependency.

Yes, almost every other language is still more productive, but all that tooling gives you less and less each year.

I wouldn't say that.

My team uses a Rails backend and React apps on top. For us, React apps compared to Rails views just about cut our feature delivery time in half.

Of course, it depends on what domain you are working in. Dynamic frontends on Rails are a pain compared to React and probably some other front-end JS.

That said, on the backend Rails is a very mature framework that is hard to beat on most things.

expressjs is just as simple as flask, what is your point?
I personally think Bottle.py is simpler and gentler than Flask.
I am curious why are you saying that. I know Flask well and while I never wrote something with bottle.py, it seems ~90% similar, at least in the basics.
For me, a big one is that Bottle.py has zero dependencies; the entirety of the framework, including the template engine, lives inside the single `bottle.py` Python script. That means it's simple to use even without pip or a virtual environment: just pop the bottle.py file in your project, import from it, run `python my_script.py` in your terminal, and you server is up and running.

From my experience with Flask (albeit, this was years ago), it was a bit more complex and ending up with circular dependencies was common.