Code

Code Complete: States Within Modules main picture
Code

You can write any code inside files (and outside of definitions) in scripting languages like JavaScript. This can be defining and calling functions, or declaring and changing variables. This freedom simplifies development by allowing you to create one-time scripts for simple or infrequent tasks. On the other hand, careless development leads to flaws that make the code and maintaining it significantly more difficult. They're so common in production code that we need to address them separately.

User avatar Kirill Mokevnin
Kirill Mokevnin
14 July 2022
0 Article reading time ~4 minutes Read more
Scripts, modules, and libraries main picture
Code

In dynamic languages, code files can be either executable scripts or modules. Each of these kinds of files have their own limitations; they're arranged differently, and they behave differently depending on their role.

User avatar Kirill Mokevnin
Kirill Mokevnin
09 June 2022
1 Article reading time ~5 minutes Read more
Code Complete: Designing Functions main picture
Code

Creating functions is easy, creating functions properly is harder. Poorly designed functions frequently have to be rewritten, it's difficult to adapt them to new requirements, and they don't get tested properly. In this article, we'll look at key methods for sharing responsibilities, building chains of functions, and designing function signatures. The article's content is based on common mistakes made by Hexlet students in their projects.

User avatar Kirill Mokevnin
Kirill Mokevnin
07 June 2022
1 Article reading time ~12 minutes Read more
The Anatomy of a Hexlet Project main picture
Code

According to our students, projects are one of Hexlet's strongest features. These are special tasks that closely mimic real-world tasks, and they're done on your own computer, outside of Hexlet tasks.

This article outlines how projects work, how long they take to complete, and why poorly written code doesn't work, and it also contains thoughts from our students about our projects.

User avatar Kirill Mokevnin
Kirill Mokevnin
04 June 2022
0 Article reading time ~8 minutes Read more
Code Complete: Descending and Ascending Order in Function Design main picture
Code

There are two approaches to writing code: top-down and bottom-up (descending and ascending). With the top-down approach, high-level logic is implemented first, followed by the details. With the bottom-up approach, everything is reversed; the details come first, followed by the general logic.

These approaches are frequently contrasted in books. It's generally considered that if you choose one approach, then you have to exclude the other one. However, this is not the case. In the article, I'll tell you why only going down one path can cause problems.

User avatar Kirill Mokevnin
Kirill Mokevnin
01 June 2022
2 Article reading time ~5 minutes Read more
Code Complete: Module Interfaces main picture
Code

In some languages, such as Python and JavaScript, variables and constants declared at module level can be imported to other parts of the program. On the one hand, this opens up a world of possibilities when compared to languages that require all data to be contained within functions, classes, etc. On the other hand, it makes it much easier to write code with issues.

User avatar Kirill Mokevnin
Kirill Mokevnin
01 June 2022
0 Article reading time ~2 minutes Read more
Code Complete: Explicit and Implicit Function Parameters main picture
Code

In dynamic languages, there are two main approaches when choosing the input parameters for functions: the first is to use explicit, positional arguments, and the second is to pass a structure containing everything that the function expects. In real code, passing arguments implicitly and explicitly are equally common, and it’s not always clear which one should be chosen for a given function. That's what we're going to look at today.

User avatar Kirill Mokevnin
Kirill Mokevnin
01 June 2022
0 Article reading time ~4 minutes Read more
Suggested learning programs
profession
Development of front-end components for web applications
10 months
from scratch
Start at any time
profession
Layout with the latest CSS standards
5 months
from scratch
under development
Start at any time
profession
new
Developing web applications with Django
10 months
from scratch
under development
Start at any time