Programming and IT
How to learn to code from scratch
You can teach yourself programming without a technical degree if you write code with your own hands from the first week instead of only watching lessons. Below is how to choose a first language, what to install, which order to take topics in and how to tell that you are really making progress.
In this article
Which language to choose first#
Your first language affects your path less than it seems: variables, loops and functions work much the same everywhere, and a second language takes a fraction of the time the first one did. Choose by what you want to be doing in a year:
- websites and interfaces in the browser — JavaScript together with HTML and CSS;
- automation, data analysis, machine learning — Python;
- large server systems, banking and enterprise projects — Java;
- no goal yet — Python: its syntax is simple and there is little boilerplate.
Do not switch languages in the first three months. Difficulties at this stage almost always come from programming itself, not from the language you picked. Each of these directions has its own plan: Python, JavaScript, Java.
Your workspace in one evening#
You need three things: the language's interpreter or compiler, a code editor and a terminal. For Python that means the installer from python.org and an editor such as VS Code. Check that everything works with the shortest possible program:
=
Install Git right away and create a repository for your practice code. Each solved task is a commit with a clear message. In a month you will have a history that shows how you progressed, and later it becomes the base for a portfolio.
The order of topics for the first three months#
Take topics strictly one at a time and do not move on until you have solved several tasks on your own:
- Variables, types, input and output, arithmetic.
- Conditions:
if, comparisons, logical operators. - Loops: going over numbers and strings, accumulating a sum.
- Functions: parameters, return values, scope.
- Lists and dictionaries: searching, filtering, counting.
- Working with files and handling errors.
After each topic, solve five to ten tasks on a site with automatic checking. A task counts only if you wrote it without hints; if you peeked at the solution, come back to it three days later and solve it again.
First projects: small and finished#
A project teaches what tasks do not: splitting work into parts, reading error messages, finding answers in the documentation. Start with programs of 100–300 lines:
- guess the number, with an attempt counter and a high-score table in a file;
- an expense tracker: enter spending, total it by category, save to CSV;
- renaming a hundred files in a folder by a pattern;
- a console to-do list where you add, delete and mark items as done.
Every project should have a README: what the program does, how to run it, an example of it working. Interviewers notice this habit immediately.
How to check yourself without a mentor#
Automatic checks on practice sites answer the question "does the code work". The rest you check yourself:
- Write tests for your functions — at least three checks: a normal case, empty input and a boundary value.
- Reread your code a week later: if you cannot understand it at a glance, rename the variables and split long functions.
- Post a project for open code review — developer communities are happy to look at beginners' code.
- Explain your solution out loud as if to a colleague. The place where you stumble is what you have not understood yet.
Common beginner mistakes#
Watching video lessons for hours without writing code. Copying solutions just to "close" a task. Starting a game or a social network in the first month. Abandoning a project halfway. Being afraid of error messages instead of reading them: the error text usually names the file, the line and the cause.
Step-by-step plan
- Week 1 — language and setupChoose a language by your goal, install the interpreter, an editor and Git, run your first program.
- Weeks 2–6 — the basicsVariables, conditions, loops, functions; 5–10 auto-checked tasks per topic.
- Weeks 7–10 — data structures and filesLists, dictionaries, reading and writing files, handling errors.
- Weeks 11–14 — two finished projectsPrograms of 100–300 lines with a README and tests in your own repository.
- Next — a directionChoose a specialisation — web, data, backend — and make a plan for the next three months.
Start learning this in your own space
The plan goes into your repository: tick off stages, keep notes — the change history shows how far you have come.
Check yourself
1.What does this Python code print: print(7 // 2)
2.What is x after this Python code runs: x = 5, then x = x * 2 + 1?
3.What does this Python code print: print(len("hello"))
Sources
-
The Python TutorialThe language basics from the authors of Python, freefree
-
Pro GitA free book on Git, from the first steps to branchesfree
-
freeCodeCampFree programming courses with exercises checked automaticallyfree
-
CS50xHarvard's free introduction to computer sciencefree
Was this helpful?