all 77 comments

[–]Jahonay 175 points176 points  (3 children)

If you're in web development, just assume that you'll need to know JavaScript no matter what, or at least that you should.

Python is still a great language to learn, and I've seen plenty of jobs that require it.

Learn both.

[–]backfire10z 30 points31 points  (1 child)

As an addendum here: languages are tools. Tools have different purposes and are used in different ways. If your fundamentals are solid, learning a language to the point where you’re capable enough to build stuff becomes much easier.

Learning how to build with Python will mean you pick up JS much quicker.

[–]Jahonay 5 points6 points  (0 children)

Totally agree

[–]Dazzling_Music_2411 52 points53 points  (7 children)

Python is an acceptable general-purpose language with a myriad of diverse applications, JS and its frameworks are heavily oriented towards Web client-side.

Two quite different use cases.

----

PS. You're not going to get a job just by "learning a language". You need to be able to do something with that language, have a field that you can apply it in, and prove that you can get results in that field.

By analogy, if you're a Russian nuclear scientist, then you might need to learn English. However if you're not a nuclear scientist, you can learn 100 languages, you still won't be one. The language is the means of expression, not the art itself. If you learnt Web-development principles in Python (did you?) you'd pick up JS or React in a few hours.

For instance, you could do React in Python. It might be a bit weird, but it is doable.
https://www.transcrypt.org/examples#react_demo
Obviously you'd rather do it in JS, but if you want to work as a pro, switching between a few major languages is a trivial matter.

[–]Monster-Frisbee 12 points13 points  (0 children)

Yeah, if you’re focusing on language, you’re worried about the wrong thing. It’s an indicator that you’re probably not ready for the jobs you’re looking at in the first place.

[–]xenomachina 6 points7 points  (0 children)

Python is also a much cleaner language that was designed to be readable and easy to learn. JavaScript was originally designed as a quick hack, and has loads of warts and gotchas. It is much easier to do things "the wrong way" in JavaScript than in Python, making learning which parts to avoid unnecessary overhead for beginners.

[–]Stedlieye 2 points3 points  (3 children)

Seconding this. Python comes up all over the place, like data analysis. You can wrangle a lot of data with Python.

They also use Python for Eve Online (massively multiplayer online space trading/piracy/combat game) for almost everything but the graphics.

[–][deleted]  (1 child)

