<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jck</title>
    <description>The latest articles on DEV Community by jck (@realjck).</description>
    <link>https://dev.to/realjck</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1138072%2F8b762b24-a5a8-4121-aca2-4d50d27e8735.gif</url>
      <title>DEV Community: jck</title>
      <link>https://dev.to/realjck</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/realjck"/>
    <language>en</language>
    <item>
      <title>Simple Quiz Game using Open Trivia Database API</title>
      <dc:creator>jck</dc:creator>
      <pubDate>Sun, 27 Apr 2025 16:28:50 +0000</pubDate>
      <link>https://dev.to/realjck/simple-quiz-game-using-open-trivia-database-api-jng</link>
      <guid>https://dev.to/realjck/simple-quiz-game-using-open-trivia-database-api-jng</guid>
      <description>&lt;p&gt;A quick project: a JavaScript quiz that fetches questions from the Open Trivia Database.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/JC-Kleinbourg/embed/azzyROP?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>api</category>
      <category>codepen</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Becoming a Senior Developer - Tips from Clean Code</title>
      <dc:creator>jck</dc:creator>
      <pubDate>Mon, 10 Feb 2025 23:48:00 +0000</pubDate>
      <link>https://dev.to/realjck/becoming-a-senior-developer-tips-from-clean-code-52ka</link>
      <guid>https://dev.to/realjck/becoming-a-senior-developer-tips-from-clean-code-52ka</guid>
      <description>&lt;p&gt;If you aspire to become a senior developer, work remotely, travel, or start freelancing, there's one essential book to read: &lt;strong&gt;"Clean Code" by Robert C. Martin&lt;/strong&gt;. This book is a must-read for any developer aiming to excel in their field. Here, I'll share the top five insights I gained from the first chapter of this book. Rather than skimming through the entire book, I've chosen to focus on these insights to delve deeper into their significance and impact.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "What the Fuck" (WTF) Metric
&lt;/h2&gt;

&lt;p&gt;The first piece of advice, and perhaps the most memorable, is the concept of "What the Fuck" (WTF) per minute. This idea suggests that code quality can be measured by how often a developer asks "What the Fuck?" while reading the code. High-quality code has a low WTF rate. For example, a 1000-line file with a 10% WTF rate is much more understandable than one with a 50% rate.&lt;/p&gt;

&lt;p&gt;Although subjective, this metric is a crucial indicator of code clarity and maintainability. To objectively evaluate your code, it's recommended to revisit it after some time or have it reviewed by other developers. Code reviews and pair programming are effective practices for reducing the WTF rate.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Importance of Experience
&lt;/h2&gt;

&lt;p&gt;The second insight emphasizes the importance of experience in software development. The software industry is often managed by young developers, which can lead to long-term maintainability issues. The book stresses that code should be designed to last for years, not just to work immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Defining Clean Code
&lt;/h2&gt;

&lt;p&gt;The third lesson addresses what constitutes clean code. While definitions vary, most experts agree on three essential pillars: maintainability, flexibility, and testability. Clean code is easy to maintain, allows for the addition of new features without significant constraints, and can be tested effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimizing for the Reader
&lt;/h2&gt;

&lt;p&gt;The fourth lesson recommends optimizing code for the reader rather than the author. Since most time is spent reading code rather than writing it, it's crucial to make the code as understandable as possible. This includes using clear variable names and avoiding obscure abbreviations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example of Clean Code
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Non-Refactored Messy Code:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;checkResponseInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;active&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;inf&lt;/span&gt;
                &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Refactored Clean Code:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;checkResponseInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;active&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example demonstrates how code can be refactored to be more readable and maintainable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Boy Scout Rule
&lt;/h2&gt;

&lt;p&gt;Finally, the fifth lesson is the Boy Scout Rule: leave the code cleaner than you found it. This means that every time you work on a file, you should take the time to refactor and improve the existing code. This practice helps maintain code quality over the long term and prevents the accumulation of technical debt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;These five lessons from the first chapter of "Clean Code" are essential for any developer looking to improve their skills. While reading this book won't make you a senior developer overnight, it will provide valuable insights to enhance your coding practices and approach to development.&lt;/p&gt;

&lt;p&gt;For more insights and tips on becoming a proficient developer, stay tuned for more articles and resources. This article was generated by the video from the French YouTube channel of Simon Dieny, &lt;a href="https://www.youtube.com/@codeursenior" rel="noopener noreferrer"&gt;Codeur Senior&lt;/a&gt;. Subscribe to stay updated on the latest in software development!&lt;/p&gt;

</description>
      <category>cleancode</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Linux file system</title>
      <dc:creator>jck</dc:creator>
      <pubDate>Mon, 10 Feb 2025 21:36:20 +0000</pubDate>
      <link>https://dev.to/realjck/linux-file-system-10lp</link>
      <guid>https://dev.to/realjck/linux-file-system-10lp</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Linux Directory Structure
&lt;/h2&gt;

