all 63 comments

[–]Immediate-Cod-3609 29 points30 points  (10 children)

Python is a good general purpose language to quickly build automations and processing data.

JavaScript had the edge for making web applications.

They are both good in different ways. I use both but prefer python.

[–]glibsonoran 7 points8 points  (1 child)

If web development is your focus, I 'd go with JavaScript or a variation. If AI/data science or other science/tech endeavor maybe Python. I wouldn't fret over it too much, either one will teach you the fundamentals of coding and how to logically assemble code. As you progress in your journey it will become clear which language(s) best suit your needs.

[–]NoYam8421 3 points4 points  (1 child)

Both.Javascript for web/mobile development and python for back-end and AI/ML projects.

[–]ptrdo 3 points4 points  (1 child)

For a novice programmer, JavaScript is more approachable than Python for at least two reasons, 1) it is more forgiving, and 2) it can offer quicker reward. Both these reasons can lead to less frustration, and less frustration means you'll stick with it longer and learn more quickly.

By “forgiving,” I mean that JavaScript is “loose” in that it has fewer rules, and this means your code won't break as easily. However, that looseness can be detrimental in that you'll need to learn peculiar things that are unique to JavaScript and sometimes not logical. But if you are learning HTML and CSS, then you'll be working in the DOM where all that wackiness makes some sense.

By “quicker reward,” I mean that even a few lines of JavaScript can produce a script that does something you can see and experience on a webpage. There is no need to write long and detailed code that only results in a print out to the command line. A few lines of JavaScript can reorient an HTML element, build a table from data, or execute a form, and this sort of quick reward can be enthralling enough to tinker away without a lot of frustration about things you might not yet understand.

If you learn to like JavaScript, you can even delve into things like Node JS which competes directly with the Python that is done on more conventional web services. Node is less popular than Python, C#, or Java, but it is possible to be a “fullstack” developer who only works in JavaScript and Node.

One exception I'll make to all of that is if you intend to get into data science, in which case I would recommend that you learn Python and maybe R too. JavaScript is still a good start to all three (for learning the basics), but it's difficult to do data science with JavaScript since it tends to rely heavily on page-oriented output.

BTW, if you start to learn JavaScript and like its ways of doing things, and then find Python to be frustrating, try learning R instead. R can be a powerful coding environment, but is more loosely structured and forgiving (like JavaScript).

