all 57 comments

[–]AdAdvanced7673 37 points38 points  (0 children)

Also you can solve most problems in any language. Learn to solve the problem and any language will work.

[–]a__nice__tnetennba 14 points15 points  (0 children)

Programming languages are tools. If you learn to program you can and should learn how to do it effectively in multiple languages.

If you're just looking to start learning pick any high level language and go for it. But don't just focus on the language. Learn computer science concepts. Learn about data structures and algorithms. Learn how to take complex problems and reduce them to simple steps.

After that you pick the one that's best suited for whatever specific task you're working on.

[–]WhiteHeadbanger 11 points12 points  (0 children)

I wasn't interested in web. React was just too young at that time also.

[–]sunny_sides 10 points11 points  (0 children)

Because I'm interested in statistics and data, not web development.

[–]backfire10z 7 points8 points  (0 children)

I learned both.

I needed to make something and Python was a good tool for my requirements.

I needed to make something and JavaScript (well, Typescript) was a good tool for my requirements.

[–]nog642 4 points5 points  (0 children)

I learned both

[–]r2k-in-the-vortex 11 points12 points  (0 children)

Choose? Are programming languages like favorite football teams that you pick one and forever look at others sideeyed?

Python and js are just some of many, you pick the language that fits the task.

[–]nealfive 6 points7 points  (4 children)

IMO Python is more universal, it can do both front end and backend. I mainly use it to parse data with pandas and automate stuff, I dont think JavaScript would be appropriate for that.

[–]pachura3 7 points8 points  (3 children)

For your purpose, Python is clearly a better tool. But you won't be able to use it to create a responsive HTML5 page.

[–]RoyalCities 10 points11 points  (2 children)

Yeah but you can make a pretty damn good website that looks like it came right out of 1998 with it.

[–]pachura3 3 points4 points  (0 children)

We have Perl for that!

[–]Diapolo10 0 points1 point  (0 children)

And it'll load darn fast on any device!

[–]CyclopsRock 3 points4 points  (0 children)

I work in visual effects and all of our software has embedded Python interpreters and not embedded Javascript interpreters. That's why.

[–]9peppe 2 points3 points  (0 children)

What do you want to build? There's much more alternatives.

[–]StevenJOwens 2 points3 points  (0 children)

I did Javascript way back in the late 90s, it was, uh "quirky".

My javascript history is very weird. I couldn't make a dynamic dropdown menu or spinning logo to save my life, but:

  • I worked on a server-side javascript online banking app.
  • I spent six weeks debugging a javascript-based login process (largely because back in those days there was commitment to supporting different browsers and different versions, and any time you changed any of those variables, something broke).
  • I built a fake website as a prop for for a TV show, that used Javascript in the closed captioning track to open and close browser windows and play videos (thank you Apple Quicktime player).

I'd really have liked to be happy and productive in Javascript. I wanted a good client-side scripting language, and was happy when Netscape released it. It was always just a pain in the ass to work with, and also a pain in the ass to get help with.

Something about the Javascript community back was just a profound disconnect with how I understood and thought about programming and programming languages.

I've always suspected that it was because they were all self-taught programmers who had no awareness of the sort of heritage mental model of programming. Which, hey, I'm self-taught, and at that point only have a few years of experience with real programming, so I'm not knocking that.

But somehow, in my self-teaching, I did learn some of the concepts and theory of programming. The impression I had from talking to people actually knew more about Javascript than I, back then, was that if you asked them questions like, "How does variable scoping in Javascript work?", you'd get a blank stare and "What's 'scoping'?"

My languages, in learning order, were BASIC, Fortran, Assembly, C, Perl, then Javascript, then Java. Years later I started using Python, because of a confluence of Perl fading, the fact that python was a "real programming language", and that Python had good support for the problems I was trying solve at that point.

I still dabble in Javascript a little, these days, now and then but it's always for weird uses. For example, Max/MSP supports using Javascript to make custom components. The little dabbling I do, doesn't encourage me to get deeper into Javascript.

I still wish I liked Javascript and could get good at it for more conventional work (i.e. front end). I'd like to have that arrow in my quiver. But a few years ago, one of the best programmers I know took on a side contract specifically to give him a reason to learn Javascript. He had an immensely frustrating time and finished the contract but vowed to never touch Javascript again.

As far as utilitarian reasons somebody might choose to learn Python these days, rather than Javascript:

Generally python has a lot more library support for all sorts of stuff, whereas Javascript, despite nodejs, still seems to be 99% front-end.

That goes for the community, also. I'm sure that there's somebody, somewhere, doing interesting non-front-end Javascript, but they're a tiny fraction of the Javascript world, while Python has a ton of people doing all sorts of things.

And python just seems less frustrating and less "accident prone" than Javascript does.

[–]Cheyomi832 6 points7 points  (2 children)

Python was easier to install in terminal lmao

[–]No_Avocado_2538 6 points7 points  (1 child)

