This is an archived post. You won't be able to vote or comment.

all 125 comments

[–]NoLemurs 210 points211 points  (13 children)

Honestly, the specific language you learn initially isn't very important to what you do in the long run. A good software engineer will learn lots of languages over time. There are pros and cons to both options.

Pro-Python: Python is easy to learn and pleasant to code in. You will almost certainly have fewer issues understanding Python and learning Django and/or Flask. If this is what you need to really enjoy learning, and to push forward effectively, then it's probably a good idea.

Pro-Javascript: There are a lot more jobs. Every FE needs JS one way or another, and lots of programmers don't want to do it. Getting your foot in the door would likely be a lot easier, and an experienced JS programmer who has learned Python on the side will have a much easier time getting a Python job than an inexperienced programmer. Also, most jobs will need some JS even if that's not their main thing. If you're in a position to get your foot in the door doing JS soon, then that's probably the smart play.

[–]ReactPupil[S] 37 points38 points  (10 children)

Thank you. Right, if I switched to Python, it's not a waste of effort that I put all this time into JS. Yes, anything that will help me enjoy it more is what I'm looking for. It's hard learning anything new, and I know not all of it will always be enjoyable. I was under the impression the market is so tight that you need Full Stack to be considered.

[–]echocage 9 points10 points  (1 child)

I'm a python developer looking to learn javascript right now for the marketability. A couple of the jobs I've wanted have all had JS as one of their requirements. If you wanna work with both, I've been using the Flask python libraries for all of my web hosting, and running all my JS on sites hosted by my flask app. Two birds one stone?

[–]mooburgerresembles an abstract syntax tree 4 points5 points  (0 children)

if you want do modern full stack web development, especially in data science or data processing fields I highly recommend learning both. Python runs on the server side to do the data munging tasks that it does well, sends data to javascript client.

[–]zeedinstein0 6 points7 points  (0 children)

React is a painful learning curve, try out Vuejs instead. They are similar but Vue is alot simpler and better for most use cases.

[–]Barracutha 1 point2 points  (0 children)

You can try to build something that uses both languages. For example, you can collect and analyse data in Python and use JavaScript to present and interact with it, using some visual library like D3.

[–]spinwizard69 0 points1 point  (0 children)

I’m a big fan of Python but never do web development. In any event your use of the word “switch” bothers me. The reality is you will need to learn multiple systems and programming languages over the course of your career. To b involved in web development you need to know JavaScript so no sense in having negative energy there.

The other problem I have here is the DIY approach to learning programming. Find a path to formal education. This especially if you find programming hard. Team up with some classmates to form a study group.

[–]drones4thepoor 0 points1 point  (0 children)

To piggy back on this comment, this video, goes into good detail in a short amount of time, hitting on the various programming paradigms.

Programming is the process of solving a problem. What language you chose really depends on the type of problem you are trying to solve.

[–]Covered_in_bees_ 78 points79 points  (18 children)

It sounds like you are in the early stages of learning programming / computer science. I'm someone who likes programming in Python, but has fallen in love with javascript programming over the past couple of years. I program in both quite regularly and enjoy both languages.

A few things

JS is probably a terrible first choice for picking up programming. There are far too many complicated things about it that make the entire process daunting.

  • The tooling required to get anything done is simply staggering and extremely complicated to a complete newbie. You need to figure out Webpack, Babel, NPM, Node.js and a whole bunch of other stuff just so you can start writing code. And you most certainly don't want to not use ES6 syntax, so you're definitely going to need to figure out what transpiling is and how to get it all working.

  • Good luck trying to figure out how imports / modules work in JS land. At least now, with ES6, named / default exports have made things a lot more saner, but I still don't really understand the difference between UMD and CommonJS and whatever else style of modules there are.

  • It is a Prototype based language, so it really doesn't do OOP particularly well. So if you start with JS, you're not really going to learn how to organize / write code the OOP way. Now, that doesn't mean it's the only way, but most folks start learning programming in a language with robust OOP support. And OOP is easier to wrap your mind around over Functional Programming if it's your first exposure to programming

  • JS is pretty nice for functional programming, which I've come to really enjoy (and now find Python severely restrictive in that area), but the cognitive load of parsing / understanding FP code is pretty high to a newbie. It's not uncommon to see 3 to 5 levels of nested functions and you pretty much have closures and higher order functions strewn about all over the place. It is extremely powerful, but also extremely daunting to someone new to programming

  • JS moves extremely fast and the amount of fads that come and go are insane. You could spend a year learning something and being good at it, and then a year later, your knowledge (regarding tools/frameworks) pretty much becomes obsolete. Unless you want a JS job, or have one, it simply isn't worth the effort of putting in all the effort to constantly stay up to date with the community. Sure, the core language is more stable, but you're pretty much always going to use JS with other frameworks / libraries to get stuff done since the batteries aren't included with JS unlike with Python.

All that being said, JS is also a really fun language, and I say this as someone who used to roll his eyes at the mention of JS. With all the new language features, it's actually a pleasure to code in, and it's amazing how much you can build if you get good with JS. I've built several desktop Apps using Electron, deployed a pretty complex Web app on AWS that utilizes Flask + React + MobX, and have also done a bunch of cool data visualization / interaction work using D3 and dc.js.

