5 ms·
Ask HN: I've learned JavaScript, should I learn Python?
I'd like some pros and cons of whether it would make sense to up my skills and learn Python. Any feedback would be helpful.
- claytongulick 3y agoProgramming languages have characteristics that make them better and worse for various tasks. While it's possible to complete almost any task in any language, some languages aren't optimized for some workloads. JavaScript shines in IO bound tasks and time to market on the server, and of course is the language of the web. Systems languages shine for high performance and low level OS capabilities. IMHO python shines for quick script writing with blocking IO for doing things like file processing - I use it as a better bash. There's a long history of using python for other things like web servers (Django) but I don't think it's very competitive in that space these days with better options like node, go or even elixir. Very much worth learning different languages to understand the things they are good at and the theories behind their design. From a practical standpoint, employers like seeing a well rounded developer with experience in more than one language.
- nathan_tarbert 3y agoThanks @clayongulick, I've also considered learning Go but I appreciate you explaining what Python offers as well as some of the cons. I've messed around with Go's sandbox and find it very readable.
- cratermoon 3y agoPros: popular and commonly used; good for data science Cons: roughly the same paradigm and Javascript. weak/dynamic/duck typed, interpreted, garbage-collected. I'd recommend learning a language that departs from one or more of those. Maybe learn a statically-typed language, or a functional language. If you're up for a bit of a challenge, learn Rust. It's strongly typed, compiled, and definitely NOT garbage collected. It's possible to get a running program very quickly, but the learning curve steepens after that. If you do want to try Rust, here's some starting points - https://chrismorgan.info/blog/rust-fizzbuzz/ https://chrismorgan.info/blog/rust-fizzbuzz/ - https://stevedonovan.github.io/rust-gentle-intro/readme.html https://stevedonovan.github.io/rust-gentle-intro/readme.html - https://www.lurklurk.org/effective-rust/intro.html https://www.lurklurk.org/effective-rust/intro.html - https://fasterthanli.me/articles/a-half-hour-to-learn-rust https://fasterthanli.me/articles/a-half-hour-to-learn-rust
- nathan_tarbert 3y agothanks for the insight cratermoon, I've considered learning Rust. I will definitely check into it. I appreciate the links you've posted.
- noduerme 3y agoYou said you've "learned" Javascript. Perhaps you've passed a test. I doubt you've really mastered it or understood how it works under the hood. I'm not saying this to insult you. I only say that because I've been doing it for 20+ years, and all of us, everyone, could probably spend ten more years learning to write even better code. On the other hand, new programming languages increase your understanding of some ways of doing things. You learn other kinds of syntax. You grok more. I guess I'd ask myself: What's the point? What do I want to learn Python to do or to make? Why Python specifically? Why not C++? Why not PHP? Why not just take those Javascript skills and learn to write NodeJS servers, which are a whole different beast from your front-end Javascript, and which can accomplish most of the same things as other back-end languages? I'm asking because, if you don't have a real reason to learn a language, it will just be something you learned that you never use. If you do have a real reason to learn it, you'll probably learn it because you need to. If you can't learn it by trial and error, without taking another class, then you haven't learned enough Javascript yet. All languages lead to each other, and all the information about them is available for free. Think about what you want your career to be. Do you want to be a full-stack developer? Then Python + JS probably isn't the best choice at this point. Do you want to tinker with AI models? Learn Python because for now it's the go-to language. Do you want work on games? Learn C++ and NodeJS. Do you want a steady job in the retail sector? PHP. If you just want to be a colossal prick you can write everything in Brainfuck.
- nathan_tarbert 3y agoHaha, I appreciate the honesty. I've only been programming in JavaScrip/Node for three years and that's not to say I'm a career developer. I just thought I would expand my horizons. I don't claim to know everything in JavaScript so I'm moving on. I'm not a SR. dev by any means but I love learning. The reason I picked Python as a next possible language is to potentially play around with AI.
- noduerme 3y agoI think that's a great reason then! AI has really given Python a whole new life. I personally find pythonic style[0] easy to follow but really odd and uncomfortable to code in. It's certainly different enough to give you new challenges. [0] https://blog.startifact.com/posts/older/what-is-pythonic.html https://blog.startifact.com/posts/older/what-is-pythonic.htm...