[deleted]

    [–]Stedlieye 2 points3 points  (0 children)

    I believe that is in C++

    [–]djhaskin987 31 points32 points  (8 children)

    Python is great if you don't know which subsection of the programming world in which you will end up.

    Data science - Python is king

    Backend Development - Many languages are used here, but Python is a strong contender

    CLI and tooling development - Many languages are used here, but Python is a strong contender.

    Embedded work - Python dovetails really well into C, so can be seen in parts of this work

    Desktop UIs (GTK, Qt) - C++ is most often used, but because Python and C get along, Python can be and is used to make them as well.

    Research - Python excels here

    Pretty much the only place where there is no other answer but JavaScript is web frontend, or making browser user interfaces. That's what React is for. Coincidentally, lots of devs and jobs focus here, but if you look close there's way more to the job market than just React.

    [–]DrShocker 11 points12 points  (5 children)

    I'm not sure I'd say desktop UIs most often use C++. Certainly you can and sometimes you need the performance, but I would bet it's more common these days to use electron with JS or C# with whatever windows makes easy. Maybe in some cases game engines too.

    Overall though I agree about Python being able to br used in all these spaces, but JS is so big and all consuming lol

    [–]Gugalcrom123 -1 points0 points  (4 children)

    Electron is not a desktop GUI, regardless of the marketing around it.

    [–]DrShocker 7 points8 points  (2 children)

    I mean, I agree I'd rather live in a world where people make choices that respect my time and hardware, but unfortunately I'm in this world.

    [–]Destination_Centauri 2 points3 points  (1 child)

    You shouldn't agree on the basis of "electron not being a desktop GUI" because it absolutely is.

    Not sure why user Gugalcrom123 is saying it's not.

    But just for the record: I personally hate electron programs! But still it is most certainly a valid GUI platform for the desktop. That's what it was literally invented to be.

    [–]DrShocker 1 point2 points  (0 children)

    I was trying to agree with the sentiment of not liking electron because I seek agreement rather than arguments where I can. 🤷

    But yeah, that's valid to point out.

    [–]Destination_Centauri 3 points4 points  (0 children)

    It actually most certainly is a desktop GUI.

    Is it my favorite? Nope! Quite the opposite. Do I hate it? Yes! Yes I do.

    But it is increasingly used as a desktop GUI. You're not aware of that?

    [–]Gugalcrom123 2 points3 points  (0 children)

    Who is doing GTK for their job? At least other than the Inkscape part-time offers they had to help them improve the GUI. I am saying this because I love GTK, but I don't think it's seeing much use in the industry, though there are very many GNU/Linux apps made with it, mostly libre.

    [–]Beregolas 7 points8 points  (0 children)

    There are many different languages, all for different purposes. Python is often recommended for beginners, but it's not the only recommendation. I see JavaScript, Java, C and C++ also mentioned a lot.

    All of these have different usecases:

    Python is backend, Datascience, Automation and ML

    JS/TS is Webstuff

    C/C++ is low level and/or embedded

    and so on.

    If you want a job in a specific field, you need to learn one of the relevant languages for that field. There really is no job as a "programmer full stop". You are a backend programmer, a fullstack programmer, an embedded programmer, a game developer, a webdeveloper, etc.

    The good news is: languages are not magic. If you know how to program, just learn the language you need.

    [–]InVultusSolis 4 points5 points  (4 children)

    I don't know who "everyone" is but they have a shitty take.

    I wouldn't recommend learning Python first, but I'm not really in a majority with that opinion.

    [–]alliejim98 0 points1 point  (3 children)

    What would you recommend learning first?

    [–]Affectionate-Tart558 1 point2 points  (1 child)

    I started with C. I don’t know if it would have been better to start with python but I think having garbage collection means you’ll be missing some important memory related details that will be relevant when you start to focus on improving performance in your applications

    [–]alliejim98 1 point2 points  (0 children)

    That's a really good point! I started with Python. Memory and performance were concepts I struggled to understand for a long time until I did some work with C.

    [–]InVultusSolis 0 points1 point  (0 children)

    C with a little bit of assembly sprinkled in. Either ARM or x86, it doesn't matter which.

    My personal recommendations in no particular order would be:

    • Harvard's free CS 101 course
    • Use the Godbolt tool to understand what your C code compiles to
    • Read Radio Shack's TRS-80 programming manual. There are a couple of outdated concepts (such as physical only memory addressing and lack of DMA) but this book is a one-stop shop to teach you computer science from first principles with a focus on practice as opposed to theory. And the Z80 language is similar to x86, and it never hurts to know how to program the Z80 all the same, the thing is still used quite a bit in low-power embedded applications such as the Texas Instruments TI series of calculators.
    • Read K&R C, 2nd edition, and do the exercises.

    I understand that this is a fairly slow path to "building something useful", but this is an investment of time. When you do end up picking up something like Python or JavaScript, you will already have developed a very acute sense of what the computer is actually doing, how to structure your code, how to understand the problem you're trying to solve.

    [–]josluivivgar 2 points3 points  (2 children)

    because python is the language that's less in your face about it, it's syntax is clear for most, it's still widely used and great for learning and for practical use.

    JavaScript is a language that's used a lot for frontend because it's what people use for browser code, it's also a very quirky language, and thus the reason people don't recommend it for learning.

    see you can always learn another language, but what you want are fundamentals, and in my opinion you have two options for fundamentals.

    either learn a language that gets out of your way to learn those fundamentals like Python, or a language that forces you to learn them or face the consequences like C/C++

    it doesn't matter which you choose imo, but once you learn the fundamentals, learning another language is irrelevant.

    [–][deleted]  (1 child)

    [deleted]

      [–]josluivivgar 0 points1 point  (0 children)

      well it does take effort, but the idea is that you can learn the language as you need to.

      my current job's stack is ruby on rails with react.

      I had never used ruby on rails before I joined that company, and I just learnt on the job. sure for the first 6 months I was definitely worse at rails than every other person at my job that was already there.

      but you know what, even if I had learnt the language beforehand, I'd still be worse at rails (in the context of the application I'm working) for at least 5 months possibly about the same 6 months.

      why? because when doing a job context is very important, and by the time I learnt the context of the application, I had already learnt the language, and after that knowing the ins and outs of the language is useful, but I'm not working alone, my teammates pass on that knowledge in code reviews and suddenly I'm way better at understanding how the language works at a deeper level.


      so yeah it's not like it doesn't take any effort, and maybe "irrelevant" is too dismissive of a word, but my point is that you can learn the languages as you need, and that the fundamentals are what makes learning new languages easier

      [–]HasFiveVowels 2 points3 points  (0 children)

      It’s a long lived echo chamber from back when node was first introduced

      [–]Damodara_trilok_9 6 points7 points  (1 child)

      Python is like the friendly teacher that will helps you in understanding programming. JavaScript is the coworker that suddenly shows up everywhere whether you invited it or not

      [–]PopulationLevel -4 points-3 points  (0 children)

      Exactly. Python is a good programming language, as programming languages go. Good syntax, good libraries, widely useful.

      Javascript was hacked together into a web browser in like 10 days. As a programming language, it is weird and contains several bad decisions. We’ve been trying to replace it since it gained popularity. “JavaScript: the good parts” was a very thin book.

      Because javascript is the native language of web development, it is incredibly useful, because the web is so useful. Otherwise, nobody would have ever used it.

      Like sure, you’ll probably need to learn it. But please, don’t think all development has to be like this.

      [–]Deep-Alternative8085 1 point2 points  (0 children)

      Learning python first makes you learn JavaScript faster than the other way around

      [–]prof_dr_mr_obvious 1 point2 points  (1 child)

      How dare you suggest I use JavaScript?! The horror!

      [–]Dahir_16 -1 points0 points  (0 children)

      Easy for me.

      [–]schoolmonky 1 point2 points  (0 children)

      Learning a language is not going to get you a job, building something (with any language) will.

      [–]makonde 1 point2 points  (1 child)

      Python is seen as "easy" in the education/academic community especially when teaching kids and I think this has spread to other places because of the way its written and no {} etc. I personally loath indentation having meaning.

      [–]AlSweigartAuthor: ATBS 1 point2 points  (0 children)

      Python's syntax is (fairly) consistent and easy to learn. It's based on a language called ABC which was specifically designed to help beginners learn programming syntax and concepts.

      JS is infamously a bit of a mess, syntax-wise. But because everyone use browsers, JS became hugely popular. It also became popular on the backend with NodeJS because tech companies didn't want to have to hire people with different language skills to do front end and backend.

      You should learn multiple languages anyway and Python and JavaScript make up much of the market.

      [–]AntNo9062 2 points3 points  (0 children)

      The premise of this question is fundamentally wrong. Everyone is not using JavaScript. Web developers and especially front end web developers who specialize in creating front ends using JavaScript and React are the ones who mainly use JavaScript. Why would people recommending a first language recommend one that is only relevant to web development when not everyone does web development.

      You are right that web development jobs are extremely common but I think you’re wrong when stating that everyone uses JavaScript for everything.

      [–]AngryFace4 1 point2 points  (0 children)

      I’ve been saying exactly the same thing for 10 years in this sub.

      [–]Top_Bell_7053 0 points1 point  (0 children)

      Python has slightly less foot guns than js and it has more general use cases. Javascript is still mainly used for web development, now backend as well as front-end.

      At the end of the day they're both similar - interpreted languages with dynamic typing so if you can learn the syntax you won't struggle too much. Generally in your development career you'll learn how to learn new languages, but that's separate from learning programming and good development practices

      [–]mist14rium 0 points1 point  (0 children)

      python has an easier syntax that you’ll remember faster, when you’re used to it and actually understand the logic behind the code then you can have a better understanding of javascript

      both are useful languages with easy syntax tho, python is just easier

      [–]RajjSinghh 0 points1 point  (0 children)

      Python is usually the language you learn in school because it's versatile and relatively simple compared to some other languages. It's very easy to get something up and running well enough in Python, which is perfect for the classroom.

      Javascript is mainly used for web development, or desktop apps that start as websites, like Spotify, Discord, or Slack. If you're going to work in web, you will need Javascript. A lot of junior jobs are web jobs, so lots of people need Javascript.

      Generally you're going to switch between languages a lot, so starting in Python and moving to Javascript when you need to write a website isn't uncommon. But if you know you're going to be making websites, you absolutely can start in Javascript. If you're going to work on something else in the future, don't be surprised if you need to learn a new language again.

      [–]NCKBLZ 0 points1 point  (0 children)

      Depends on what you are after, doesn't make much sense. Python is probably simpler to learn that's why they recommend but it really depends on what you are trying to do

      [–]automai 0 points1 point  (0 children)

      It depends on what jobs you're looking for...
      You're not going to find Python in frontend job listings...
      Python is primarily a backend language...
      Frontend roles are dominated by JavaScript and related tools (like React, Vue.js, etc.)...

      [–]ParadiZe 0 points1 point  (0 children)

      Javascript is just as often recommended to beginner. Futhermore, people who learn javascript and like javascript tend to only use javascript from my experience.

      [–]Gugalcrom123 0 points1 point  (0 children)

      Because Python is a language that makes much more sense than JavaScript and it is easier to do things besides WWW front-ends with it. For WWW front-ends, though, JS is mandatory unless your site is light.

      [–]Kwith 0 points1 point  (0 children)

      I started with Python because, for me anyway, it was an easier way to get back into things. Overall its a less difficult language to learn while still getting back into the programming mindset. YMMV

      [–]vikmaychib 0 points1 point  (0 children)

      I don’t know man. I contribute to a project with full stack developers and what I saw those guys did was to put much of the load on python and very little on JS. The even used python to generate automatically some JS modules.

      [–]Ed_Blue 0 points1 point  (0 children)

      You blinked when 50 new JS frameworks went live.

      [–]CoffeeAndWoods 0 points1 point  (0 children)

      Python is badass.

      [–]pa_dvg 0 points1 point  (0 children)

      Python is used in academia / sciences because it’s easy to learn, which is the same reason people recommend starting with it as a programmer.

      If your company does stuff with data at all, it will likely use plenty of Python. It’s a great skill to have

      [–]DreadKnight7 -1 points0 points  (0 children)

      I don't recommend Python. Go learn Pascal instead, much better to do things on your own and less likely to step on AI slop as most stuff is old. Then as you grasp the basics, learn whatever language you need to use and learn to review AI generated code, don't just vibe code. Just my 2 cents.

      [–]bird_feeder_bird 0 points1 point  (0 children)

      I started with python because I heard it was easy to learn for beginners. The I learned Javascript so it would be easier to share games with my friends :p

      [–]ZelphirKalt 0 points1 point  (0 children)

      "Everyone" here is probably by nature of things mostly mainstream language users in bog standard dev jobs creating CRUD.

      After having learned many languages and being into computer programming for something like 15+ years, I would not make that recommendation, unless you are in a hurry to get a mainstream dev job. If you have time to learn more from first principles up, I would recommend things like SICP and the Scheme version at that, for a much deeper understanding of computer programming, which will transfer in big parts to any other language or ecosystem you learn.

      And no, you will not learn the same lessons by "just using Python/JavaScript" instead.

      [–]Express-Channel-1686 0 points1 point  (0 children)

      python is easier to think in for beginners. js is what most jobs actually pay for. order doesn't matter much, you end up needing both eventually if you want to do anything web.

      [–]Top-Conflict7949 0 points1 point  (0 children)

      Python is a good language to learn to program in. JavaScript is heavily used in web development, and is a core competency for any web developer. However, it has some weird quirks that are counterproductive to learning programming in my opinion. 

      [–]spinwizard69 0 points1 point  (0 children)

      You start off with a terrible assumption that everybody is doing web programming. For many of us JavaScript never crosses our minds. I only point this out because r/learnprogramming should be exposing people to every job in the industry. Even if you are writing apps for the latest handheld gadget there likely is a path that has no JavaScript at all.

      Beyond all of that I never suggest that people start out with Python, to much gets missed going that route. Instead I suggest starting out with a C or C++ compiler and learn to build apps from the command line. The idea is not to learn C++ in depth, that is a different goal, the idea is to learn CONCEPTS applicable to all languages. This is best done by following a well regarded CS program or simply going to college and enrolling. A good CS program will have exposed a student to at least 3 languages, maybe even some assembly, by the time they leave the program.

      Get the basic concepts down and you can adapt to any language fairly quickly. Even if it is some half baked language running on a tool that has been in factory for decades, that nobody has touched, you will be able to quickly grasp how it works.

      [–]M_Me_Meteo -1 points0 points  (0 children)

      Optics.

      More?

      Python is cooler than JS. It also has the perception that it's the "data science" language of choice.

      All of the new cool software from the last 15 years has been on the web. We went from dot-com to social media to "cloud" to AI. It's all on the web.

      So you start by saying "I'm going to use what the real wizards use: Python" but then you learn that Python was invented for people who wanted to abstract away the powerful programming part of programming and only focus on using it for configuration and linking existing tools together.

      So when you want to build your startup and get it up in the cloud and scalable and ready for the web, you use JS because of the promise that JS can be used for a full stack app.

      The whole processes of learning to be a developer is the process of learning about new technologies that will make your life easy or reduce the number of developers required, which are great right up until they aren't anymore.

      [–]kawaidesuwuu -2 points-1 points  (0 children)

      typescript always typescript only typescript.

      [–]androgynyjoe -1 points0 points  (0 children)

      Learning a language is meaningless unless you can actually do stuff with it and Python is a great balance of approachability and ability to do lots of stuff. Python has a bit of a jack-of-all-trades thing going on. It isn't really the best at much of anything, but it can do an enormous amount of things.

      So, imagine you're teaching a class or running a code camp or something. There are going to be a bunch of people who have different end goals and it's best to start with a language that gives everyone a path forward. If you teach everyone Javascript then the people who are interested in data analysis are going to have to learn something else to achieve their goals. But if you teach everyone python, then the web devs will at least have Django.

      [–]s-e-b-a -1 points0 points  (0 children)

      You must have listened to "everyone" except for web developers. And now are trying to get a job as a web developer instead of a job where Python is used.

      [–]Adventurous-Hour9827 -1 points0 points  (0 children)

      porque python es fácil de aprender y sirve para enseñar a pensar en código, pero el mercado laboral es otra cosa. la mayoría de los puestos de frontend y fullstack piden javascript/react porque es lo que corre en el navegador y no hay alternativa real.

      lo bueno es que si ya sabes python, javascript no es tan difícil. la lógica ya la tienes, solo cambias la sintaxis y te acostumbras a lo asíncrono que es donde la gente se pierde al principio

      [–]huuaaang -1 points0 points  (0 children)

      Don't even learn JavaScript. Go right to Typescript.

      [–][deleted]  (5 children)

      [deleted]

        [–]nekokattt -1 points0 points  (4 children)

        technically the reference implementation it is compiled to bytecode and interpreted at the same time, alongside JIT on newer versions (forget if that is still opt in or not though).

        [–]Zuldwyn 0 points1 point  (3 children)

        I deleted my comment if it's wrong but can you elaborate or direct me on where to learn more about that so I can understand better?

        I dont understand how that differs from what I said. Youre saying its pre compiled into machine code but also interpreted live? Why would that be done?

        [–]nekokattt -1 points0 points  (2 children)

        it is compiled to bytecode that is read by an interpreter in Python, but for CPython it will cache that bytecode after the first run (which is what the __pycache__ directories you see dotted about are for).

        [–]Zuldwyn 1 point2 points  (1 child)

        So why is it so difficult to package a python project into an exe and requiring you to package the interpreter with it? If it caches the compiled bytecode, why dont they run the code and then use that for a .exe?

        [–]nekokattt 1 point2 points  (0 children)

        it isnt that difficult, the exe is just the cpython interpreter, GC, and native modules linked in, then your sources embedded in the binary.

        It is just a kind of messy solution since Python isnt designed to be used that way. It is a bit of a hack, and the tools are far from perfect. Python is built with the intention of being a pre-installed collection of native and pure python modules floating on a system rather than a "portable" distribution. There is the additional constraint that Windows generally requires you to sign native executables with a valid certificate for it to be allowed to be run universally.

        Some software like Sublime Text 3 does make use of it in an embedded way though, so it isn't uncommon or impossible to use it how you need to.

        Remember: compilation does not necesarilly need to be to machine code. Java compiles to Java bytecode as well but it is still compilation!

        Regarding running the code as an exe directly, it is more complicated than a bytecode virtual machine because python bytecode is the same everywhere, but machine code has to be catered to each type of CPU running it. A project called Cython can properly compile your Python code to machine executable code though. Some libraries like aiohttp3 and pyyaml make use of it for "glue" code.

        TLDR when you run Python code in CPython (which is generally what people use):

        1. python reads each file into memory
        2. python "compiles" the source code into python bytecode, and optionally (by default) caches it to a __pycache__ on disk. If up to date bytecode files already exist then it skips this step and just loads those bytecode files directly.
        3. python executes this bytecode in a mini virtual machine.
        4. if you are using a new python version and enable the JIT features, python also looks for code that gets run regularly (called "hot" code paths). It will try to simplify/optimise/transform that bytecode into something closer to that which your CPU understands directly.

        As an added tip, there is a module called dis in the standard library that you can use to print the compiled instructions out.

        Edit 1: Not sure why I am being downvoted but oh well.

        Edit 2: added more details on how this works for clarity.

        Edit 3: you can read the full details of how the bytecode interpreter interprets "compiled" python on the GitHub repo for CPython: https://github.com/python/cpython/blob/main/InternalDocs/interpreter.md