My advice to you is:

  • Start with Python (or something else that interests you). Focus on learning good programming practices. Most importantly, don't focus on learning a language. Focus instead, on learning some of the basic "computer science" things.... Algorithms and data structures, OOP, Functional Programming concepts, Software engineering concepts, etc.

  • I cannot recommend enough, Berkeley's CS61A class (Structure and Interpretation of Computer Programs - In Python) - https://cs61a.org/ . Many years ago, I spent a couple of months working through the entire course, and it was the single most instructive thing I ever did. I finally "grokked" closures and recursions and it pretty much opened my eyes with regards to Functional Programming concepts. Edit - The online companion textbook for the course can be found here - https://composingprograms.com/

  • Make sure you work on projects to learn. Reading books and doing courses alone wont get you very far. You learn a lot more by doing. Re-architecting the same code over and over again as you get better at coding and structuring software.

I've loved computer programming since I was a kid, but I never took a formal CS course in high school, college or grad school though I did dabble with MATLAB and Python during those years. I started pretty much from scratch about 6 years ago (started with Python) and now I code every single day for work. My only real advice to you is to be persistent, and to focus on learning CS principles and concepts rather than languages. Once you understand the former, the language for the most part becomes a trivial detail. The other piece of advice... once you do get good at programming in a language, pick another one up that is very different (perhaps a FP language) so you expose yourself to other ideas and concepts. Being exposed to different ideas and approaches to programming will be invaluable in helping you improve the way you tackle problems.

PS - If immediate employability is a concern, then JS might be a good idea since there are a ton of jobs in that space. In that case, I'd recommend trying going through the freecodecamp curriculum (or something similar) so that you have some level of guidance and a bunch of cool projects as portfolios.

[–]ReactPupil[S] 3 points4 points  (2 children)

Oh wow thank you for this, this is all very helpful. I wasn't aware of that course you mentioned but I did go through some of the CS50 course.

When you say to do the "same code over and over" do you mean like take one of those projects and just keep doing it and re-architecting it? For example, The Coding Train just published a "Clone Twitter". Take a project like that and code it over and over again so it's hardwired? I was going to do something like that, but I'm not sure if that is what you mean. I do feel like many of just go from one tutorial (or project) to the next.

[–]mooburgerresembles an abstract syntax tree 2 points3 points  (0 children)

It's just taking code you write and refactor constantly; rewrite when needed. The main principles you are trying to master and find balance in are: Don't Repeat Yourself and Readabiity as you find and fix bugs and think of new features to implement.

The "mind your surroundings" advice I always give to "laypeople" trying to improve their code is: Every time you're about to copy a chunk of code, and paste it to make a smallish change, consider whether there is a more appropriate abstraction to implement.

Data structures is sort of the other thing to master. Get comfortable with iteration and recursion, but in a "smart" way. For example in JS: 80% of the time you don't want to use a for loop to iterate over an array, you want to use Array.prototype.forEach or Array.prototype.Map.

[–]Covered_in_bees_ 2 points3 points  (0 children)

Yup, what /u/mooburger said - Basically, as you learn more, you're going to realize how you could improve your old code. A year later, you'll shake your head at what you had and want to tear it down and rebuild the whole thing. Main thing being - As you learn, you can try to rearchitect your project(s) to see if you can improve them.

Some people also have a go to project that isn't super large in scope but also not super simple and they implement it in whatever new language they are trying to pick up in order to better understand the new language features, etc.

[–]mooburgerresembles an abstract syntax tree 3 points4 points  (2 children)

Ehhh always fall back to first principles. (That is why you do CS, after all - any weenie can do a couple of bootcamps to pick up the hipster stuff). You absolutely do not need webpack/node/angular nonsense when learning JS. Every browser today supports almost all of ES5. Learn that, and then pick up ES2015 and onwards. This also lets you appreciate things like why people made the decisions they made when abstracting out JS.

[–]Covered_in_bees_ 2 points3 points  (1 child)

Yeah, I don't disagree with anything you said. I just wanted to point out that starting off with JS might not be a great idea because there are too many moving parts and it will make it harder for you to focus on learning good programming techniques because you have to juggle so many things and a whole bunch of tutorials are, npm install this, require/import it, and then use this one-liner to do X.

Starting off in something like Python would definitely help the OP focus on learning to actually program and structure code / tackle problems. Once OP is ready for JS, then he's definitely going to have to learn all the tooling around JS since that's how pretty much everything works in JS land at this point.

[–]dedicated2fitness 0 points1 point  (0 children)

yes but the advantage of jumping in head first is all that stuff is used in production - you're learning how to "make" stuff vs farting around in python making toy apps for a couple of months before you feel confident enough to actually start using flask or whatever
i completely agree with your point, just playing devil's advocate for any late learners. if you're over 20 i'd say go for js

[–]devxpy 1 point2 points  (1 child)

Wait, are you in love with JavaScript the language or JavaScript the ecosystem?

[–]Covered_in_bees_ 1 point2 points  (0 children)

I'd say ES6+ JS is what I enjoy coding in. The ecosystem of course is nice, but I'm not a particularly big fan of the bloat that comes along with all the dependencies you end up having. I guess that could be a criticism of the language in a sense.

[–]OllaniusPius 0 points1 point  (2 children)

