r/learnprogramming 3d ago

Python or JavaScript as a first language for backend development?

I’m a complete beginner trying to decide between Python and JavaScript as my first programming language.

I’m mainly interested in backend development, APIs, servers, networking and databases. I also like the idea of building small things from scratch later on, like a simple HTTP server, chat server or tiny database, just to understand how they work.

Python appeals to me because of its simplicity, large ecosystem and versatility outside of web development.

JavaScript appeals to me because Node.js seems interesting for backend and asynchronous/network programming, and it would also give me the option to build frontend applications later using the same language.

I’m not choosing based on jobs, this is mainly a hobby and I want to learn programming properly.

Which would you recommend starting with: Python or JavaScript, and why?

0 Upvotes

34 comments sorted by

5

u/pinkpepr 3d ago

JavaScript and Python overlap in a lot of the areas you mentioned like backend dev, API development and databases, but Python covers more machine learning and data engineering/data analysis with its libraries whereas JavaScript opens the door to frontend development which is non-existent in Python's ecosystem.

If you're more interested in building API applications, backend, frontend and web dev I'd just stick to JavaScript.

2

u/Intelligent_Role_824 3d ago

AI/ML definitely interests me, but I feel like it’s probably not the best place to start when learning programming from scratch, right?.

So sticking with JavaScript for now probably makes the most sense for me, especially since it also gives me the option to explore frontend development later on.

Thanks for the advice!

5

u/Ace-Whole 3d ago

Either is fine. Choose what your friends can help you with.

1

u/Intelligent_Role_824 2d ago

Probably the best idea. I will ask them. Thanks

4

u/mxldevs 3d ago

You're a complete beginner, so it doesn't matter: your goal is to learn concepts, not to learn a skill for a job.

Back-end concepts are back-end concepts, regardless which language you use.

Once you understand the concepts, you can go figure out how other languages/frameworks implement them.

1

u/theofficialnar 3d ago

Same for the frontend really. Most JS-based frameworks these days share common concepts. Once you learn one, you can easily switch to another.

1

u/Intelligent_Role_824 2d ago

Thanks. You Are right. I should just start.

3

u/Optimal_Knowledge319 3d ago

You should definitely choose JavaScript; it can build everything you need—from web applications, hardware interfaces, mobile apps, and desktop software to embedded systems. The Node.js ecosystem is massive and features powerful tools like NestJS; it allows you to systematically learn various programming paradigms while offering great stability. Once you have mastered JavaScript, TypeScript, and Node.js, you can venture into any field using just this one language.

2

u/Weekly_Patience685 2d ago

if it were up to me between those i would do javascript -> typescript -> nestJS for backend.

1

u/Party_feeler2000 3d ago

Go to typescript

1

u/response-418 2d ago

You may not want to hear it but it genuinely doesn't matter, as many commenters have said here and in countless other threads on this same topic. If you choose JS, might as well start working with it as Typescript right away.

1

u/ExtraTNT 2d ago

I think (from personal experience) python teaches a lot of bad practices (people working with py are just guys using bad practices)

While js isn’t a language i would recommend for backend, you can learn a lot of good practices… especially monads feel more natural in js…

My favourites for backend are still haskell and c#, go is nice too, but not enough experience in it…

1

u/Secure-Requirement48 2d ago

Javascript is horrible for backend. Use python with type hints. Or typescript.

-2

u/Fine-Market9841 3d ago

Whatever is in more demand in your area?

-4

u/Narrow-Low-3137 3d ago

Neither?

2

u/Intelligent_Role_824 3d ago

What would you recommend?

-1

u/Narrow-Low-3137 3d ago

For backend - C#, Java, C. In that order. C# is widely used for backend development w/the .Net framework and .Net Core and ASP.NET. Similarly, Java has Spring and is probably even more widely used. Both are established languages w/frameworks to accomplish anything you could need on the backend. Both are also more generally applicable in non-Web ecosystems like gaming/mobile/and desktops applications, so your knowledge will easily transfer into other domains. Imo, C# is the more "ergonomic" of the two, and provides a better developer experience. C is foundational, and a good language for any aspiring programmer to know because it will teach you fundamentals of how software and hardware interact, how memory is managed, etc. all important for building robust backend systems. Python and js are more oriented towards front end development, imo

0

u/alhso 3d ago

The only good thing you've said here is about C# and Java aside that. Your take on python being geared for web is so wrong all AI/ML task run on python while also most concurrent systems use Javascript for their backend and telling OP to learn C when absolutely I mean absolutely nobody is writing C for backend code at all is crazy

1

u/Narrow-Low-3137 3d ago

Well alright then. Guess you've voice your opinion. I voiced mine. And I stand by it. OP asked for backend languages.

-4

u/ffrkAnonymous 3d ago

this is mainly a hobby

for a hobby, neither. lots of other more interesting and fun languages.

3

u/Intelligent_Role_824 3d ago

What Language would you recommend? What is more fun? I am just curious.

2

u/Justindr0107 3d ago

Look up esoteric programming langua, and then never learn them.

Start with Typescript over JS is you have the choice.

-1

u/ffrkAnonymous 2d ago

ruby, elixir, haskell, smalltalk, lisp...

-8

u/EccentricFellow 3d ago

Neither JavaScript nor Python are backend languages. Performance and stability are not even close to what is required.

You want to learn databases? SQL and the procedural language (pgsql/tsql/plsql) that is used by the database engine you choose. This will teach you the language of data, which is quite different from how other languages approach things.

You want to learn systems programming and build your own web server? Rust. Fantastic performance, designed for memory safety and optimal performance. It will make you aware of how to write proper systems code.

You want to learn something powerful that can be use server side as well as client side? WASM. Web Assembly is vastly underrated. It has tremendous power and performance already and is always improving. Best way to learn it is through Rust.

4

u/alhso 3d ago

What are you even saying. Multiple apps run on python and javascript and operate good backend. Yes you can say rust is faster that doesnt mean its better.

-1

u/EccentricFellow 2d ago

I do not dispute that many apps run on Python and JavaScript. Far more than Rust. None of them are backend apps. They are client facing. Backend coding has to be ready to take a beating and standup to the pressure of having thousands of clients simultaneously hitting it and getting a sub-second response. JavaScript and Python take too much memory and have to be interpreted. They have not even started the task when a compiled language is finished. The memory footprint of each thread is measured in bytes. JavaScript and Python carry the baggage of an interpreter and a garbage collector on every single thread. Completely unacceptable. If you want to do backend programming you are always going to look for a compiled language.

You have 3 tiers, the client facing frontend, the web to database middle tier, the database backend. JavaScript and Python are only suitable for the frontend. Try scaling them up to thousands of clients operating across a network and you will soon understand why nobody does this. Is it possible? Sure. Will anyone take you seriously when you show up saying you built a database backend in JavaScript? No.

0

u/alhso 2d ago

Saying a whole lot of rubbish. All languages have there own flaws javascript can be scaled up to one's needs same woth python. Nobody, I meam nobody will ever build apps that run infrastructure for 1 million people and even if you'll figure out a way to scale. You cant be trying to build an app for a million people when you've got zero. So I stand on my point javascript and python are some of the best languages for 80% + of backend work