by iamandras on 4/18/22, 10:58 AM with 23 comments
I'm a JS dev and I would like to learn a new language. Probably Python or Go.
How did you learn a new programming language as an experienced dev? What was your approach?
Do you know an interactive website that explains different language features or design patterns using JS code fragments and their Python / Go equivalents?
It seems like a good approach to shorten my learning curve. Unfortunately, I didn't find a good one so far.
Thx.
by cweagans on 4/18/22, 5:25 PM
Building a CHIP-8 emulator is a fun first project (and generally very approachable -- there's a C tutorial at https://austinmorlan.com/posts/chip8_emulator/, which is helpful for understanding what approach you might take to get something working in another language). For Go specifically, I learned via https://interpreterbook.com/ (and the sequel, https://compilerbook.com/).
IMO, stay away from Rosetta Code unless you're really, really stuck. You don't want to e.g. write Python in a Javascript-y way. You should learn the Python way as much as possible.
by schwartzworld on 4/18/22, 2:38 PM
The harder part of that transition is environment issues. Switching between Node environments is a solved problem. Include an .nvmrc in your project and you're done. It's very much not a solved problem in python-land.
>Do you know an interactive website that explains different language features or design patterns using JS code fragments and their Python / Go equivalents?
by Someone on 4/18/22, 11:44 AM
The three languages you mention look similar enough to not need those side-by-side examples. When you read their tutorials, you’ll probably be able to make them yourself, if needed.
For python, https://docs.python.org/3/tutorial/index.html) seems broad and deep enough to get anybody going.
For Go there is “a tour of Go” (https://go.dev/tour/welcome/1). That looks good, too.
(Aside: both may go about equivalently deep and broad into the language, but the python one chose to show you a long list of links, while the go one hid that by only showing links to the top level chapters. That’s less scary, but makes it harder to jump back to specific sections later if you want to reread them)
Once you know a language, you’ll have to learn available libraries.
by Jemaclus on 4/18/22, 8:11 PM
My chosen project is a MUD, which is a text-based MMORPG, effectively. I already know how the TCP connections work, how to load areas/zones, how to establish characters and monsters, and how all of those things interact. So all I really need to learn is the language.
So my advice would be to pick something you've already built in the past in a language that you're vary familiar with, then port it to the new language. It's easier than coming up with something from scratch.
Your mileage may vary, but this generally works very well for me.
by karmakaze on 4/18/22, 9:21 PM
Learning Python should be much more straightforward as the way it runs is more similar to JS.
by 1234throway on 4/18/22, 5:57 PM
All in all learning the basics should take no longer than two to three weeks, despite lower quality documentation.
One way to do it may be to pick one of the many useful node libraries and implementing them in python.
by skydhash on 4/18/22, 8:50 PM
by adg001 on 4/18/22, 11:50 AM
by kidgorgeous on 4/18/22, 11:10 AM
Don't make this any harder than it needs to be young buck.
by VirusNewbie on 4/18/22, 6:10 PM
I needed to brush up on some interviewing skills and it was a nice way to focus on just the very basics of syntax. Once I was comfortable I started 'golfing' in the language on hackerrank for fun, and then I moved onto making some fun toy applications in a legit dev environment.
by kebsup on 4/18/22, 5:04 PM
by kderbyma on 4/18/22, 3:32 PM
1. Shortlist a couple languages 2. Read a brief summary and some articles espousing the virtues of the langues 3. Get a sense of which feels most enticing and then pick one 4. Setup a small project with a alignment to the strengths of the language (possibly port one from a previous language) 5. Build and document the code base as you learn and leave notes in comments to various tutorials as they apply. 6. Package it up and strip out the barebones and make a simple empty shell that can be used to bootstrap future projects
by chewz on 4/18/22, 7:51 PM
by vitabenes on 4/18/22, 11:14 AM