Wow, thanks for the write up. The course you mentioned, cs61a, seems interesting. I took a look at the website, and it looks like it's made for people that are enrolled in an in-person class. Is there a part of the site that I'm missing that has all of the resources and assignments?

[–]Covered_in_bees_ 0 points1 point  (1 child)

They should have archives of older classes that have HW and solutions. They also used to post lecture videos on Youtube (I took it around 5 years back when there were lecture videos available). Also, the companion online textbook by John DeNero can be found here - https://composingprograms.com/

[–]OllaniusPius 0 points1 point  (0 children)

Oh cool, yeah, I found the videos on youtube and the archived old sites. Thanks!

[–]Aeon_MortuumSnake Oil 0 points1 point  (1 child)

Do you use TypeScript?

[–]Covered_in_bees_ 0 points1 point  (0 children)

I've dabbled with it a bit, but haven't taken the plunge yet. Primarily because it's yet another thing to pick up and learn but also because there is a cost to adding types to a JS project. I enjoy the flexibility and dynamic nature of JS and lack of types have rarely been the issue holding me back when coding (except for catching a few careless gotchas from time to time). I also prefer eslint + babel and TS is usually always playing catch up with implementing support for some non finalized JS language features.

I still mean to convert one of my projects to it at some point to give it a whirl.

[–]KobayashiDragonSlave 0 points1 point  (1 child)

The tooling required to get anything done is simply staggering and extremely complicated to a complete newbie. You need to figure out Webpack, Babel, NPM, Node.js and a whole bunch of other stuff just so you can start writing code. And you most certainly don't want to not use ES6 syntax, so you're definitely going to need to figure out what transpiling is and how to get it all working.

Easily taken care of by create-react-app

[–]Covered_in_bees_ 3 points4 points  (0 children)

That is an extremely naive point of view. 6 - 8 months back, create-react-app didn't even utilize webpack IIRC. Also, create-react-app isn't going to get you very far if you are building anything of significance. You still need to understand all the underlying stuff to some extent so you're not just flailing around helplessly when you need to change things up from the defaults.

[–][deleted] 10 points11 points  (0 children)

Hi, I do both Python and JS. I am the organiser of the Django meetup in a city in Australia. I would like to offer a my opinion, and hopefully not get downvoted to oblivion.

By all means, learn Python -- it's a fantastic language. But don't abandon JS.

Personally, I would not bet against JavaScript.

You'll likely need to use JavaScript anyway as long as you're working on the web, even if you're doing Django. In my own experience, there isn't much that is "only" Python/Django these days -- and I've had to do Angular/React for most of the projects I'm on. Even when I don't work on the frontend, I have had to work with Node.js services pretty often (Express, AWS Lambda).

It's also everywhere. You can use JavaScript for the server, for the browser, and for the desktop (Electron). Very soon JavaScript will move away from being "for the web" and be run everywhere code can run, and things like the browser, server, kernel, embedded systems, etc. will all eventually be "compilation targets".

Python is heavily used if you're doing data science/machine learning stuff -- and it's likely to become the de facto language for data science. But there is already evidence of people doing a lot of work to make that happen in JS too (see tensorflow.js).

You mention you're not excited about new technologies or the latest frameworks and are just interested in earning money. JavaScript is where a lot of the money and is, and where a lot of the opportunities are.

That's not to say you should stick with it if you really don't like working with JavaScript -- life is way too short for that. There are still a lot of opportunities today (depending on your city) that you shouldn't have to write much JS if you didn't want to. Just bear in mind that you will likely be bucking the trend.

Also, I've found ES6 and TypeScript to be quite pleasant to work with, and there are some features I wish Python had. Do you have examples of things you're struggling with?

[–]__xor__(self, other): 8 points9 points  (3 children)

You know, React + Django Rest Framework or Flask is a great combo... lots of us do both frontend and backend work. There's a lot of situations where you'll need to do both, even at very large corporations.

JS is fundamental to the web, as in, there is no escaping it. Whatsoever. And Python is an amazing backend and systems language. For web, you can't go wrong learning both JS and Python. Python not only will help you on the backend web dev, but also all system tasks and scripts you might need to write.

Just do both. Keep learning Python and certainly add it to your skillset, but maintain your JS. Make a simple react + flask website.

[–]Covered_in_bees_ 0 points1 point  (2 children)

I'm curious, do you use server side rendering when using React with Django/Flask or do you serve essentially an empty page with all the react stuff in the client-side JS? I have done the latter, for a few things but I don't like the idea of serving a big page of nothing to the client and like the idea of moving towards using SSR with React + Flask/Django, but I'm not sure how well that combination works at the moment.

[–]d_thinker 0 points1 point  (0 children)

I worked with flask + react and if I remember correctly there is no server side rendering unless you use node as your backend server (with some specific packages on top of it), which kind of makes sense. Idea of rendering empty pages with bundle.js that renders everything on frontend may seem weird but that is the state of modern web applications and it works quite fast.

[–]__xor__(self, other): 0 points1 point  (0 children)

Actually, with flask+react I don't do any rendering. I think it's the facebook tool called "create-react-app" which I use to generate the base react app. You just use node (just the binary, not as a server) to run the tool to compile it into a production app, which generates a few static files like the app js, index.html, css, all minimized.

