Hi, Habr! We in Hexlet launched this year an open and free project for newbies: code-basics.ru . These are interactive courses with practice designed for those who have never programmed at all. We teach the basics of programming and tell about the basic device of computers.
The full PHP course and the first JavaScript module are now available. On the approach of Racket and Python. All source code for the platform and the lessons themselves are in open source.
Today I want to talk a little about the essence of Code Basics, its innards and technological stack.

Why is it at all
The main question is: "why even the next basic courses, their million?" Unfortunately, most of the available materials are more like reference books or the next tutorials in the style of “do so, look here, work, cool, huh?”.
In the process of working on basic training programs at Hexlet, we are faced with a problem: if a person starts completely, completely from scratch, not knowing what variables and functions are, then a typical basic course or tutorial may not only help him, but even harm. A beginner will easily get used to the “magic”, to not the best coding standards, to the approach of remembering specificity instead of understanding systems.
At first glance, the project may remind Codecademy, but there are three important differences:
1. Lessons in Russian. We started with PHP, including for this reason - there were no high-quality, interactive and free lessons in Russian, and the language remains popular and important in the industry.
2. We do not teach superficially. This is an eternal dilemma - on the one hand, it is necessary to cover a lot of things and be interested in breadth (and “popular words”), on the other hand, we in Hexlet continue to follow our principles of the importance of foundation and understanding of systems, and not features. It is easier to understand with examples:
a) We consider side effects and variability - this is incredibly important, but almost no one touches on these topics in basic courses.
b) As far as strings are concerned, it is important to talk about the very concept of encoding . So that work with symbols does not become “magic and magic words”.
c) When it becomes clear that the language allows you to do strange things like 1 + '7'
, it is important to acquaint the student with typing and in particular with weak typing .
d) When the base is passed and several different pieces start appearing on the same line of code at the same time, it is very important that the person immediately understands what an expression is and how it differs from the instruction. And how expressions can be contained in definitions .
e) When working with functions begins, it is useful to continue to consider expressions, but already in the context of calls, returns, and arguments.
I think you understand the point. We, programmers, do not think much about such things as foo(a+b)
or return foo(x)
, but for beginners, very often such constructions are an order of magnitude more complicated than the "standard» foo(a)
or return x
. And here you can consider all individual cases for a long time, but it is better to explain the essence , the system of basic rules of programming languages.
Content is granular and is fed sequentially, gradually increasing the depth. For example, the same functions and expressions are divided into several lessons, where we consider various aspects, gradually connecting them into the overall picture.
3. Free and online. We did Code-Basics, among other things, because there was nowhere to send newbies preparing for our main program “Profession PHP Developer”. There is simply no free online course! More precisely, now there is :)

Other important features:
- We learn to correctly name functions and follow coding standards.
- We share our experience and best practices.
- In each exercise, there is a teacher's decision, which is available after an independent decision or after half an hour of attempts :) At the same time, you can compare your decision with the teacher's decision on one page.
- Each lesson can be discussed with other students. We try to clean the discussion from the "spoilers"
- Tasks are built around the Game of Thrones :) (see screen above, for example)
Authorization, allowing access to the exercises and save the progress of the lessons, so far only through Github. Taking this opportunity, we are provoking newbies to create an account on Github as soon as possible :)
Under the hood
Hekslet is written on Rails. We wrote about Hexlet’s guts three years ago (OMG, three years!) In the article “ Under the Hood of the Hekslet Educational Project, ” and much has changed since then, but fundamentally everything is the same: Rails, PostgreSQL, everything revolves on AWS and partially on Azure , is actively used by Docker, deploy and orchestration through Ansible. A container rises under each exercise of each user, which allows you to do exercises of almost any complexity: with frameworks, servers, and web access.
Code-Basics initially decided to try something new and more lightweight than Rails. For example, nodejs + typescript + some microfragmvork. But, preferably, no less expressive than Rails. Considering our love for Erlang, the choice naturally fell on Phoenix , especially since itching for a long time to try Elixir.
The framework unexpectedly surprised. Despite the significantly smaller number of features, it is made very soundly. JavaScript integration, developed test infrastructure, excellent ORM (but unusual, you need to get used to), many rail analogues (for example, support for slim or gon).
There was even one thing that was done significantly better than in other frameworks: creating a set of middleware for specific routes or a group of routes. Even if you will not use phoenix, we recommend that you familiarize yourself with the pipeline .
And given the presence of actors (and finished channels in Phoenix), we can definitely say that Elixir wins over Node JS in almost all situations. And other things being equal, we will choose to develop the Phoenix.

On the front - use React + Redux. Layout is built on Bootstrap 4, like all of our sites (hexlet.io, guides.hexlet.io). As an editor for interactive exercises using Monaco , the underlying VS Code. We also switched to Monaco in Hexlet itself.
Infrastructure and deployment are Terraform, Ansible and a bunch of makefiles with shortcuts for the most popular teams. Code Basics sources are available on Github , and we accept pull requests.
The lessons and practical exercises themselves. Including we accept pull-requests for translating lessons into English. While a limited number of lessons in English is available here .
Who can use Code Basics
- Novices with zero experience.
- Novice programmers who “swim a little” in basic topics and do not fully understand how things work that go beyond simple examples from textbooks.
- Teachers working with newbies.
Plans
The following Code-Basics courses are JavaScript, Racket, and Python. Now there are 63 lessons on PHP and some additional ones will be released soon: on library functions, working with date and time and unicode. JavaScript has the first module, and the content for the most part will be similar to PHP: everything from arithmetic to functions.
Further plans for translation into English. You can help with this :) All these Code Basics courses will also be completely free.
We will be happy to answer your questions in the comments. Thank!