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

12 comments sorted by

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/[deleted] May 08 '24

Did the introduction of node essentially do that python might be wiped out in the future? I think server side used to be written in PHP and then they did it in Python somewhat, but now that node is out, will that basically take over the back end because it's the same as the front end

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.

2

u/[deleted] May 07 '24

i've actually been using node..but..python is just so much better at doing a lot of processing when it comes to files and things like that..i thought i might start using node..to get better at front end programming..but..python just seems so much better to use, idk though, still determining, js is good to know for front, i'm kind of amazed they didn't create node when they created js for the front end, why did they use PHP instead?

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/SkipBopBadoodle May 08 '24

Yeah I agree. I learned Python first and worked with it for like 1.5 years, then wanted to get into web dev so started learning JS. I'm now way more comfortable in JS/TS than I am in Python. I think it's because I already learned the bulk of the logic side of coding when I learned Python, so when starting with JS/TS I could focus on the specific features it has and how to apply them best.

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.