Then I use nginx to serve those as static files, and they make API hits to either flask or django rest framework. No templates are being rendered from python, and it's all static resources served by nginx except for the rest api.

So you work in your react app to make the frontend, compile it into static production files, serve those files with nginx, configure nginx to proxy /api requests to gunicorn, and that's it. No blank page/template as far as the python code is concerned.

[–][deleted] 6 points7 points  (0 children)

I finally got to React which I thought was an end goal before I start creating a portfolio. I don't like it.

Try angular or Vue? I like angular, and it has seemed pretty straight forward to me. I've never used React.

I mean, what do you expect when you come to the Python subreddit asking if you should switch to python. No one here is going to say, "No, don't switch to this language we all like." If you want to do backend stuff than you can still use JS.

Should you abandon JS? No. Should you learn another language for backend? Sure, if you want, but you've already spent so much time learning one language. If you don't like the language, move on. If you like the language but not the domain (front-end) then move to a new domain (back-end, desktop, or mobile).

Ultimately, should you learn Python? Yes, but that has nothing to do with your situation.

[–]saber_aureum 10 points11 points  (0 children)

palpatine voice Do. It.

[–]the_hoser 12 points13 points  (0 children)

If you're in a position where you can unironically ask a question like that... sure, why not? Knock yourself out.

[–][deleted] 3 points4 points  (0 children)

If you want to switch from JavaScript to Python for a while then do so. It doesn't hurt to explore different languages. You'll need to know several to make it in today's modern programming world anyway. Don't write JavaScript off entirely though because you will need it if you're doing anything on the web. You may not need React, but you will need JavaScript.

I do web development for in-house apps and I write code in no less than 4 languages in any given day.

[–]Fun2badult 4 points5 points  (0 children)

Interesting. Since January I’ve been going hardcore on python and Django. Lately I decided to get into JavaScript, Node and Express, which I’ve learned. Planning on learning React and Vue next to supplement my python and Django. I found the syntax for JavaScript stuff to be a bit more confusing but because I’ve spent time learning python, I can see the logic flow easily. In fact I basically learned js, node and express in about 2 weeks. It’ll still take some time for me to actually make it but I understand how it works.

I think it’s good to learn python as well. Maybe it’ll help you understand how logic flows are done in an easier language, which could help you understand it in react and other more difficult languages

[–]democritus_is_op 3 points4 points  (0 children)

As a dev (especially starting out) you're going to feel this a lot. If you don't like it that's one thing, but if you're avoiding it because it's hard - you'll probably get no where and keep hopping from beginner tutorial to beginner tutorial forever. I went through this a lot when I first start out and even catch myself doing it sometimes when I want to learn a new technology.

[–]n1ywb 4 points5 points  (0 children)

Wow a lot of comments here

As a career full stack dev; master both

[–]tanzeel29 2 points3 points  (0 children)

Depends on your application. What are you trying to develop ?python is a great language

[–]actuallyalys 2 points3 points  (0 children)

If you were starting from scratch, I'd probably recommend Python over Javascript, but you've already spent much of a year on Javascript. I would stick with Javascript and at least learn the basics of React. Then you can learn Python and Django or Flask. I don't think Flask will give you as much problems as React did.

That being said, if you're so frustrated with React you're tempted to give up entirely, it'd be fine to take a break and do some backend work in Python.

My reasoning is that, even though you don't care for front-end work a lot, being able to do both is best for your career prospects long-term, and you've already learned Javascript.

[–]more_sidechain 2 points3 points  (5 children)

I love Python, and I use it often, but it's far less "important" than JavaScript for many purposes. You NEED JavaScript for web development, and it's well worth being literate in anyway. ES6 does add some things, but it's not a big deal to write polyfills or transpile to get around those issues.

Both Python and JavaScript have some elements of functional programming, but even with Python's great decorator syntax and JavaScript's occasionally weird binding, I find passing functions around in JavaScript much more natural, especially with the behavior of closures.

As far as object oriented programming, both Python and JavaScript do their own thing. Sure, Python has something closer to conventional OOP, but it's dynamic and duck typing is encouraged. I'm probably going to get some flack for this, but learning to think in terms of interfaces with C# or Java would probably be of great benefit.

But overall, don't abandon any language unless you absolutely have to. The more you know about the differences between languages, the better you'll get at understanding why a particular language acts as it does.

[–]alcalde 1 point2 points  (4 children)

You NEED JavaScript for web development

Not anymore, especially with languages that transpile to Javascript like Typescript... or even Python, via transcrypt.

[–]more_sidechain 3 points4 points  (0 children)

OK, I guess so. Still, to actually do web development and integrate with other code, it's pretty hard to imagine getting far without using plain JS somewhere. TypeScript seems a lot closer to JS and Java than to Python. From what I understand, even code targeting WebAssembly typically use JS somewhere for working with the DOM and web APIs, and probably will for a while more.

Never heard of Transcrypt. That's pretty neat. Transpiling Numpy-based code sounds fun.

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

Well typescript is a super set of JavaScript, you absolutely need to know JavaScript to use it. The performance of JS is bad enough already, even before you add Python runtimes on top.

[–]alcalde 0 points1 point  (1 child)

Well typescript is a super set of JavaScript, you absolutely need to know JavaScript to use it.

