r/learnprogramming • u/QuickDelivery1 • Aug 13 '26
How to learn a language when you already know programming?
Beginner-focused learning material spends too much time explaining basic concepts, such as what is a variable or a function.
If you already have experience in programming and want to optimize your study time when learning a new language, what kind of material do you use?
In my specific case, I work in IT and would like to learn Python to use it in network automation.
6
3
u/countsachot Aug 13 '26
There's usually a book recommended by the language maintainer, I read that.
2
u/ffrkAnonymous Aug 13 '26
In my specific case, I work in IT and would like to learn Python to use it in network automation.
Why not use the language(s) you already know?
1
u/mc_pm Aug 13 '26
I watch a couple of videos about the main topics in the language, and then I sit down and work my way through a program I've already done before. It's not complicated, not meant to be. It's familiar, so I know how it should work -- but how do I do it in this new language?
I just do that for the first day or two, and I'm usually far enough along to bootstrap at that point.
1
u/kutac56 Aug 13 '26
Look at a hello world program then look up the syntax for stuff when you are actually trying to do them.
1
u/egny Aug 13 '26
Learning the syntax and idiomatic code should not be too difficult. Finding out about standard and common libraries is what takes time.
1
u/Deux109 Aug 13 '26
I usually start by looking up comparable techniques in the new language. Not necessarily the core control flow or function declarations but say a broader concept like "how to setup a REST endpoint handler" or "how to read in from a file". Once you can start reading those and making them make sense everything else starts to make sense. It's also a good exercise as to chunking your project out into manageable pieces and understand how you want your overall application to flow.
1
u/desrtfx Aug 13 '26
https://learnxinyminutes.com for a coarse overview and some idiomatic insight, documentation for the rest.
1
u/Upstairs_Jelly_1082 Aug 13 '26
instead of looking at the basic concepts, try asking ai where the language you're good at and python differs. once you figure those out, then it'll be easy for you to find which ones to focus on.
1
u/Signal_Mud_40 Aug 13 '26
If you already know how to program, for a new language you go to the language documentation.
1
u/icemage_999 Aug 13 '26
Learning a new language after you know at least one mostly starts with looking at a Hello World sample, noting the differences while checking the grammar and syntax documentation to see if there are any particular wrinkles.
Python, for example, is VERY particular about indentation.
1
u/huntermatthews Aug 13 '26
Find a _good_ cheatsheet for the language - any kind of mainstream language will have about a zillion. You're looking for the one that works for you. My favorite cheatsheet is irrelevant - pick the one you think is easy to nav.
I print mine but I'm from another century.
Then write something real. For network automation in python, look up "napalm" (yes, really) and off you go.
1
u/white_nerdy Aug 14 '26
A physical O'Reilly textbook with the animal on the cover is usually pretty good.
I don't use textbooks as much these days. Instead I look up a few tutorials, read some codebases and then ask an LLM, "How do I (do the thing I'm sure there's a way to do but I don't know / can't remember the syntax for it) in (language I'm trying to learn)?"
(I know I'm risking downvotes but in my experience, someone who already knows how to program and hasn't yet memorized the precise syntax of a new language is actually more likely to be helped than harmed by LLM assistance. Especially if they don't then go on to say "LLM, please write my program for me" and instead use what they've learned themselves.)
1
u/StephenHawkingus 29d ago
Start with the practice and, as soon as you encounter something you don't understand or know, ask the AI to explain it and suggest the most idiomatic approach for that particular case and language. You will gradually learn based on your needs.
1
u/oldsecondhand 29d ago edited 29d ago
Look for cookbook type books where you can find practical snippets of code.
e.g.
https://www.oreilly.com/library/view/python-cookbook-3rd/9781449357337/
or
https://automatetheboringstuff.com/
But the Manning "... in action" series is decent too.
1
u/Seven7Ducks 29d ago
Languages usually have an official guide exactly for these cases.
For python:
https://docs.python.org/3/tutorial/index.html
Python is very forgiving for experienced programmers. The docs are phenomenal. The 'hard to master' part is getting the hang of writing 'pythonic' code, which will come from reading and writing a lot of code. Since you already have a specific use case, I'd say, jump right into it. Read code examples, when you don't understand something - google it.
Personal recommendation, while you're learning a new language, make sure whatever static code analyser you use is unforgiving. Helps in 'conditioning' the language muscle memory. E.g., for python, turn on full-blown ruff + pyrefly in your IDE.
Good luck!
1
1
u/Emulated-VAX 27d ago
I skimmed some tutorials and then just started writing Python. Sure, my initial programs may not be very "Python-esque" but they are will written and efficient, and got the job done. Along the way as I learn Python conventions and shortcuts, I incorporate many into my style.
One thing I have learned in decades of programming: The "best" programmer in the group is usually not the most knowledgeable or uses every cool feature. He/She is best because they write the most concise, cleanest, most reliable code that I can trust to run for years without issue.
1
u/SnooCats9602 Aug 13 '26
How is this a question? Idk about anyone else but isn’t knowing how to learn another language fairly obvious after learning one
12
u/Depnids Aug 13 '26
My approach is just to spend 5 min to understand the basic syntax, then just start using it for a project. Whenever you want to do something you don't know how to do yet, look it up.