今日推荐英文原文：《Notes on Learning To Code》
今日推荐英文原文：《Notes on Learning To Code》作者：Bryan Jordan
Notes on Learning To CodeHaving taught myself how to code to build Streamplate a friend asked me,
So this is my response that I’ve generalised because I think others will be interested.
As with any concept, its structure can appear imposing because of its unfamiliarity. Consider the following:
With no understanding of electrical engineering let alone circuit schematics this is naturally confusing for anyone. Recognising that the confusion is a function of unfamiliarity is important in learning anything — because it points your attention towards the concepts that are out of your understanding.
Similarly, coding has the problem of being visually off-putting — because you don’t understand it — not because it’s inherently difficult to understand. They’re two separate problems and it’s important to repeatedly remind yourself that you always have the ability to change this state and learn how to code.
In short, coding is easy.
Above is a simple Python script, program, code, whatever you want to call it. That’s it.
What makes coding easy is this:
- Write code,
- Run the code,
- See the mistakes,
- Fix the mistakes,
- Run the code again,
- Repeat until completion.
Not many other industries have an ability to simulate their task’s execution before delivery. That isn’t to say that there aren’t areas of coding that aren’t hard — the readership here is supposed to be those learning to code. There’s plenty of ways code can become hard through optimisation techniques, pursuing languages that are designed to optimally work with hardware and less so with programmers, managing networks of competing code — eg. web-servers and their networks and so on.
The point is that with coding you have the ability to fix any problems with relatively no cost — and so again, the burden is on your own willpower to do so.
Keep your perspective in check when you’re faced with problems during development — you’re writing a simple program, not the code for the in-flight software for the Apollo and Skylab missions (Margaret Hamilton — the woman next to the stack of pages — all code).
It should be obvious now that the most important challenge with self-teaching relates to motivation. If this crumbles or your own willpower falters, then there’ll be no drive to overcome some of the issues you face — and to a newcomer, they can be overwhelmingly brutal.
As for coding itself — as a general recommendation without knowing your personal circumstances, I’d suggest Python.
Coding is an interface — just like how writing on paper is our way of communicating to other people — this is how programmers speak to machines. And just like writing, there can be more efficient ways of speaking, whether that’s with slang, verbosity or abbreviations and so on, there’s different ways of programming.
The key metric for programming is speed — the faster it can execute, the more code can be processed and hence the computer has greater utility value.
To learn how to use Python you first need a way to write code through an app. My recommendation would be either Visual Studio Code or Atom, both free.
After you’ve installed either of these, you can begin coding.
To get you started, these are my recommendations for forums/search engines that are general enough to accommodate most queries:
YouTube — will provide video-based explanations and implementations of most of the problems/concepts you’ll encounter.
Stack Overflow — one of the few industries to have such an exact Q&A forum with such reliability and accessability. A Google search with your problem will most likely produce results linking to Stack Overflow. In fact if you want to know where your first step is into programming — here it is.
sentdex — a well-skilled programmer that works and documents really cool projects (using machine-learning for the cars in Grand Theft Auto 5 to become self-driving, financial modelling and web-crawling etc).
Google — naturally this will produce a range of options to consider, but most of these will link to either YouTube or Stack Overflow.
Depending on your level of motivation I think there’s a better way to learn how to code, yet it’s much harder. It forces you to understand concepts and also produce ideas rather than simply following guidelines and in a sense, colouring in between the lines.
I’m an advocate for practical, parallelised learning. Rather than a serial implementation as many teaching systems follow, for practical-based tasks such as programming, the final result rests on the delivered product, not the ideas behind it. The idea with this type of learning is that the implementation isn’t necessarily perfect each time, but you’re learning more faster and at each epoch in your education, your general understanding has grown rather than a siloed section of a concept.
As such, I think it’s better to begin independently coding as quickly as possible because it’s not hard, coding’s difficulty is grounded in its unfamiliarity. Overcoming this as quickly as possible produces much better results. Secondly, there’s nothing to suggest that learning the theory or modularising the concepts has to be mutually exclusive. Thirdly, programming lends itself nicely to ‘trial by fire’. If your code doesn’t work — check the errors and fix your code accordingly.
So with this said, I think the best way to learn how to code is with a project in mind and exclusively pursuing this. If you don’t have one — then following this initially is a good start.
If you do have one, then you know the resources to use for any questions you have.