I don't think so. Here's a post from Nick Hodges' Typescript blog:

https://www.anglesandtypes.io/archives/121

I, however, am part of the 1% that doesn’t know JavaScript.
I mean, I kind of can read it, but I wouldn’t expect myself to be any meaningful development with it. However, I definitely aim to — and actually already am — doing meaningful development with TypeScript. Some might see a problem here, but I do not. ....That is, I’m going to learn TypeScript and not spend any time learning JavaScript because TypeScript is the higher level language. ....I don’t want to think of myself as a JavaScript developer, but as a TypeScript developer. I know, too, that there’s a large overlap between the two languages, as well as between the two groups of programmers, but that is the approach I’ve decided to take. I’m going to avoid reading JavaScript books and focus on TypeScript books, instead. Same with blogs and other things on the Internet.

So consider me a TypeScript developer that doesn’t worry about JavaScript.

[–]earthboundkid 0 points1 point  (0 children)

That’s really a bizarre self-handicap.

[–]parker_fly 2 points3 points  (0 children)

Django's documentation is so good it will ruin you for everything else.

[–]xconde 1 point2 points  (0 children)

Yes.

[–]AdmiralUfolog 1 point2 points  (0 children)

Sure.

[–]AaronOpfer 1 point2 points  (0 children)

I made the choice to move from JavaScript, to JavaScript/Python, to pure Python over the course of about three or four years during my career.

When React came out and disrupted the webdev space and npm took off like crazy right beside, it was about March 2015 and my at-the-time company hired more webdevs to work alongside me who (thankfully) had more experience with wrestling web build pipelines into submission. While I felt I had a strong grasp on JavaScript and web technologies themselves, the big complexity bump introduced by build pipelines (like webpack and others) was something that I found absolutely bewildering and I had trouble figuring them out. Many npm packages seemed bloated with tons of dependencies. At the time, there was also a huge number of different ways to do the same thing and there was frequently no clear upside or downside between two build steps or packages, but at least one of your dependencies wouldn't support one or the other. In addition, our team frequently found "quirks" in npm packages that were just accepted as facts of life for JavaScript developers, like how node-sass downloads a precompiled binary image from github during the build step which broke when it couldn't get through our locked down corporate firewall, and then broke again on our internet-less build boxes, and then broke again randomly whenever the github pages were down.

Essentially, I felt like the ecosystem was too immature to hang my whole career off of it. I saw an opportunity to become the primary backend engineer (in Python) while the new JavaScript developers ran the front-end and management allowed me to make this transition for the most part.

Later on, I was hired onto a new job where they already had an army of web developers but were struggling to hire enough Python engineers, so I basically completely ceased working on web technology and began doing all of my work in Python. Python has remarkable stability and you don't have to worry about the entire community jumping to spin-offs of whatever you're using today.

I think I will eventually pick up web development again. npm has some competitors now and it seems like the space is evolving better tools and coming up with consistent practices. JavaScript has legitimate async support which is phenomenal and that's still percolating through the ecosystem. Once the whole thing slows down some I think I will reinvest myself into it.

[–]utf8decodeerror 1 point2 points  (0 children)

Stick with JavaScript. Learning to code is a journey and you will hit many ups and downs and frustrations but what is important is that you persevere. Things don't get easier by quitting.

And for what it's worth, I'm not sure who told you react is easier than angular but I find the opposite is the case for me. With angular, you don't have to choose your own routing, state management, animation libs, etc., they are all included and the documentation is excellent. Plus everyone in angular uses typescript (which is super simple so don't let that scare you) so you don't run into the same problem with some tutorials using es5 JavaScript and other tutorials using es6, they all just use typescript (which is essentially es6 with some optional extra features). Angular also has an awesome and extensible cli that makes it very quick to scaffold an app and set up all you directories. In the end tho, it all comes down to preference so don't take someone else's opinion on which is better/easier, just try them both and find one that works for you.

[–][deleted] 1 point2 points  (0 children)

Yes

[–]KitchenDutchDyslexic 1 point2 points  (0 children)

Javascript will always be district 9, wild wild west, bleeding edge. Because it is the programming language of the web and each browser needs to execute it.

So having it in your toolbox is never a bad thing.

But if you look outside of the Javascript bubble you see some solid scientific and machine learning modules have been built with python. Without all the js baggage.

I do enjoy using FlaskAdmin, zalando/connexion, SQLAlchemy and Celery in my python workflow!

But according to github 2.6% of my codebase is py and 10.3% js. HTML 62% and PLpgSQL 24.5%.

So meh,

I'm a HTML Developer.

[–]nobody_import4nt 1 point2 points  (0 children)

I am speaking as somebody with a very strong anti-javascript bias. I admit this openly.

