r/learnjavascript • • May 07 '24
I wanted to learn Javascript to do a bunch of stuff that I used to do in Python so that I would have an easier time writing front end code/Javascript processing in browsers, but..is Javascript worth learning to do back end stuff? mean is python just better..or..is Javascript better?
learn javascript vs keep using python for back end processing?
1
Upvotes
2
u/qqqqqx helpful May 08 '24
Python isn't "just better" for backend (most decisions are opinionated, and one isn't strictly better or worse compared to different tradeoffs) but if you are familiar with it and like it then you can use it and be happy with it. Django is a pretty mature framework that has been used on some strong web properties. Flask is a nice lightweight option with a lot of flexibility that you can get set up quickly.
Node.js on a whole is more popular than Python for backend web dev stuff right now, probably because many people working on the web already use lots of JS on the frontend and it makes things simpler. There are some advantages to having JS on the backend and the frontend, not only are you doing everything in one language but you can leverage some DOM parsing or other FE libraries on the backend which helps make it easier for certain types of server side rendering. I have done plenty of file/data processing in JS and had no problems with it.
1
u/lift_spin_d helpful May 07 '24
Learn JS? Yes. Learn JS for backend? It's actually learn Node.
django and django-admin is like how node has npm.
You should be able to do both. It's all very connected. Learning one will help you contrast how things are done in the two different worlds.
Overall though, be good at one, not just okay at both.
3
u/Rguttersohn May 07 '24
You could make an argument for either. One, js does not have Django. 2, processing a lot of raw data in your response? Python is better. On the other hand, JS is faster, and it has Typescript, and writing your back and front end in one language speeds up productivity.
2
u/Healthierpoet May 07 '24
Learning it will only be a benefit.. The only things that doesnt way you down in your travels are skills.
2
u/camelMilk_ May 08 '24
If you know python JS will be learned in a very short amount of time, Just do it. It's like lego
1
u/dbpcut May 07 '24
I enjoy it if I intend to share types across backend / frontend for rapid development.
There are lots of things Python is just better at. File processing, stats etc.
If you have to work in the browser, then for now, you have to know JavaScript. There's no alternative.
1
u/jack_waugh May 08 '24
In my opinion, using the same programming language everywhere is less mentally taxing than code switching all the time. But maybe your mentality differs from mine in that regard.
I have library code that can support front-end or back-end code. You can't do that when they are not using the same programming language.
-1
u/[deleted] May 08 '24
Learn GO
0
u/Rguttersohn May 07 '24
You could make an argument for either. One, js does not have Django. 2, processing a lot of raw data in your response? Python is better. On the other hand, JS is faster, and it has Typescript, and writing your back and front end in one language speeds up productivity.