Andreas Bollig
4y ago
I write about freelancing, solopreneurship, web dev and data science.
In the last couple of years, Python has been my daily driver. As a data scientist, I have used Python for data analytics but haven't done any web development with it.
Python web development
I recently wanted to start building a web app and went looking for a framework to use. As a Pythonista, I quickly found my natural choice in Django. I went on to build a small test app and quickly realized a major roadblock when trying to integrate React as a frontend framework into my project.
As it turned out, Django delivers a fully-fledged experience when it comes to shipping server-rendered HTML to the browser, but leaves you on your own from there on out. If your goal is to build a dynamic frontend with Javascript, it is your job to figure out how to integrate that into your project.
More research uncovered, that the typical way of using Django together with something like React is to ignore the templating parts of Django and only use it as an API that serves data to a single page app (SPA) frontend.
Javascript full stack frameworks
The recent years have seen the emergence of Javascript-based web frameworks that cover both, the frontend and the backend. After some experimentation in this space, I dropped the Django API + React SPA setup and went with one of the JS full stack frameworks called Remix. Here is why.
#1: Less cognitive overhead
Since both, the frontend and the backend are written in Javascript, I don't have the constant context switch between two different programming languages.
#2: Code sharing
One example of this is form validation logic. Form data needs to be validated on the server to ensure safety. Also validating it on the client facilitates a better user experience. Having the same language in the browser and on the server means this code doesn't have to be written twice.
#3: Half the complexity
Using different technologies for the frontend and the backend, you are actually building two applications, not one. That means that there has to be two of everything: two dependency managers, two linters, two test runners, etc. Managing this complexity takes away time from writing application code that delivers value to your customers.
"But I don't want to learn JS"
Javascript is THE language of the web. It is the only language available in the browser. Sooner or later you will anyway need it to make your web app modern and dynamic. Don't try to fight it - embrace it.