<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Clean Code on Dmitry Sheiko&#39;s Web Development Blog</title>
    <link>https://dsheiko.com/categories/clean-code/</link>
    <description>Recent content in Clean Code on Dmitry Sheiko&#39;s Web Development Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 17 Jun 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://dsheiko.com/categories/clean-code/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Validating Function Arguments in JavaScript: The Smart Way</title>
      <link>https://dsheiko.com/weblog/validating-arguments-in-javascript-like-a-boss/</link>
      <pubDate>Thu, 23 May 2019 00:00:00 +0000</pubDate>
      <guid>https://dsheiko.com/weblog/validating-arguments-in-javascript-like-a-boss/</guid>
      <description>In software engineering we try to discover and eliminate bugs as soon as possible. One of the most important heuristics here is validation of input/output on functions and methods. If you are going with TypeScript or Flow, you are fine. But if not? Then we have to manually validate at least input (arguments). What would be the best way to do it?&#xA;First comes to mind aproba. It&amp;rsquo;s ridiculously lightweight and quite popular:</description>
    </item>
    <item>
      <title>Stop Bugs Before They Happen: Function Guards in JavaScript</title>
      <link>https://dsheiko.com/weblog/guarding-functions-in-javascript/</link>
      <pubDate>Fri, 07 Oct 2016 00:00:00 +0000</pubDate>
      <guid>https://dsheiko.com/weblog/guarding-functions-in-javascript/</guid>
      <description>As developers we spend a lot of our time on debugging and particularly on spotting the source of a problem. DevTools guides us though the call stack, but the tracing process can be still pretty time consuming, especially on a cascade of asynchronous calls. The remedy here is early problem reporting.&#xA;Let&amp;rsquo;s say we have a function to search trough a multidimensional structure for the elements containing a given string. We make a call that looks like legit:</description>
    </item>
    <item>
      <title>Dependency Injection via Factory</title>
      <link>https://dsheiko.com/weblog/dependency-injection-via-factory/</link>
      <pubDate>Sat, 21 Jan 2012 00:00:00 +0000</pubDate>
      <guid>https://dsheiko.com/weblog/dependency-injection-via-factory/</guid>
      <description>You know, when coupling is not loose, components depend too much on each other. It makes your entire architecture fragile and immobile. You can check how loose the coupling is by making a unit test for a component. If you have no problem substituting dependencies by e.g. mock objects then everything is ok. Let take a model class. It depends on DB connection, here \Lib\Db\Adapter\Interface instance. We cannot just create DB adapter instance within model constructor, because it depends on configuration data which doesn&amp;rsquo;t belong to the model.</description>
    </item>
    <item>
      <title>From Chaos to Control: Improving Your PHP Error Handling Workflow</title>
      <link>https://dsheiko.com/weblog/error-handling-for-your-php-application/</link>
      <pubDate>Wed, 26 May 2010 00:00:00 +0000</pubDate>
      <guid>https://dsheiko.com/weblog/error-handling-for-your-php-application/</guid>
      <description>However fondly you treat your application, errors happen and they happen often when it is being developed. That’s obvious you want to get all the tracing information during the development stage and something like ‘Application Error’ page if the error occurs on the production.&#xA;Everybody knows error handler can be set in PHP through set_error_handler. The same about exceptions for which set_exception_handler is used. But it really works only for user-defined errors and uncaught exceptions.</description>
    </item>
  </channel>
</rss>
