<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Vladyslav Tochanenko's blog]]></title><description><![CDATA[Vladyslav Tochanenko's blog]]></description><link>https://blog.tochanenko.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 13:43:49 GMT</lastBuildDate><atom:link href="https://blog.tochanenko.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why learning Algorithms is Important]]></title><description><![CDATA[A common question among new programmers is whether it's necessary to learn how to write algorithms manually when there are many ready-made libraries available. The straightforward answer to this question is yes, you definitely should! However, before...]]></description><link>https://blog.tochanenko.com/why-learning-algorithms-is-important</link><guid isPermaLink="true">https://blog.tochanenko.com/why-learning-algorithms-is-important</guid><category><![CDATA[algorithms]]></category><category><![CDATA[Kotlin]]></category><category><![CDATA[Problem Solving]]></category><category><![CDATA[problem solving skills]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Vladyslav Tochanenko]]></dc:creator><pubDate>Sat, 06 Jan 2024 22:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/h3kuhYUCE9A/upload/806479a775b1cd648619304f55ccd97c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A common question among new programmers is whether it's necessary to learn how to write algorithms manually when there are many ready-made libraries available. The straightforward answer to this question is yes, you definitely should! However, before we dive into that decision, let's explore the difference between a coder and a programmer/developer.</p>
<h1 id="heading-coder-vs-developer">Coder vs Developer</h1>
<p>Coders are skilled in using one or more programming languages to write programs following set algorithms. In contrast, developers possess the ability to create these algorithms independently. Moreover, developers can not only write programs based on these algorithms but also understand how different program components, such as the User Interface and Database, should be interconnected.</p>
<p>The distinction between coders and developers is significant. In a nutshell, coders primarily dedicate their work time to writing code, almost 100% of it, whereas developers invest considerable time in designing the program structure, relationships between different components, and more. Developers can accomplish this due to their knowledge of algorithms, programming patterns, and various development technologies. While a developer's job is more challenging, it also comes with better compensation compared to that of coders.</p>
<h1 id="heading-language-is-just-a-tool">Language is just a Tool</h1>
<p>Coders may be familiar with a few programming languages, but their main task is translating human logic into instructions that computers can comprehend. This process involves writing code using programming languages like JavaScript, Python, Kotlin, C++, and more. However, languages can go out of fashion over time. For instance, Delphi (Pascal) was widely popular in the 90s, but nowadays, there are hardly any job opportunities specifically seeking Pascal coders.</p>
<p>Another illustration is how new technologies integrate into the programming realm. Java used to be the predominant language for developing Android applications. However, nowadays, nearly all new and existing applications are crafted using the newer language - Kotlin. A similar transformation occurred in iOS app development. Initially, iOS apps were built using the Objective-C programming language, but since 2014, Swift has entirely taken over, replacing Objective-C.</p>
<p>It's important to note that Java and Objective-C are still in use today but in different areas of programming. Java remains as one of the most widely used programming languages for creating back-end applications - programs that operate on servers and supply the logic utilized by user interfaces.</p>
<p>What happens to coders and developers when the programming language they've been using becomes outdated? They need to adapt and learn a new language. While this process takes time, starting early is advisable. For coders, it's a more critical situation than for developers. Coders specialize in writing code, and if the language they use becomes obsolete, they must swiftly learn a new one from scratch. On the other hand, developers have a different situation. They can create algorithms, design application structures, and coding is just a small part of their job. They are valued for their problem-solving skills. Developers can learn a new programming language and still retain 90% of their knowledge.</p>
<h1 id="heading-job-seeking-amp-algorithms">Job Seeking &amp; Algorithms</h1>
<p>The primary challenge in assessing the programming skills of a job candidate lies in understanding how effectively they handle problems and challenges that may arise during the development process. This is where algorithms prove to be beneficial.</p>
<p>Assessing a developer's skills through algorithms might not be the ideal method, yet it is extensively used in various companies, ranging from local startups to major corporations like Google or Apple.</p>
<p>The hiring procedure involves various stages, with the most crucial being the technical interview. In this phase, candidates are tasked with solving one or more problems on the spot. The interviewer assesses how effectively the candidate tackles the given problems. Since the development process can involve numerous small errors, candidates who make fewer mistakes during interviews are likely to make fewer mistakes when working on actual programs for the company.</p>
<p>As an illustration, consider a straightforward programming task involving the separation of a single line from an account creation screen, which includes the name and surname of a person. The objective is to split it into two distinct lines, for instance, transforming "Will Smith" into "Will" and "Smith." It may seem simple, right? Now, let's proceed to write a program accomplishing this task using the Kotlin programming language.</p>
<pre><code class="lang-kotlin"><span class="hljs-keyword">val</span> credentials = <span class="hljs-string">"Will Smith"</span>.split(<span class="hljs-string">" "</span>)
</code></pre>
<p>You don't need to be concerned about the specifics like <code>val</code> or <code>split</code>; the crucial aspect of this code is its logic. To obtain two separate lines, "Will" and "Smith," we simply need to split it by the space symbol. Sounds straightforward, doesn't it? However, there's a catch! What if a user has a middle name, like "Will Keith Smith"? Even better, what if a user only inputs their name, such as "Jack," without providing their surname? We must consider these possibilities as well.</p>
<p>The correct solution to the given problem involves an algorithm outlined as follows:</p>
<ol>
<li><p>Verify if the line comprises only Latin alphabet symbols.</p>
</li>
<li><p>Divide the line into words using the space symbol.</p>
</li>
<li><p>If there is only one word, designate it as the user's name.</p>
</li>
<li><p>In the case of two words, we have the user's name and surname.</p>
</li>
<li><p>If three words exist, the first one is the user's name, and the third one is the user's surname.</p>
</li>
<li><p>For four words or more, it's apparent that the user is misleading us.</p>
</li>
</ol>
<p>What initially appears to be an uncomplicated task of splitting a single line of a name and surname into two lines has evolved into six lines of logical statements. The next crucial step is to convert this logic into actual code.</p>
<p>As you can observe, the final stage in solving a problem is translating the algorithm into code. This coding aspect is not exclusive to coders alone; developers can also undertake this responsibility.</p>
<p>In essence, developers have a broader scope of responsibilities, and this role tends to offer better compensation as well!</p>
<h1 id="heading-algorithms-are-fun">Algorithms are fun!</h1>
<p>Mastering the skill of solving challenging problems is not only fulfilling but also genuinely enjoyable! When you successfully overcome a problem that has been perplexing you for days, it brings a great sense of accomplishment. The enjoyment begins right from the start, as you tackle a few straightforward challenges. Ultimately, this journey leads to the ability to solve intricate problems that demand days of dedicated effort to find the best solutions.</p>
<p>Let's engage in a practical exercise. The task is as follows: how can we determine the sum of the digits in a two-digit number using fundamental arithmetic operations such as addition (<code>+</code>), subtraction (<code>-</code>), multiplication (<code>*</code>), division (<code>/</code>), and modulo operation (<code>%</code>).</p>
<p>We can't simply instruct the computer with phrases like "take this digit and add it to that," as computers require precise instructions. Although AI chats, like ChatGPT, can perform such tasks, they were built using these fundamental operations, so let's begin from the basics.</p>
<p>Before diving into the solution, consider grabbing a sheet of paper and attempting to solve the problem independently. For instance, try creating a step-by-step algorithm using mathematical expressions to find the sum of digits in the number 42.</p>
<p>For your reference, here's an explanation of each math operation listed:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Operation</td><td>Example</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td><code>+</code></td><td><code>5 + 7 = 12</code></td><td>Sum of two numbers</td></tr>
<tr>
<td><code>-</code></td><td><code>5 - 2 = 3</code></td><td>Subtraction of the second number from the first</td></tr>
<tr>
<td><code>*</code></td><td><code>2 * 3 = 6</code></td><td>Multiplication of two numbers</td></tr>
<tr>
<td><code>/</code></td><td><code>6 / 2 = 3</code> and <code>3 / 2 = 1.5</code></td><td>Division of the first number by the second. The result is not always a whole number, even if the dividend and divisor are</td></tr>
<tr>
<td><code>%</code></td><td><code>13 % 10 = 3</code></td><td>Modulo operation that returns quotient (remainder) of the division of the first number by the second one</td></tr>
</tbody>
</table>
</div><p>When you're ready, you can proceed to learn how to solve the problem of finding the sum of digits in a two-digit number.</p>
<p>To solve the described problem, follow these steps:</p>
<ol>
<li><p>Determine how to obtain the second digit (2).</p>
</li>
<li><p>Determine how to obtain the first digit (4).</p>
</li>
<li><p>Add the first and second digits together (6).</p>
</li>
</ol>
<p>Let's begin by determining the second digit. The easiest method is to use the modulo operation, obtaining the remainder by dividing the number <code>42</code> by <code>10</code>: <code>42 % 10 = 2</code>.</p>
<p>To find the first digit, we can apply this formula: <code>(42 - 2) / 10 = 4</code>. Initially, we eliminate the second digit and then divide the result by 10. Remember how we found the number 2? We can incorporate that formula here: <code>(42 - 42 % 2) / 10 = 4</code>.</p>
<p>Thus, the complete formula appears as follows: <code>42 % 10 + (42 - 42 % 10) / 10 = 2 + 4 = 6</code>.</p>
<p>That's how a computer calculates the sum of digits in a two-digit number using the algorithm we provided! Now, let's explore one way of implementing this algorithm in Kotlin:</p>
<pre><code class="lang-kotlin"><span class="hljs-keyword">val</span> number = <span class="hljs-number">42</span>
<span class="hljs-keyword">val</span> secondDigit = number % <span class="hljs-number">10</span>
<span class="hljs-keyword">val</span> firstDigit = (number - secondDigit) / <span class="hljs-number">10</span>
<span class="hljs-keyword">val</span> result = secondDigit + firstDigit
</code></pre>
<p>In the first line, <code>val number = 42</code>, we store our initial value, 42, for later calculations. The beauty of this line is that you can replace 42 with any two-digit number, and the code will still function correctly!</p>
<p>The second line, <code>val secondDigit = number % 10</code>, calculates the remainder of division 42 by 10 and stores it. If you change the value of number to another two-digit number, the result of this line will adjust accordingly. For instance, if the initial value was 17, the second line would yield the result 7.</p>
<p>On the third line, <code>val firstDigit = (number - secondDigit) / 10</code>, we compute the first digit of our number. First, we subtract the second digit from it, obtaining a value divisible by 10, and then we divide it by 10! If the number were 17, this expression would yield the result: (17 - 7) / 10 = 1.</p>
<p>The last line, <code>val result = secondDigit + firstDigit</code>, simply calculates the sum of the previously computed and stored values of the first and second digits of the number. If <code>number</code> had a value of 17, the <code>result</code> would be 7 + 1 = 8.</p>
<p>Keep in mind that this solution is just one of many ways to address the described problem. You might come up with a better solution in the future.</p>
<h1 id="heading-how-can-i-practice-writing-algorithms">How can I practice writing Algorithms?</h1>
<p>A highly effective method for honing algorithmic writing and programming problem-solving skills is through practice on popular websites such as <a target="_blank" href="https://www.codewars.com/">CodeWars</a>, <a target="_blank" href="https://leetcode.com/">LeetCode</a>, <a target="_blank" href="https://www.hackerrank.com/">HackerRank</a>, and more. These platforms offer a diverse range of problems suitable for programmers at various levels and using different programming languages. Some websites even feature challenges related to AI and databases!</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>Acquiring proficiency in algorithms is among the most valuable skills to enhance your programming capabilities. Solving a range of problems not only sharpens your problem-solving skills but also equips you to tackle more challenging issues efficiently. While it may demand some of your time, it's important to recognize that the ability to address complex problems provides advantages both in the hiring process and in your day-to-day work.</p>
<p>If you have any questions or comments, write them in the comments! I'll be happy to respond to you.</p>
<p>Thank you for reading my article! I wish you a wonderful and productive day!</p>
]]></content:encoded></item></channel></rss>