HACKER Q&A
📣 unpopularopp

Where should someone start learning to code in 2022?


While I always worked in a tech sector but never as a programmer. And my knowledge never went beyond simple XML parsing or just editing HTML/CSS, and working with scripts in Excel. But a lot of times I have ideas or problems that I _know_ would be much easier if I could code and write my own applications/tools.

So where should someone start in 2022? There are so many options, resources, languages. I kinda have an analysis paralysis.

Python would be the obvious choice (I think?). What are some recommended books or courses?

MIT 6.0001 was recomended by someone as a good point but maybe there other options too. But others said it's an introductory CS course using Python, not a Python course https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/pages/syllabus/

And there is this thread too https://news.ycombinator.com/item?id=30980813

I'd glad to hear some advice


  👤 qsort Accepted Answer ✓
I think it depends on what are your goals. Broadly, there are three cases:

(a) You have a quantitative background (math, physics, engineering, finance). The answer here is to simply ask your colleagues what they use and copy them. Those are all sectors where access to libraries and specialized software is very important, so that should be your main concern. As a default, Python is sensible: it might not be the best choice but it's unlikely to be terribly wrong either.

(b) You would like to make your own life easier, or write some software for a specific purpose, but you are not interested in being a professional developer. In this case I'll go against the grain and suggest you learn Javascript. As a language... you have better options, let's leave it at that, but it's very easy to get started with, there's a wealth of libraries available, it can play double duty as both a backend and frontend language, and you can't go wrong betting on the Web.

(c) You would like software to be your career. In this case, focus on the fundamentals and not languages. Try to learn at least a low level language (C, C++, Rust...), at least a typed high-level OO language (Go, Java, C#...) and at least a scripting language (Python, Ruby, Perl...). Make sure to learn SQL.


👤 jim-jim-jim
I've found that many of my junior colleagues, often fresh out of Ruby/JS bootcamps, are confined by syntax and frameworks. Some of that might be inexperience, but I also worry that mainstream resources don't do enough to emphasize the composition or "flow" of computation in a wider environment.

If your goal is truly to make your life easier rather than switching careers in three months flat, then I'd avoid any resource that demands you install heaps of dependencies, copy reams of boilerplate code, or stitch together disparate concerns like databases, web UIs, cloud services, etc. It's a terrible way to learn.

Honestly, how's your bash? Do you know to pipe and redirect output? What exactly do you want to do to make life simple, and how far can you get with that using curl, jq, sed, whatever? I'm not telling you to learn to program through shell scripting, but you'll be starting from a much better place once you understand standard input and output instead of opening VSCode and copypasting 40 lines of OOP wank into it.

You can refine the individual bits of your processing pipeline into proper programs once you've identified where the complexity lives. Python seems like a popular choice here. Can't fucking stand it myself, but I don't think the language matters as much as developing the overall flow intuition does.


👤 tanganian
Take UCB CS61A (at https://inst.eecs.berkeley.edu/~cs61a/sp22/) and CS61B (at https://sp21.datastructur.es/). You can now go build whatever you want, but if you want to dive deeper you should also do CS61C which is about computer achitecture.

👤 punkpeye
Personal preference is to pick up a high-level scripting language like JavaScript. It is easy because there are tons of resources, you don't need any software to get started, and you can build usable things pretty quick. Whereas Python/CS courses will send you down the rabbit hole of theoretical CS, which is interesting... but how long you can keep going depends on what you want to achieve with those skills.

👤 jstx1
Harvard's CS50 course is the best place to start (I think much better than MIT 6.0001). The teaching is great, and it covers a lot of stuff without dumbing things down. They also have a couple of follow-up courses which focus on web/games/ML.

👤 dylanhassinger
React