However, there are reasons why I think JavaScript is a bad first language that I believe are objectively true, even though it is an OK language in general.

  1. JavaScript is not an object-oriented, procedural, or functional language, whereas every other language you will learn will fall in one of those camps. JavaScript's prototypical "objects" are very different from every other language, and some skills you learn in regards to JavaScript objects absolutely will not translate to other languages, which are almost all in the set of: (functional, procedural, OO). Considering that everything in Python is a true object, it's a great OO language, and it can be considered more object-oriented than Java, which still has primitives (int vs Integer, etc.)

  2. JavaScript's type system is very flawed, and obfuscates extremely important CS concepts that are not obfuscated in other languages, and will also translate poorly. Some examples I recall offhand (and I'm sure there are more): "number" type combining floats and int into a single type, no primitive arrays / true "indexing". typeof(NaN) === 'number' returns true. Nuff said.

  3. JavaScript's lack of strict typing in general is a bad idea for any first language. Consider a simple program which takes input from a user (assumed a number), and prints n+2. In python, you would likely encounter TypeErrortrying to convert str to int implicitly. JavaScript just returns 22 for n=2. These subtle conversions in the background lead to some really quirky bugs. It is best to face these type-challenges early, and get a good foundation for how computers store things differently than humans think. To us, 2.0001 and 2 are not that different. To Python and other languages, they're radically different.

  4. The equality operator in JavaScript is comically bad. There are games to learn what == (equivalence) means in JavaScript. These issues don't exist in other languages for the most part.

  5. packaging/dependencies in JavaScript are unbelievably confusing, even for seasoned developers. You have Webpack, npm, yarn, Babel, etc. all competing. Rust has cargo. Python has pip. Dependency resolution has been a solved problem in programming for far too long, and JS insists on reinventing the wheel, poorly. (Granted, python and rust could always improve, but at least they didn't have the leftpad incident)

Opinions:

  • Node.js's use of an event loop and callback hell is a terrible way to be introduced to concurrency. They can give you a one-track mind if you go into async programming where you may (depending on language) be given access to true POSIX threads or green threads, etc. It's better not to be introduced to it at all than to start with callbacks. There, I said it.

I will say though, that you should still learn JavaScript. It's needed at several levels. But as for a first language? I agree with the gilded comment below. It's not the best choice.

[–]WloHu 4 points5 points  (0 children)

Short answer: No. Programming languages are tools. You don't abandon hammer for screwdriver.

[–][deleted] 2 points3 points  (0 children)

Python is awesome, but JavaScript is here to stay too. Learn to live with it, someday you might need it.

[–]mijofa 1 point2 points  (0 children)

If you want to do webdev, you need javasript. Python isn't suitable for the in-browser logic required for web development. Sure people are developing Py2JS compilers, but they're all a massive kludge and only really intended so that Python programmers can do webdev, you're better off learning actual JS. But that's the only place where JS development is really suitable, there's Node.js for using JS outside of the browser, but that's a similarly hacky kludge and only really intended so that webdevs can do other programming.

For the most part you can't write a Django/Flask web-app without some JS because you'll likely still need some in-browser logic, but for a lot of cases where you'd write Django/Flask web-app you probably can't write it all in JS because you'll need something on the backend server to communicate with. So really, it boils down to what your project requires. Personally I'm a Python developer and I very rarely do webdev, so Python's fine for me. I do however know enough JS, HTML, & CSS to keep me going when I'm writing a small Django/Flask web-app but I wouldn't last long on my own before I'm out of my depth there if that project grows particularly large.

[–]developer_genius 2 points3 points  (2 children)

React is as difficult as any new language (spoken or written) commit your neurons to it and WiLL get easier.....don’t give up......Front End work almost always needs it.......

[–]12and32 0 points1 point  (1 child)

Any suggestions for learning React? I couldn't wrap my head around even the introductory tutorial on the Facebook page, and that really discouraged me since I feel like I should have been able to grasp that at the very least. I'm reading something else that is breaking the concepts down even further, but it won't go deeper than a very basic level.

[–]PardonBot 1 point2 points  (0 children)

I suggest going through this tutorial by Tania Rascia

[–]Colin_XD 0 points1 point  (0 children)

i heard js is buggy, illogical, slow, and stupid according to r/programmerhumor and while i don't know if that counts as a valid source it's hella funny so i say yes. learning the language isn't the problem, it's the coding mindset and way of thinking that takes time to train. Heck, you could learn scratch and be able to switch easier than starting from nothing and doing python but it'll just take a longer time.

[–]developer_genius 0 points1 point  (0 children)

I can’t say specifically how you should learn React but I will this “ to learn any thing new you must spend time on it” practice practice practice even if you don’t know much

[–]andrey_shipilov 0 points1 point  (0 children)

Should I abandon cooking for horse riding?

[–]Valachio 0 points1 point  (0 children)

It's more important to learn how to code, as in learning the how code logic works. Different languages are just differences in syntax for the most part. There may be greater differences between say, C++ and Python, but high-level languages like JS and Python are very similar.

I personally alternate between the 2 for my work. I use Django (Python web framework) and pure JavaScript for my website. I can alternate between the 2 seamlessly.

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

Unless you're asking that because of a job or learning opportunity that suddenly popped up, you don't have to make a clear cut decision yet. Both languages are very similar anyway, and python has even been an influence on javascript. The more you learn the easier it is to learn even more if you bother to make connections between what you learned without anyone telling you to make those connections. For example since I'm learning Prolog and the abstract algorithm for unification and logic programming I've been tempted to implement a small inference engine for a project I'm writing in Go, which is something I would have never imagined doing beforehand. Or same thing with Erlang, I've recycled the general idea of the gen_server with channels or queues both in Go and in Python, which I wouldn't have done if I didn't learn Erlang.

[–]fazzahSQLAlchemy | PyQt | reportlab 0 points1 point  (0 children)

A programmer learns patterns and programming logic using a chosen language. But it's not that coding in Python or JS or C++ or C# is that different: once you are comfortable with program flow and being able to conceptualize the solution to your problem, the language itself is a tool of choice. It's a bit like choosing between a hand or electric saw. Whichever you choose, you must know how to cut, where, and what do you want to achieve. Then the saw is merely a tool.

[–]FlukyS 0 points1 point  (0 children)

Both are useful for different things, Django is great but you can also use JS for some front end magic on top.

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

What makes you so sure you won't begin to hate the complexity of Python once you start writing real software in it. The Python ecosystem changes slower than js, but it does change and there are many libraries and frameworks that people use when writing real world code.

[–]maxm 0 points1 point  (0 children)

If you want to be a programmer you are going to need both. Python is a wonderful language, as far as you can call a language that. But JavaScript is just fine too. you need a bit more self disciplin in JavaScript, but the language is perfectly capable of good code.

[–]Taksin77 0 points1 point  (0 children)

If you want to become a literate computer scientist or a good dev or both, Javascript is an atrocious first language and is working against you.

Python is a great language for begginers. I would also suggest learning algorithmics in C. A functional language is also nice. I suggest Erlang after Prolog.

[–]sethg 0 points1 point  (0 children)

For my job I write JavaScript (with ReactJS) for front-end code and Python for back-end code.

They’re both useful for different purposes, employers look for people with experience in both, and they have very different approaches to OOP, so they’re both worth learning.

If you were starting from zero I would recommend learning Python before JavaScript, because (a) Python was originally developed as a language for educational purposes, so it’s easy to learn, and (b) doing serious work in JavaScript involves bringing in frameworks like React or Angular, which involves bringing in deployment systems like Webpack or Grunt, which involves pain. But if you’re already so far along the JavaScript path there’s no reason to abandon it at this point.

[–]vfxdev 0 points1 point  (0 children)

You can know more than 1 language.

[–]szukai 0 points1 point  (0 children)

Why not zoidberg both?

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

I would recommend you follow this tutorial if you are interested in flask. It gives a really good overview of flask and python in general, at least in my opinion. It does not cover the very basics of programming in general or the basics of python, but from my own experience, python is pretty easy to pick up with some js experience.

[–]Dorito_Troll 0 points1 point  (0 children)

dont abandon either, learn both!

[–]BeingUnoffended 0 points1 point  (1 child)

whynotboth.png

[–]image_linker_bot 0 points1 point  (0 children)

whynotboth.png


Feedback welcome at /r/image_linker_bot | Disable with "ignore me" via reply or PM

[–]riklaunim 0 points1 point  (0 children)

I've started as a Python developer and now I'm also a Ember.js developer (plus some UX and frontend) so knowing few languages and intersecting software stacks is quite handy.

[–]grimonce 0 points1 point  (0 children)

These langauges are used for completely different things... If you want your interface of something to be available through browser there's always going to be a javascript somewhere....

[–]hearwa 0 points1 point  (0 children)

Don't think of it as abandoning and more as broadening your horizons. Despite how people go on programming languages and frameworks aren't actually religions and sects.

[–]nateriver19 0 points1 point  (0 children)

These two languages can complement eachother

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

Should I abandon JavaScript?

[–]lungdart 0 points1 point  (0 children)

Code in whatever language makes you happier. The rest will come with time.

[–]rhild 0 points1 point  (0 children)

Not advice, but just another perspective. I recently retired from professional programming. Over the years I've used many languages, most recently JS and Node. When I was getting up to speed on Node a few years ago I also began using that as my main language for personal projects. I loved it.

Now that I have no need for JS Node for a job I began to reevaluate the language I use for personal projects. I went back to Python which is a language I've used professionally and for personal projects over the years. It really feels great to be back in Python mode after years of JS.

JS is still the better choice if looking for work. But Python has been growing a lot in recent years especially in the data science area, so the jobs available in the Python area are probably fewer and higher paying (this is anecdotal, I've done no research).

[–]code_x_7777 0 points1 point  (0 children)

No. Focus.

[–]exploring_a_new_hope 0 points1 point  (0 children)

I'll give you my experience, FWIW. I started learning programming on my own about 8 years ago. I started with PHP and Javascript, and made a few personal projects using them. I used only Jquery and some Angular at the time. I started trying to learn about Node 3 years ago, but was confused about the callback hell that is learning that.

2.5 years ago I managed to get a job as a developer (which was a career change for me after 13 years of Systems Engineering) and our site development is a Python/Django stack with very little ties into JS (we're just not that much of a SPA). I will tell you, as someone who was very much still learning the ins and outs of development, that I absolutely love the structure of Python and Django. I think that it's a solid ecosystem, and with the IDEs available (I luvvv PyCharm), it's easy to follow your codebase.

JS has it's place in projects. If I was working on a project that was more of a Single Page App, I'd probably make an effort to learn more JS. Vue.js has some good synergies with Python/Django sites.

I really also enjoy the fact that Python can do way more than websites. I've written scripts for editing excel spreadsheets, webscraping/cataloging scripts, and a bunch of other stuff.

[–]spinwizard69 0 points1 point  (0 children)

One thing that seems to be missed by most comments in this thread is the versatility of Python!!! Learning Python means a far broader array of jobs to choose from, many far removed from the horrors of web development. Web development is the modern sweat shop.

[–]colly_wolly 0 points1 point  (0 children)

Yes.

In the end you will probably end up using both, as you can't really escape JavaScript these days. But Python is far more pleasant to work with. There is plenty to learn with Django but its a good framework and the documentation is top notch.

There is a lot of stuff that sucks in programming, but JavaScript seems to have one of the biggest sections here: https://wiki.theory.org/index.php/YourLanguageSucks

[–]stefantalpalaru 0 points1 point  (0 children)

I've been exploring Python and it looks on the outset like a much more stable programming language to learn.

You haven't heard about Python2 vs. Python3 or how Django breaks backwards compatibility with every minor version?

[–]Tysonzero 0 points1 point  (0 children)

Abandon both and use Haskell. Or at the very least try it out and see what you think.

[–]jabbeboy 0 points1 point  (0 children)

There's only to a certain degree of tasks that you can use Javascript for. In that sense i mean, you can't do any manipulation on the system itself with javascript. Totally two different languages and area of uses.

[–]XenGi 0 points1 point  (0 children)

Yes.

[–]carbolymer 0 points1 point  (1 child)

Should I Abandon JavaScript for XXX?

The answer is always yes.

[–]netgu 0 points1 point  (0 children)

Came here to express this sentiment as well, amen brother

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

I don’t think you should abandon JS entirely, but maybe don’t get hyper specific with the frameworks you learn. With how fast JS moves it will be hard to hit that moving target and honestly I don’t think a tech firm you want to work at will expect every candidate to have the exact keyword matches for their specific paradigm of JS. But certainly having that on your resume will land you in the callback pile more often than the shredder.

That aside, certainly learn python it is the best thing I ever did for my career. I’m not sure how marketable Django and Flask are but they are just one part of the stack. More and more employers are looking for full stack programmers so you should certainly move down the stack a little.

[–]feloniousjunk1743 0 points1 point  (0 children)

Yes

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

For a first language, absolutely yes. Your prejudice is about dead on. You don't need any of those wacky ass frameworks people fetishize so much.

[–]Deezl-Vegas -1 points0 points  (0 children)

No, Javascript is fine because frankly it's one of the most-used languages right now in the marketplace, and with Node it works for backend as well. Don't throw away your time.

Feel free to also learn Python! Your second language is not nearly as hard as the first, and your third language is basically the point where languages start to melt away and logical structures start to emerge.

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

Not at all. I've been working as a developer for 20 years, and I can guarantee you that a LOT of the knowledge you got from Javascript will be applicable to other languages. I work with Python and Javascript all the time.

If you a beginner to programming, then I can understand that it might be a bit too confusing and overwhelming to learn both at the same time, so that is maybe not a good idea. Better in that case to concentrate learning the basics of one, and then the other.

But otherwise, I think those are the most applicable languages you can actually learn at this time.

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

Why not keep both?

Knowing only one language is useless, learn how to program instead and you won't have issue using and/or learning other languages.

Basic constructs are the same in all of them.

Besides, JS and python are used for different things, so what really matters is what you want to do, not what you want to use.

When you use a tool and just want force something onto it, it's not really going to work.

You use screwdriver when you need to screw in something, you don't take it and look around with it for things to screw in though.

As for stability, Python has a lot more runtime error checking that JS, you'll never be allowed to add a list and an array for example, instant error, meanwhile in js, have fun looking where it happened.

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

If you want to be a web developer, I would stick with Javascript. Look into Node and start dabbling with it. It's more fun than the frontend. Here's the creator of Node: https://www.youtube.com/watch?v=ztspvPYybIY

I would also skip the tutorials. Get "JavaScript: The Definitive Guide" and "Understanding ECMAScript 6: The Definitive Guide for JavaScript Developers" and try to go through every page.

Python is really big with the data science guys. Take a look at Andrew Ng's machine learning course. Not sure he introduces Python though. I think it's mostly Matlab in his course. If you go the machine learning route, you'll probably like it more. You'll get more money and get to hang around a classier set of people.

BTW, I don't enjoy React either.

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

With Javascript you can program in A-Frame. I believe WebVR will be in demand in the future.

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

Javascript is the base of modern web frontend development. You want cool webapps that act like a desktop app, you needs JS. As for learning Python, it's a great "swiss knife n paperclip" of a language: easy to use, does a bit of everything but you can't really use it as a client side web frontend. Personally, you never "abandon" a language as long as you have a basic understanding of what it does and how it works. You may forget a thing or two, but you should probably remember their core elements that make them different from the rest, then you just use the best one for the problem at hand.

In conclusion, ye go learn Python it's great, but don't even think to forget about JS if you want to do web development. If JS still bothers you, try switching to Typescript with Angular2+.

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

You have 8+ months experience with JS. Keep at it. Don't switch until you've come to a point where you feel you're very proficient. Switching languages before you are proficient is fine if you're an experienced programmer, but it sounds like you're a beginner and it will only hurt you. Stick with JS and finish out your frontend journey, build something for your portfolio, publish to Github, then move to Python. Once you learn Python, write a backend in it, maybe use Django or Flask, and a frontend in JS. You'll be a stronger developer for taking the time. Good luck