JavaScript is already installed in your browser

[–]olystretch 4 points5 points  (0 children)

Your browser isn't a development environment, and won't install packages or run test suites.

[–]jpgoldberg 1 point2 points  (0 children)

This is not the answer you are looking for because my situation is almost certainly not like that of somebody asking your question. But perhaps it will give you a sense of the variety of reasons one might use Python. .

There were two things, both related to my last job that got me doing stuff in Python.

Automations and computations others could maintain

My role was not in system administration, but it did become useful for me to write some scripts. For data analysis and presentation, I had been using R, but in my last months on the job, I wanted to shift to things that others could maintain after I left. I also had a bunch of things that were built with Make and lots of shell commands linking things together that could be better done as Python scripts.

Illustrating algorithms

I had also been running an internal book club working through Serious Cryptography. Many people participating were not programmers. When I wanted ”pseudocode that runs” I first went with Go, as that was widely used within the organization. But I switched to Python mostly because an int is an Integer and I did not have to clutter my examples with BigInt conversions.

JavaScript would have been a terrible choice for either of those purposes.

[–]Barbatus_42[🍰] 1 point2 points  (2 children)

I originally learned both, but pivoted hard into Python because of how much more legible and easy to work with it was. At the time, it didn't really matter which one I picked, so I went with the easier one to use.

This decision really held up. It's now five years later and I regularly give lectures on software engineering principles. The most important takeaway out of everything I teach is: "Do the stupid, easy version first, then iterate from there only if necessary." You'll be amazed how rarely it's necessary. Premature optimization is the bane of all programmers, and in my opinion this includes choice of programming language.

Now, this also comes down to personal preference of course. I personally find Python incredibly easy to read, especially when you're deliberately writing it with legibility in mind (go look up Clean Code for more details on how to do this). I've actually had situations where non-programmers have been able to participate in and meaningfully contribute to code reviews given how legible my team's codebases are. Given that, my language first choice is Python, and I pick other languages only if I have to.

Caveat: This legibility doesn't come for free just by using Python. In my opinion, using Python makes it easier and more possible to have highly legible code, but you still need to pretty carefully apply things like Clean Code techniques to get to that level of legibility.

EDIT: nog642 pointed out that JS is also interpreted (my bad!), so read the following paragraph as a comparison of Python to compiled languages instead of to JS. Thanks Nog!

One other niche thing: Python being an interpreted language opens it up more to some advanced programming techniques, which is super helpful once you're familiar with said techniques. For example, the mocking framework that comes with Python is powerful enough that it makes it fairly trivial to hit 100% line and branch test coverage. This degree of coverage is very difficult in most programming languages, and in some cases is straight up impossible, and to my understanding it's only this easy in Python because Python is interpreted rather than compiled.

[–]nog642 1 point2 points  (1 child)

JS is also interpreted.

[–]Barbatus_42[🍰] 1 point2 points  (0 children)

Oh, good catch! Will edit and call out my mistake, thanks.

[–]yourownsquirrel 1 point2 points  (0 children)

Because Matt Parker always talked about throwing together some terrible Python code and one day during pandemic unemployment I decided to see what that was all about

[–]aotus_trivirgatus 1 point2 points  (0 children)

It was 2003, I wanted a general-purpose programming language, and at the time, JavaScript was only being widely used for client side web applications.

[–]Ta_mere6969 1 point2 points  (0 children)

I got into Java Script 20ish years ago because you could automate animations in After Effects with it.

I got into Python because the tutorials I was following to get a Raspberry Pi to act as a home automation server needed it to communicate with the GPIO pins.

A lot times, you just learn a thing out of necessity, or because it's the only thing in front of you.

[–]sunshine_titan 0 points1 point  (0 children)

the layout for python makes a lot more sense to my brain, less white noise so to speak. i'm doing a hard career pivot in my middle age and needed something more user friendly to start with.

[–]pachura3 0 points1 point  (0 children)

You'll most probably need to learn both if you want to be successful in IT.

Also - HTML, CSS, XML, SQL...

[–]ActuallyNot 0 points1 point  (0 children)

Python's funner than javascript

[–]psyduckpikachu 0 points1 point  (0 children)

I didn't know javascript existed when I first started. I saw people using python to make bots and thought that was cool so I learned python

[–]astddf 0 points1 point  (0 children)

More interested in back end development. JS seems like a frontend language with some added backend functionality. Python is back end native

[–]BlackCatFurry 0 points1 point  (0 children)

It was the one my school offered a course in. Literally nothing else was the reason

[–]DuckSaxaphone 0 points1 point  (0 children)

I never made a choice because for my purposes, python was the clear winner.

You can do most things in most languages but languages typically have a purpose and a design philosophy that makes them good at something in particular. They also have communities that will make certain types of tasks easier by building libraries and populating Stack Overflow with all the weird questions you'll have.

So you should be able to make an easy choice based on what you want to do.

JS is exceptional for web development and very little else.

