4 ms·
In my experience, I've seen no benefits (and sizable downsides) to using Python on the backend when the front end is React vs. using Node. There are tons of rob
by hn_throwaway_99 2y ago
In my experience, I've seen no benefits (and sizable downsides) to using Python on the backend when the front end is React vs. using Node. There are tons of robust API frameworks for Node, a huge ecosystem, etc. So with Node and Python it's more potayto-potahto, and if that's the case, there are benefits to having everything in Typescript for standard server/client cases.
Note I'm not saying do this everywhere if there is a place where there are clear benefits to using another language. For example, while IMO the difference between Python and Node on the server for standard CRUD type apps is really one of preference, that's not the case for doing something with ML or LLMs, where the ecosystem around Python is much bigger, robust, and more generally familiar to the AI crowd.
- xmprt 2y agoI think you feel that way because you're comparing Node to Python. Neither of them are particularly good languages for servers. Languages like Go and Java/Kotlin are much better when you're building complicated systems that need to be performant and reliable.
- physicsguy 2y agoGo is not the best for ML and scientific applications in my experience. Orchestration is fine but the libraries just aren’t there, Gonum alone is way behind NumPy/SciPy
- hn_throwaway_99 2y agoHard disagree on Node (at least if you're using Typescript) not being a good server language, and I say this as someone who was a Java dev for the first 15 years of my career. I've seen more performance nightmares with Java compared to a well-written Node server, though Java has improved a ton in recent years with things like virtual threads and the community has generally seen the error of the unnecessary AbstractFactoryBuilderGenerator shit that was so common for a long time in Java.
- hansonkd 2y agoTBH the hardest thing for a long time about Node backend engineers isn't that there isn't great frameworks but a lot of times people choose node for the above use case. So developers who write Node backends were some breed of frontend people who chose node because they didn't want to learn another language as opposed to learning the language because it was the best tool for the job. Anyways recently the typescript backend scene is developing a lot better than even a few years ago. stuff like NextJS becoming more popular and more stable better backend typescript frameworks coming out. My comment was mostly aimed at using backend languages for frontend as opposed to necessarily targeting Typescript
- hn_throwaway_99 2y agoYeah, I agree with that. When I first saw the title on the article I thought "ergh...", because while I think Go is a fine language that really excels in some contexts, the number of developers who are familiar with "Go for the front end" is vanishingly small. My initial distaste was tempered by the fact that I thought they at least had a good reason for wanting to eliminate "need to code twice" for their different front ends. FWIW I was a primarily a Java server developer for the first ~15 years of my career, then switched to Node and really loved it. It was at that point that I fell into the benefits of my "Typescript everywhere" mantra because it solved so many problems I had seen with the common setup of Java on the backend and Javascript with the rise of SPAs on the front end.
- JoeyJoJoJr 2y agoOn my company’s latest project we are using Spring Boot on the backend with Typescript and React on the front-end. We are using Swagger for API specs which means we can generate type safe Typescript code for the front-end, including schemas for Zod and Tanstack query functions. With this codegen I can’t see many benefits to using Typescript on the backend, although the project is a rather standard CRUD app. I can understand why you might not want to use Java, but surely there are better backend choices than Java or Node? I am curious - could you explain how you are benefiting from using Typescript on both back and front end?
- komali2 2y agoWhat are the downsides? Benefits are if you use something that uses Pydantic models (say, fastapi + sqlalchemy) for example you seem to be able to get more granular control over DB types than, in my recent experience anyway, we had using Prisma / Nextjs. We switched over, have fastapi generate an openapi.json, then use Kubb to have it auto-generate typescript types (it can also do zod models), done.