&lt;p&gt;Most Linux users have seen the root directory (&lt;code&gt;/&lt;/code&gt;), but not everyone understands the purpose of the various directories it contains. For a user coming from Windows, exploring the file manager in Linux might seem familiar at first: you'll find folders like "Documents", "Downloads", "Pictures", and "Videos". However, this familiarity quickly fades when you start looking for directories like "Program Files" or the C drive, which are ubiquitous in Windows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Different Evolution of Windows and Linux
&lt;/h3&gt;

&lt;p&gt;To understand why Linux is structured differently, it's helpful to look back at the history of operating systems.&lt;/p&gt;

&lt;h4&gt;
  
  
  MS-DOS and the Early Days of Windows
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MS-DOS&lt;/strong&gt;: Initially, there was MS-DOS, a command-line operating system. You could run programs, games, and software like WordPerfect on it. MS-DOS used letters to designate drives: A and B for floppy disks, and C for the primary hard drive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;: Windows was layered on top of MS-DOS. To start Windows, you had to type &lt;code&gt;win&lt;/code&gt; in the MS-DOS command-line interface. Over time, Microsoft made Windows increasingly independent of MS-DOS, until it could boot without it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Linux Directory Structure
&lt;/h4&gt;

&lt;p&gt;Linux, on the other hand, follows UNIX traditions, which explains several fundamental differences from Windows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use of the Slash (&lt;code&gt;/&lt;/code&gt;)&lt;/strong&gt; : Unlike Windows, which uses the backslash (&lt;code&gt;\&lt;/code&gt;), Linux uses the slash to separate directories.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Case Sensitivity&lt;/strong&gt;: Linux is case-sensitive, meaning that "file", "File", and "FILE" are considered different files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No "Program Files" Directory&lt;/strong&gt;: In Linux, applications are not all installed in a centralized directory like "Program Files". Instead, they are distributed across various directories based on their nature and usage.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Main Directories in Linux
&lt;/h2&gt;

&lt;p&gt;The structure of directories in Linux is defined by the Filesystem Hierarchy Standard (FHS), although not all distributions adhere strictly to this standard. Here is a detailed description of the main directories:&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;bin&lt;/strong&gt;&lt;br&gt;
Contains essential binary executables needed by all users. Examples include commands like &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;cp&lt;/code&gt;, and &lt;code&gt;mv&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;sbin&lt;/strong&gt;&lt;br&gt;
Contains system binaries, used mainly by the system administrator for maintenance and repair tasks. Examples include ifconfig and reboot.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;boot&lt;/strong&gt;&lt;br&gt;
Contains files needed for the system to boot, such as the bootloader (GRUB) and the Linux kernel.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;dev&lt;/strong&gt;&lt;br&gt;
Contains device files. In Linux, everything is considered a file, including hardware devices. For example, /dev/sda represents the first hard drive.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;etc&lt;/strong&gt;&lt;br&gt;
Contains system configuration files. Examples include network service configurations and package manager source lists.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;home&lt;/strong&gt;&lt;br&gt;
The personal directory for users, where each user has their own subdirectory to store personal files and settings.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;lib&lt;/strong&gt;, /&lt;strong&gt;lib32&lt;/strong&gt;, /&lt;strong&gt;lib64&lt;/strong&gt;&lt;br&gt;
Contain shared libraries needed by the binaries in /bin and /sbin.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;media&lt;/strong&gt; and /&lt;strong&gt;mnt&lt;/strong&gt;&lt;br&gt;
Mount points for removable devices. /media is often used for automatic mounting, while /mnt is used for manual mounts.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;opt&lt;/strong&gt;&lt;br&gt;
Contains optional software, often manually installed or from third-party vendors.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;proc&lt;/strong&gt;&lt;br&gt;
A virtual filesystem containing information about running processes and system resources. For example, /proc/cpuinfo contains information about the CPU.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;root&lt;/strong&gt;&lt;br&gt;
The personal directory for the root user, the system administrator.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;run&lt;/strong&gt;&lt;br&gt;
A temporary filesystem in RAM, used to store runtime information for processes started early in the boot process.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;snap&lt;/strong&gt;&lt;br&gt;
Contains Snap packages, a self-contained package format used primarily by Ubuntu.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;srv&lt;/strong&gt;&lt;br&gt;
Contains data for services, such as files for a web or FTP server.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;sys&lt;/strong&gt;&lt;br&gt;
An interface with the kernel for information about hardware and devices. For example, information about connected USB devices.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;tmp&lt;/strong&gt;&lt;br&gt;
A temporary directory for files used during a session. Files in /tmp are usually deleted upon reboot.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;usr&lt;/strong&gt;&lt;br&gt;
Contains user applications and libraries. For example, /usr/bin contains user binary executables.&lt;/p&gt;

&lt;p&gt;/&lt;strong&gt;var&lt;/strong&gt;&lt;br&gt;
Contains variable files, such as system logs, databases, and print queues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;While the directory structure in Linux may seem complex at first, it allows for efficient management of resources and applications. Package managers, like &lt;code&gt;apt&lt;/code&gt; for Debian/Ubuntu or &lt;code&gt;yum&lt;/code&gt; for Fedora, facilitate the installation, updating, and removal of software by following these conventions.&lt;/p&gt;

&lt;p&gt;If you found this information useful, feel free to share it and subscribe for more content.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>archlinux</category>
      <category>beginners</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