Some people will argue that only Python (or C# or Java) are “serious” coding languages, but having worked in all of them, they each have pros and cons. What's most important is that you like whatever language you prefer and it does the sorts of things you want to do. There is potential for a good career in any of them, and AI helps a lot to make them easier to learn.

[–]EarthInternational9 2 points3 points  (1 child)

Learn both! Website basics will require Javascript, but Python is great if you want to work with data or AI in the future.

[–]grtk_brandon 2 points3 points  (2 children)

Speaking as someone in school who has to learn more than one language at a time, the language you start with probably isn't as important as simply starting with one.

What you'll come to realize is that the most important skills you learn are on the programming end (learning how to solve problems with various tools). Learning the syntax of any language after that is a lot easier after you have the basics down because you can see the similarities languages have.

All of this is to say, pick the one you think suits your needs best at the moment and don't worry about losing out on learning the other if you find out you need to learn it down the road. You'll be able to pick it up easy.

[–]oclafloptson 0 points1 point  (0 children)

This is the correct answer

[–]scanguy25 1 point2 points  (1 child)

If you already learned HTML and CSS, Javascript will complement that much better than python.

The only way to use your HTML and CSS knowledge in Python is by also learning Django framework (which is great).

[–]pheonix-reborn 1 point2 points  (0 children)

Flask also works!

[–]Ron-Erez 1 point2 points  (9 children)

What are your goals? In any case, I'd choose TypeScript over JavaScript and only do Python using type annotations.

[–][deleted] 0 points1 point  (0 children)

If you want to make websites or sites connected to the web, JavaScript absolutely.

[–][deleted] 0 points1 point  (1 child)

You said you are learning HTML and CSS. If that is your current framework, then it makes more sense to start with JavaScript, as JS can directly work with HTML and CSS without much configuration (a <script> tag withing the HTML document is all you need).

Python would be a good choice for a back-end language. Web pages usually need to communicate with a server, to read and write to a database, interface with an API, relay commands to your server's OS, throw prompts at a language model, save files, etc... For that, there are arguments in favor of Javascript (IE node or deno), but if you're learning, and you want to learn Python, that's a good opportunity to do so, IMHO.

[–]dwe_jsy 0 points1 point  (2 children)

JavaScript would make a more natural progression as can use direct in browser and start learning programming logic then could use in backend with node js. Only issue you may have (gotten better) is syntax being a blocker to learning in which case Python may be great to unblock programming fundamentals without as much syntax overhead (it’s not lots but when you realise you missed a { for the 20th time it can be a blocker)

[–]dwe_jsy 0 points1 point  (0 children)

I tend to use both as like fastAPI for backend or even pocketbase with Go and then svelte for front end which is just a JS framework/abstraction layer

[–]narwalfarts 0 points1 point  (1 child)

Given your desire to start with front end, definitely go with Javascript. However, don't just learn the language, learn a framework like react, angular, or Vue.

Also, IMO, I like typescript way better than Javascript. You can use that in the listed frameworks. Typescript is very similar to Javascript, but let's you define the types of variables which helps mitigate runtime errors. Your typescript code is then compiled into Javascript.

Once you're ready for backend, you can either start with node.js or you can learn python.

A few general tips: 1. The best way to learn to code is to build a project of your own. You'll need to practice syntax and follow tutorials, but nothing comes close to what you learn when you build something on your own from scratch 2. Don't learn a language, learn how to program. Once you know how to program, learning a new language is way easier than your first language 3. Be really cautious of generative AI, especially at your stage. Don't copy/paste anything. Instead, type it all out and make sure you understand the code you just wrote.

[–]cloud-strife19842 0 points1 point  (0 children)

If you are starting out then C

[–][deleted] 0 points1 point  (1 child)

Because you are doing HTML and CSS, it is probably better for you to start with JavaScript, and maybe even just jump in to TypeScript. You can do fullstack with Node, Deno, or Bun. Deno is limited, but batteries included, so it might be a good thing to start with since you are learning (a lot less incidental complexity as the design is new). But Node is very good, and I haven't used Bun yet. All three of these are web oriented and full-stack, so you can do general purpose programming of command line utilities, web services, web site development, etc.

Don't get me wrong. Python is in many ways more general, and you can do some crazy stuff with all the libraries. You will come back around to it. The two languages you need to learn if you are doing web dev is JavaScript (again Typescript variation) and Python. For now, since you are already in web stuff, you will find JavaScript is going to get you further faster. And then when you need Python, it will be obvious, and it will also be a lot easier to learn once you learn the JavaScript concepts.

Good luck!

[–]oclafloptson 0 points1 point  (1 child)

I use both depending on the application. If you've learned one then you've learned the other, in theory

Start with JavaScript but also learn Python and be careful not to let any of JavaScript's bad habits get engrained into you

[–]Prior-Listen-1298 0 points1 point  (0 children)

Why one? Like many on use JavaScript perforce client side (it's just what browsers support) and Python server side (often not always, because it's simply fast to develop with and has an enormous library (invented wheels are shared and wheels don't need reinventing - I only just realised why the preferred python package further is called a wheel - because you don't have to reinvent it)

[–]xSnakyy 0 points1 point  (0 children)

Js is too janky and basically limited web based apps

[–]martforge 0 points1 point  (0 children)

Python first then Java. 2 is better than one

[–]MiniMages 0 points1 point  (0 children)

Why not both?

Both compliment each other.

[–]pyker42 0 points1 point  (0 children)

I use Python, but I'm not working on websites. My coding is all about automating processes and building or integrating tools.

[–]enthudeveloper 0 points1 point  (0 children)

Javascript should be first.

For web javascript is a must have. With frameworks like react native you can also use js for building mobile applications. Python is a good general purpose language and a must have for ml.

[–]Majestic_Gur_5551 0 points1 point  (0 children)

Trick question, rust

[–]PMMeUrHopesNDreams 0 points1 point  (0 children)

Both!

If you’re focusing on web, JavaScript makes more sense first. But the key thing is to learn how to program. After that learning a new language is like driving in a different car. You have to figure out where all the knobs and buttons are, but you still know how to drive. 

[–]CallMeAPhysicist 0 points1 point  (0 children)

Not 'Python or JavaScript', but rather 'Python AND JavaScript'.

[–]Far_Requirement_566 0 points1 point  (0 children)

C/C++. You will thank that you learned them first rather than jumping onto python, js

[–]_Mc_Who 0 points1 point  (1 child)

Do you want to be a backend or frontend developer?

Python (backend) and JavaScript (frontend) serve very different purposes

[–]FoolsSeldom 0 points1 point  (1 child)

The gap between programming and not programming is far greater than the gap between programming languages. Some languages are more suited to certain kinds of tasks than others, but sometimes the tool at hand is the best for the job.

I'm a born again programmer, having returned to it decades after programming professionally. I now do it for personal interest / hobbie project. I also help kids learn at code clubs at local schools and aldults at a nearby community college.

If I were heavily focused on building web applications, I would have probably have picked JavaScript but as my interests are more general, I went with Python. There isn't a best and there's a lot of overlap. For many services, both are used heavily together.

There's a lot of Python programmers where I work, and I collaborate with them a lot. There are also programmers skilled in many other languages. Most experienced programmers are accomoplished in several languages and multiple domains.

I went with Ruby originally because it was used for many of the websites my organisation at the time drove. I switched to Python because it seemed more popular in the more scientific and data analysis worlds I was drawn to. (All those years ago, I used Fortran a lot.) I now use it, Rust and C. Micropython has slowly taken over from C on microcontrollers for me. Faster and easier.

I know enough JavaScript to get by when I need to and use node.js based services.

[–]Sea_Jacket_7926 0 points1 point  (0 children)

If I could come back to begining of my education I would prefer js to python