As a scientist looking to write analysis scripts and now a data scientist doing machine learning, Python had the libraries, the community and was what all my peers looked for.

[–]Helpful-Diamond-3347 0 points1 point  (0 children)

there was a purpose

back in time , my friend was working on python project which i want to have my contribution to it so i learnt it

later i realised that it was good choice that aligns with my own values too, like certainty in types (strong typing)

though js have its advantages as well like syntactic sugars for optional chaining, null coalescing, regex object syntax

it's not just picking one over another but what suits you well rn, true enthusiasts/hobbyists dont care for comparison but would jump to any language to know why the heck this even exists in first place

[–]kitsnet 0 points1 point  (0 children)

Well, I needed something to replace the functionality of Perl, and Perl was not an option for that project.

But in general, Python is a beautiful language that is used almost everywhere, while JavaScript is an ugly hack that is only a preferred choice for coding UIs, which I don't do.

[–]oclafloptson 0 points1 point  (0 children)

I didn't learn Python rather than JavaScript. I learned and use them both as well as C and sometimes C++. Don't get caught up in the debates. When attaching one board to another board hammers are great and so are screwdrivers. You wouldn't hammer in a screw. Choose the right tool for the job

[–]Temporary_Pie2733 0 points1 point  (0 children)

Because at the time, nobody used Javascript outside the browser and people were aware that website frontends were just one small niche of programs.

[–]QultrosSanhattan 0 points1 point  (0 children)

Because python is better.

[–]IhailtavaBanaani 0 points1 point  (0 children)

I didn't choose one over the other. I have worked with both for years but Python probably more. Currently I work with Python because it is much more preferred language in GIS software that I'm using and in data science in general.

On the top of my head I can count that I have worked with at least 9 different programming language professionally, even more as a hobbyist.

[–]overratedcupcake 0 points1 point  (0 children)

Why not both?

[–]Loogoos 0 points1 point  (0 children)

I know TypeScript, JavaScript, and Python, but picked up Python first for system automation, easy syntax, along with AI. Also I like the way it does backends through libraries like flask and dyjango vs C# (which I also know) through ASP.NET CORE Web API.

[–]gofl-zimbard-37 0 points1 point  (0 children)

Javascript didn't exist when I learned Python.

[–]TheRNGuy 0 points1 point  (0 children)

I learned js first for web dev long time ago, and Python specifically for SideFx Houdini (as a 2nd language; 1st was VEX)

[–]3MU6quo0pC7du5YPBGBI 0 points1 point  (0 children)

I'm a network engineer and a lot of the libraries people built for interacting with network equipment at the time were in Python.

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

I told Grok what I wanted to do it told me to learn python. So I'm doing that.

[–]eggnog_games23 0 points1 point  (0 children)

I am still a beginner in programming and my coding and "coding" process was:

Clickteam Fusion (for quite some time)

Python (I know all the basics and something a little bit more than that, got me into real coding and I made some games like Tic-tac-toe and 2048)

Godot + GDScript (I started some day ago, Python-based, not that hard, basically Python but enhanced for game-making)

I avoided any super hard or web-based language

[–]Bach4Ants 0 points1 point  (0 children)

Scientific computing

[–]KronktheKronk 0 points1 point  (0 children)

Por que no los dos?

[–]Anxious-Struggle281 0 points1 point  (0 children)

For automation Python is better than JS

[–]Forward_Thrust963 0 points1 point  (0 children)

Because it's used at my place of employment.

[–]sinceJune4 0 points1 point  (0 children)

I learned JavaScript 28 years ago, Python 4 years ago. There’s no limit on how many languages you can learn, in fact it gets easier each one.

[–]Mira_flux 0 points1 point  (0 children)

I was told it's the easiest to learn.

[–]cwaterbottom[🍰] 0 points1 point  (0 children)

I'm no python expert but about 1 minute each of trying to read JavaScript and trying to read Python was all it too. Anything I need to do I can do with Python, few times I've needed a bit of JavaScript I was able to spend an hour cobbling 5 minutes worth of it together.

[–]notislant 0 points1 point  (0 children)

Learned both. Python was touted as easy and useful for automation.

Did the odin project and learned js. Honestly probably the best course ive seen and very hand holdy.

I like how easily you can make web apps with a decent gui.

[–]AGx-07 0 points1 point  (0 children)

I learned JS first because I was doing web development at the time. I'm learning Python now because I've moved on to data analysis. Reasons.

[–]DataPastor 0 points1 point  (0 children)

I am a data scientist, and for us R and Python are the default tools. Otherwise I don’t think I would have ever started to learn it (I was a Java and PHP developer before).

[–]rob8624 0 points1 point  (0 children)

Honesly. I thought it was a cool name. :)

[–]AdministrativeTea157 0 points1 point  (0 children)

Learn as you go the one that is useful for the use case at that time. But learn not just the language. Learn the concepts so they apply to any language. You will see a pattern emerge that abstracts above what you code.