<?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: Matheus Fernandes</title>
    <description>The latest articles on DEV Community by Matheus Fernandes (@xtirian).</description>
    <link>https://dev.to/xtirian</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%2F1117818%2Fb8635f8b-7e55-4ed5-89fb-7a7416f935fe.png</url>
      <title>DEV Community: Matheus Fernandes</title>
      <link>https://dev.to/xtirian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xtirian"/>
    <language>en</language>
    <item>
      <title>Code Craft #8 - Mastering CSS: From Basics to Intermediate</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Wed, 02 Apr 2025 10:30:12 +0000</pubDate>
      <link>https://dev.to/xtirian/mastering-css-from-basics-to-intermediate-hhp</link>
      <guid>https://dev.to/xtirian/mastering-css-from-basics-to-intermediate-hhp</guid>
      <description>&lt;p&gt;&lt;em&gt;(A Complete Beginner’s Guide)&lt;/em&gt;  &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. Why CSS Matters&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;CSS isn’t just about “pretty” websites—it impacts &lt;strong&gt;user experience&lt;/strong&gt;, &lt;strong&gt;accessibility&lt;/strong&gt;, and &lt;strong&gt;performance&lt;/strong&gt;. Did you know?  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;94% of first impressions are design-related (Adobe)
&lt;/li&gt;
&lt;li&gt;Well-styled pages increase content credibility by 75% (Stanford)
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Try This&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
View the same HTML with and without CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Without CSS --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello World&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- With CSS --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"font-family: 'Arial'; color: #2ecc71;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Hello World&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;2. CSS Syntax: Beyond the Basics&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2.1 Structure Deep Dive&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;selector&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;property&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* Comments like this */&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* Shorthand property */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Concepts&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shorthand Properties&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;  &lt;span class="c"&gt;/* Equivalent to setting margin-top, margin-right separately */&lt;/span&gt;
  &lt;span class="nt"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;10&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt; &lt;span class="err"&gt;20&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt; &lt;span class="err"&gt;15&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt; &lt;span class="err"&gt;5&lt;/span&gt;&lt;span class="nt"&gt;px&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CSS Variables&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;  &lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;--primary-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#3498db&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-color&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;h2&gt;
  
  
  &lt;strong&gt;3. Selectors: Precision Targeting&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3.1 Advanced Selectors&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Selector&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;:hover&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a:hover&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Style on mouse hover&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;::before&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.card::before&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Insert content before element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[attribute]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;input[type="email"]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Target by HTML attribute&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Real-World Example&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Style unvisited links */&lt;/span&gt;
&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:link&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#27ae60&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;h2&gt;
  
  
  &lt;strong&gt;4. Modern Layouts with Flexbox&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4.1 Quick Guide&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* Horizontal alignment */&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* Vertical alignment */&lt;/span&gt;
  &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* Space between items */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5-Minute Exercise&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
Build a responsive navbar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex-nav"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.flex-nav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#2c3e50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.flex-nav&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15px&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;h2&gt;
  
  
  &lt;strong&gt;5. Responsive Design with Media Queries&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mobile-First Approach&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Base (Mobile) */&lt;/span&gt;
&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;14px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Tablet */&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;768px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16px&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="c"&gt;/* Desktop */&lt;/span&gt;
&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1024px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;18px&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pro Tip&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
Use &lt;code&gt;rem&lt;/code&gt; units for scalable, accessible typography:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="c"&gt;/* 32px */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;6. CSS Animations (Bonus)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pulse Button Effect&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;pulse&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&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="nc"&gt;.cta-button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pulse&lt;/span&gt; &lt;span class="m"&gt;2s&lt;/span&gt; &lt;span class="n"&gt;infinite&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;h2&gt;
  
  
  &lt;strong&gt;7. Essential Tools&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Debugging&lt;/strong&gt;: Chrome DevTools (&lt;code&gt;F12&lt;/code&gt;)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preprocessors&lt;/strong&gt;: Sass/SCSS
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frameworks&lt;/strong&gt;: Bootstrap, Tailwind CSS
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;8. Next Steps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now that you’ve mastered:&lt;br&gt;&lt;br&gt;
✅ CSS syntax&lt;br&gt;&lt;br&gt;
✅ Advanced selectors&lt;br&gt;&lt;br&gt;
✅ Flexbox basics&lt;br&gt;&lt;br&gt;
✅ Responsive design  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge&lt;/strong&gt;: Recreate &lt;a href="https://codepen.io/xtirian/pen/xbxmmRB" rel="noopener noreferrer"&gt;Netflix’s navbar&lt;/a&gt; using pure CSS. Share your CodePen link!  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“CSS is like magic—until you understand the mechanics. Then it’s pure power.”&lt;/em&gt;&lt;br&gt;&lt;br&gt;
— &lt;em&gt;Adapted from Chris Coyier (CSS-Tricks)&lt;/em&gt;  &lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>css</category>
    </item>
    <item>
      <title>Computing architecture # 3 - Exploring Binary Expressions and Logical Operators: Fundamentals and Practical Applications</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Tue, 01 Apr 2025 17:17:45 +0000</pubDate>
      <link>https://dev.to/xtirian/computing-architecture-3-exploring-binary-expressions-and-logical-operators-fundamentals-and-1h89</link>
      <guid>https://dev.to/xtirian/computing-architecture-3-exploring-binary-expressions-and-logical-operators-fundamentals-and-1h89</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In the digital age, &lt;strong&gt;binary expressions&lt;/strong&gt; are the invisible building blocks behind all computing. From data processing to decision-making in complex algorithms, Boolean logic is the universal language of computers.  &lt;/p&gt;

&lt;p&gt;In this article, you will:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Master the &lt;strong&gt;basic logical operators&lt;/strong&gt; (AND, OR, NOT, XOR) and their truth tables.
&lt;/li&gt;
&lt;li&gt;Discover &lt;strong&gt;how computers "think"&lt;/strong&gt; using Boolean algebra.
&lt;/li&gt;
&lt;li&gt;Apply these concepts in &lt;strong&gt;real-world programming and digital electronics&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;What Are Binary Expressions?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Binary (or &lt;strong&gt;Boolean&lt;/strong&gt;) expressions are operations that manipulate &lt;strong&gt;0 (false)&lt;/strong&gt; and &lt;strong&gt;1 (true)&lt;/strong&gt;, based on the algebra developed by George Boole in 1854.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does this matter?&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every computational operation, no matter how complex, boils down to combinations of these expressions.
&lt;/li&gt;
&lt;li&gt;Digital systems (like CPUs and memory) use physical logic gates that implement these concepts.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Operands vs. Operators: The Anatomy of Binary Logic&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Definition&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Operand&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Binary input value (0 or 1)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;A = 1&lt;/code&gt;, &lt;code&gt;B = 0&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Operator&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Function that relates operands&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;AND&lt;/code&gt;, &lt;code&gt;OR&lt;/code&gt;, &lt;code&gt;XOR&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;The 4 Fundamental Logical Operators&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. AND Operator (&lt;code&gt;∧&lt;/code&gt; or &lt;code&gt;·&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Outputs &lt;code&gt;1&lt;/code&gt; &lt;strong&gt;only if&lt;/strong&gt; all operands are &lt;code&gt;1&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Analogy:&lt;/strong&gt; A security system that only disarms with &lt;strong&gt;two keys&lt;/strong&gt; turned simultaneously.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;A&lt;/th&gt;
&lt;th&gt;B&lt;/th&gt;
&lt;th&gt;A AND B&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Application:&lt;/strong&gt; Checking multiple mandatory conditions (e.g., "Access granted if password is correct AND card is valid").  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. OR Operator (&lt;code&gt;∨&lt;/code&gt; or &lt;code&gt;+&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Outputs &lt;code&gt;1&lt;/code&gt; if &lt;strong&gt;at least one&lt;/strong&gt; operand is &lt;code&gt;1&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Analogy:&lt;/strong&gt; An alarm that triggers when &lt;strong&gt;any sensor&lt;/strong&gt; is activated.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;A&lt;/th&gt;
&lt;th&gt;B&lt;/th&gt;
&lt;th&gt;A OR B&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Application:&lt;/strong&gt; Evaluating alternative conditions (e.g., "Discount for students OR seniors").  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. NOT Operator (&lt;code&gt;¬&lt;/code&gt; or &lt;code&gt;~&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Inverts the operand’s value (&lt;code&gt;0 → 1&lt;/code&gt;, &lt;code&gt;1 → 0&lt;/code&gt;).&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Analogy:&lt;/strong&gt; A simple on/off switch.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;A&lt;/th&gt;
&lt;th&gt;NOT A&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Application:&lt;/strong&gt; Negating conditions (e.g., "If NOT raining, turn on the sprinkler").  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4. XOR Operator (&lt;code&gt;⊕&lt;/code&gt;)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Outputs &lt;code&gt;1&lt;/code&gt; if operands are &lt;strong&gt;different&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Analogy:&lt;/strong&gt; A light that turns on when &lt;strong&gt;only one switch&lt;/strong&gt; is active.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;A&lt;/th&gt;
&lt;th&gt;B&lt;/th&gt;
&lt;th&gt;A XOR B&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Application:&lt;/strong&gt; Detecting inequalities (e.g., Comparing bits in cryptography).  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Truth Tables: The Map of Logic&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A truth table lists &lt;strong&gt;all possible combinations&lt;/strong&gt; of operands and their results.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Formula:&lt;/strong&gt; Number of rows = &lt;code&gt;2ⁿ&lt;/code&gt; (where &lt;code&gt;n&lt;/code&gt; = number of variables).  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example for 3 variables (A, B, C):&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
| A | B | C | A OR B | (A OR B) AND C |&lt;br&gt;&lt;br&gt;
|---|---|---|--------|----------------|&lt;br&gt;&lt;br&gt;
| 0 | 0 | 0 |   0    |       0        |&lt;br&gt;&lt;br&gt;
| 0 | 0 | 1 |   0    |       0        |&lt;br&gt;&lt;br&gt;
|...|...|...|  ...   |      ...       |&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;When to Use Each Operator?&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;
&lt;th&gt;Typical Use Case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AND&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Multiple validations (e.g., login + password).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OR&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Alternative options (e.g., payment via PIX OR credit card).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;NOT&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;State inversion (e.g., "while NOT end_of_file").&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;XOR&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Parity checks or toggling (e.g., switching an LED).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion: The Logic Behind Digital Magic&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Binary expressions are the &lt;strong&gt;basic grammar&lt;/strong&gt; computers use to process information. Mastering these concepts is essential for:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Efficient programming&lt;/strong&gt; (conditionals, loops).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Digital circuit design&lt;/strong&gt; (logic gates, ALUs).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Algorithm optimization&lt;/strong&gt; (searches, filters).
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Boolean logic is to computing what the alphabet is to literature."&lt;/em&gt;  &lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Further Learning Resources&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Book:&lt;/strong&gt; &lt;em&gt;"&lt;a href="https://bobcarp.wordpress.com/wp-content/uploads/2014/07/code-charles-petzold.pdf" rel="noopener noreferrer"&gt;Code: The Hidden Language of Computer Hardware and Software&lt;/a&gt;"&lt;/em&gt; (Charles Petzold).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Tool:&lt;/strong&gt; &lt;a href="https://logic.ly/demo" rel="noopener noreferrer"&gt;Logic.ly&lt;/a&gt; (logic gate simulator).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Course:&lt;/strong&gt; "Boolean Algebra and Logic Gates" (Coursera).
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Here’s a set of exercises (with solutions at the end) to reinforce the concepts covered in your article.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Practice Exercises: Binary Expressions and Logical Operators&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 1: Truth Tables&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Fill in the missing outputs for the following truth tables.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NAND Operator (NOT AND)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
| A | B | A NAND B |&lt;br&gt;&lt;br&gt;
|---|---|----------|&lt;br&gt;&lt;br&gt;
| 0 | 0 |    ?     |&lt;br&gt;&lt;br&gt;
| 0 | 1 |    ?     |&lt;br&gt;&lt;br&gt;
| 1 | 0 |    ?     |&lt;br&gt;&lt;br&gt;
| 1 | 1 |    ?     |  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Half-Adder Logic&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
(S = A XOR B, C = A AND B)&lt;br&gt;&lt;br&gt;
| A | B | S (Sum) | C (Carry) |&lt;br&gt;&lt;br&gt;
|---|---|---------|-----------|&lt;br&gt;&lt;br&gt;
| 0 | 0 |    ?    |     ?     |&lt;br&gt;&lt;br&gt;
| 0 | 1 |    ?    |     ?     |&lt;br&gt;&lt;br&gt;
| 1 | 0 |    ?    |     ?     |&lt;br&gt;&lt;br&gt;
| 1 | 1 |    ?    |     ?     |  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 2: Logical Expressions&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Simplify or evaluate the following expressions (assume &lt;code&gt;A=1&lt;/code&gt;, &lt;code&gt;B=0&lt;/code&gt;, &lt;code&gt;C=1&lt;/code&gt;):  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;(A AND B) OR (NOT C)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NOT (A XOR B)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;(A OR B) AND (B OR C)&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 3: Real-World Scenarios&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Write the logical expression for each situation:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A smart thermostat turns on the AC if:

&lt;ul&gt;
&lt;li&gt;Temperature &amp;gt; 25°C &lt;strong&gt;AND&lt;/strong&gt; (Humidity &amp;gt; 60% &lt;strong&gt;OR&lt;/strong&gt; UserOverride = 1).
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;A parking lot gate opens if:

&lt;ul&gt;
&lt;li&gt;(PaymentValid = 1 &lt;strong&gt;AND&lt;/strong&gt; CarDetected = 1) &lt;strong&gt;OR&lt;/strong&gt; (EmergencyOverride = 1).
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 4: Circuit Design&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Draw the logic gate diagram for:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;(A AND B) OR (NOT C)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;A 3-input XOR gate (Hint: Chain two 2-input XORs).
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Challenge Problem&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Prove &lt;strong&gt;De Morgan’s Laws&lt;/strong&gt; using truth tables:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;NOT (A AND B) = (NOT A) OR (NOT B)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NOT (A OR B) = (NOT A) AND (NOT B)&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Solutions&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 1 Answers:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NAND Truth Table&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
| A | B | A NAND B |&lt;br&gt;&lt;br&gt;
|---|---|----------|&lt;br&gt;&lt;br&gt;
| 0 | 0 |    1     |&lt;br&gt;&lt;br&gt;
| 0 | 1 |    1     |&lt;br&gt;&lt;br&gt;
| 1 | 0 |    1     |&lt;br&gt;&lt;br&gt;
| 1 | 1 |    0     |  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Half-Adder Truth Table&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
| A | B | S | C |&lt;br&gt;&lt;br&gt;
|---|---|-----|---|&lt;br&gt;&lt;br&gt;
| 0 | 0 | 0 | 0 |&lt;br&gt;&lt;br&gt;
| 0 | 1 | 1 | 0 |&lt;br&gt;&lt;br&gt;
| 1 | 0 | 1 | 0 |&lt;br&gt;&lt;br&gt;
| 1 | 1 | 0 | 1 |  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 2 Answers:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;(1 AND 0) OR (NOT 1) = 0 OR 0 = 0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NOT (1 XOR 0) = NOT 1 = 0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;(1 OR 0) AND (0 OR 1) = 1 AND 1 = 1&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 3 Answers:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;AC_ON = (Temp &amp;gt; 25) AND ((Humidity &amp;gt; 60) OR UserOverride)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GateOpen = (PaymentValid AND CarDetected) OR EmergencyOverride&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 4 Hints:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Use AND → NOT → OR gates in sequence.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;A XOR B XOR C = (A XOR B) XOR C&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Challenge Proof:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Construct truth tables for both sides of each law to show identical outputs.  &lt;/p&gt;

</description>
      <category>architecture</category>
      <category>computerscience</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Vanilla HTML, CSS, and JavaScript vs. Frameworks: A Simple Website Development Debate</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Mon, 24 Mar 2025 14:27:37 +0000</pubDate>
      <link>https://dev.to/xtirian/vanilla-html-css-and-javascript-vs-frameworks-a-simple-website-development-debate-oio</link>
      <guid>https://dev.to/xtirian/vanilla-html-css-and-javascript-vs-frameworks-a-simple-website-development-debate-oio</guid>
      <description>&lt;p&gt;In today's world of web development, there are countless ways to approach building websites. One of the most common debates centers around whether to use plain, &lt;strong&gt;vanilla HTML&lt;/strong&gt;, &lt;strong&gt;CSS&lt;/strong&gt;, and &lt;strong&gt;JavaScript&lt;/strong&gt; or to rely on &lt;strong&gt;frameworks&lt;/strong&gt; like React, Angular, or Vue.js. Both approaches have their merits, but which one is the best choice for building simple websites that don’t require heavy maintenance?&lt;/p&gt;

&lt;p&gt;In this article, we'll explore the pros and cons of both methods and, ultimately, conclude that &lt;strong&gt;vanilla HTML, CSS, and JavaScript&lt;/strong&gt; might be the better option for straightforward websites that don’t need complex features or frequent updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Vanilla HTML, CSS, and JavaScript: The Basics&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Before diving into the comparison, let's define what we mean by &lt;strong&gt;vanilla HTML, CSS, and JavaScript&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML (Hypertext Markup Language)&lt;/strong&gt;: The foundational language for structuring content on the web.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS (Cascading Style Sheets)&lt;/strong&gt;: A language for styling the appearance of HTML elements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JavaScript&lt;/strong&gt;: A programming language that adds interactivity to the web pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This trio forms the backbone of most simple websites. It’s lightweight, fast, and doesn’t require any additional libraries or frameworks to work.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros of Vanilla HTML, CSS, and JavaScript
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simplicity and Speed&lt;/strong&gt;: With vanilla code, the website is essentially just a combination of static files. There’s no need to load large libraries or deal with the complexity that frameworks introduce. This results in faster page load times and a more responsive user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy to Learn and Debug&lt;/strong&gt;: For beginners or those just starting out, writing plain HTML, CSS, and JavaScript is straightforward. You don’t need to understand complex configurations or tooling—just basic file management and writing code. Additionally, when bugs arise, they tend to be easier to identify because everything is happening in a single layer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fewer Dependencies&lt;/strong&gt;: By not relying on external libraries or frameworks, you avoid worrying about dependency management, versioning issues, or library-specific updates. This can be a significant advantage for small projects where dependencies may be overkill.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Better SEO&lt;/strong&gt;: Plain HTML pages tend to be more SEO-friendly right out of the box. There’s no need for special configurations or server-side rendering to ensure that search engines can crawl the content. Everything is loaded immediately when the page is served.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Long-Term Maintainability&lt;/strong&gt;: For simple websites that won’t need frequent updates or heavy feature additions, vanilla HTML, CSS, and JavaScript offer minimal overhead. As long as the website is kept up to date with basic security patches, it’s easy to maintain without worrying about new framework versions or complex updates.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Cons of Vanilla HTML, CSS, and JavaScript
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limited Scalability&lt;/strong&gt;: For large or dynamic websites, vanilla code can become cumbersome. As your project grows, managing multiple files and handling complex interactions without a framework can get messy. For larger projects, frameworks offer structure and tools that help maintain consistency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Manual Optimization&lt;/strong&gt;: When working with vanilla JavaScript, you often need to manually handle optimizations like lazy loading, code splitting, and performance tuning, which frameworks usually automate for you.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;Using Frameworks (React, Angular, Vue.js): The Modern Approach&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Frameworks like &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Angular&lt;/strong&gt;, and &lt;strong&gt;Vue.js&lt;/strong&gt; have gained popularity because they offer a more sophisticated, component-based approach to building websites and applications. These frameworks come with a set of tools, libraries, and structure that enable developers to build complex applications quickly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros of Frameworks
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Componentization and Reusability&lt;/strong&gt;: Frameworks allow for the creation of reusable components, making it easier to maintain large applications. For complex websites that require dynamic content or interactivity, this is a huge advantage. You can break down your website into manageable parts and reuse them throughout your site.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Built-in Functionality&lt;/strong&gt;: Frameworks often come with a host of built-in features, such as routing, state management, and form handling. This can save a lot of time compared to writing your own custom solutions from scratch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SEO and Performance Optimization&lt;/strong&gt;: Many modern frameworks, like &lt;strong&gt;Next.js&lt;/strong&gt; (for React) or &lt;strong&gt;Nuxt.js&lt;/strong&gt; (for Vue), offer server-side rendering (SSR) and static site generation (SSG) capabilities, which help optimize the SEO and performance of your website. These frameworks allow your content to be visible to search engines right away, even if the website relies heavily on JavaScript.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster Development&lt;/strong&gt;: With frameworks, you don’t need to reinvent the wheel. Common functionality, like managing state or handling complex user interactions, is already handled by the framework. This accelerates development time and allows developers to focus on features rather than basic functionality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability and Maintainability&lt;/strong&gt;: As your project grows, frameworks provide a structure that helps keep your codebase organized. They’re especially helpful for large, dynamic websites that require frequent updates or complex user interactions.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Cons of Frameworks
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Steeper Learning Curve&lt;/strong&gt;: Frameworks come with a lot of built-in concepts and patterns that developers need to understand. From state management to routing, developers have to learn how to work within the framework’s ecosystem, which can take time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance Overhead&lt;/strong&gt;: Frameworks often require additional JavaScript to run, which can lead to slower page load times, especially if the website is small and doesn’t need all the features that a framework provides. This can negatively impact SEO and user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dependency Management&lt;/strong&gt;: Frameworks rely heavily on external libraries and tools, which can create dependency issues. Keeping track of updates, managing compatibility between different versions, and dealing with deprecated libraries can be a hassle for developers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Overkill for Simple Websites&lt;/strong&gt;: For websites that don’t require dynamic features, complex interactions, or frequent updates, using a framework can be overkill. The complexity and extra overhead might not be worth it if your website is just a static landing page or a simple blog.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;When Is Vanilla HTML, CSS, and JavaScript Better?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After considering the advantages and disadvantages of both approaches, it's clear that &lt;strong&gt;vanilla HTML, CSS, and JavaScript&lt;/strong&gt; is the better choice for websites that are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simple&lt;/strong&gt;: If your website doesn't require complex features like user authentication, state management, or dynamic content rendering, vanilla code is more than enough. For instance, a small business website, portfolio, or informational page can be built entirely with vanilla HTML, CSS, and JavaScript.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Low Maintenance&lt;/strong&gt;: If you're building a site that won't need frequent updates or complex interactions, the simplicity of vanilla HTML, CSS, and JavaScript makes it easier to maintain in the long run. You don’t have to worry about library or framework updates, compatibility issues, or managing dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SEO-Focused&lt;/strong&gt;: For SEO optimization, vanilla HTML is a clear winner for static websites. Search engines will easily crawl your content since it’s already present in the HTML and doesn’t rely on JavaScript for rendering.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance-Critical&lt;/strong&gt;: When every millisecond counts, especially on mobile devices or in regions with slower internet speeds, a lightweight vanilla site ensures minimal loading times, which is important for retaining users and improving your SEO rankings.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Conclusion: Vanilla is the Way to Go for Simple Websites
&lt;/h3&gt;

&lt;p&gt;While frameworks like React, Angular, and Vue are powerful tools that are great for building complex, dynamic web applications, they can be overkill for simple websites that don’t require frequent updates or complex interactions. &lt;/p&gt;

&lt;p&gt;For those projects, &lt;strong&gt;vanilla HTML, CSS, and JavaScript&lt;/strong&gt; offer a simpler, faster, and more maintainable solution. These technologies allow developers to focus on content, styling, and basic interactivity without the overhead of learning and managing a framework.&lt;/p&gt;

&lt;p&gt;Ultimately, if you’re building a &lt;strong&gt;small, static website&lt;/strong&gt; or a &lt;strong&gt;simple landing page&lt;/strong&gt;, stick with the basics—vanilla HTML, CSS, and JavaScript. You'll save time, reduce complexity, and have a website that's fast, SEO-friendly, and easy to maintain.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Computing architecture - Binary mathematic</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Fri, 21 Mar 2025 19:31:33 +0000</pubDate>
      <link>https://dev.to/xtirian/computing-architecture-binary-mathematic-56ck</link>
      <guid>https://dev.to/xtirian/computing-architecture-binary-mathematic-56ck</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Introduction to the Binary System&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;What is the Binary System?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The binary system is a base-2 numeral system. Instead of using the 10 digits of the decimal system (0 to 9), the binary system uses only two digits: &lt;strong&gt;0&lt;/strong&gt; and &lt;strong&gt;1&lt;/strong&gt;. These two digits are called &lt;strong&gt;bits&lt;/strong&gt; (short for "binary digits").&lt;/p&gt;

&lt;p&gt;In the context of computing, the binary system is fundamental. This is because the electronic circuits in computers operate in a simplified manner with two possible states: &lt;strong&gt;on&lt;/strong&gt; (represented by 1) and &lt;strong&gt;off&lt;/strong&gt; (represented by 0). These two states correspond to the two digits of the binary system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Practical Example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1&lt;/strong&gt; can be interpreted as "on" or "true."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0&lt;/strong&gt; can be interpreted as "off" or "false."&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Why is the Binary System Important?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The importance of the binary system lies in the fact that computers operate electrically, and computer circuits require two distinct states to represent information. These states are physically realized as &lt;strong&gt;high voltage (1)&lt;/strong&gt; and &lt;strong&gt;low voltage (0)&lt;/strong&gt;, making the binary system perfect for this type of operation.&lt;/p&gt;

&lt;p&gt;When you see a number like &lt;strong&gt;1011&lt;/strong&gt; on your computer, it represents a binary number, which will be converted into a decimal number or used for computational operations.&lt;/p&gt;




&lt;h4&gt;
  
  
  &lt;strong&gt;Comparison with the Decimal System&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The decimal system is the numeral system we use in everyday life, with a base of 10. It uses digits from 0 to 9. The base 10 means that in each position, the value is multiplied by powers of 10. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The number &lt;strong&gt;235&lt;/strong&gt; in the decimal system is interpreted as:
[
2 \times 10^2 + 3 \times 10^1 + 5 \times 10^0
]
Which results in:
[
2 \times 100 + 3 \times 10 + 5 \times 1 = 200 + 30 + 5 = 235
]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the binary system, the positions also have powers, but with a base of 2. Instead of multiplying by 10, each position in a binary number is multiplied by powers of 2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick Comparison Between the Decimal and Binary Systems:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Decimal System (Base 10):&lt;/strong&gt; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binary System (Base 2):&lt;/strong&gt; 0, 1.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The decimal system is more familiar, as it is what we use in daily life, while the binary system is used internally by computers to store and process data.&lt;/p&gt;




&lt;h4&gt;
  
  
  &lt;strong&gt;How to Represent Decimal Numbers in the Binary System?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;To convert a decimal number to binary, the most common method is &lt;strong&gt;successive division by 2&lt;/strong&gt;, where the remainder of each division becomes the corresponding binary digit (0 or 1). The process continues until the quotient is 0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example of Decimal to Binary Conversion:&lt;/strong&gt;&lt;br&gt;
Let’s convert the number &lt;strong&gt;13&lt;/strong&gt; (decimal) to binary.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide 13 by 2: quotient = 6, remainder = 1.&lt;/li&gt;
&lt;li&gt;Divide 6 by 2: quotient = 3, remainder = 0.&lt;/li&gt;
&lt;li&gt;Divide 3 by 2: quotient = 1, remainder = 1.&lt;/li&gt;
&lt;li&gt;Divide 1 by 2: quotient = 0, remainder = 1.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, read the remainders from bottom to top: &lt;strong&gt;1101&lt;/strong&gt;.&lt;br&gt;
Therefore, &lt;strong&gt;13 (decimal)&lt;/strong&gt; is equal to &lt;strong&gt;1101 (binary)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decimal to Binary Conversion Table (for small numbers):&lt;/strong&gt;&lt;br&gt;
| Decimal | Binary |&lt;br&gt;
|---------|--------|&lt;br&gt;
| 0       | 0      |&lt;br&gt;
| 1       | 1      |&lt;br&gt;
| 2       | 10     |&lt;br&gt;
| 3       | 11     |&lt;br&gt;
| 4       | 100    |&lt;br&gt;
| 5       | 101    |&lt;br&gt;
| 6       | 110    |&lt;br&gt;
| 7       | 111    |&lt;br&gt;
| 8       | 1000   |&lt;br&gt;
| 9       | 1001   |&lt;br&gt;
| 10      | 1010   |&lt;br&gt;
| 11      | 1011   |&lt;br&gt;
| 12      | 1100   |&lt;br&gt;
| 13      | 1101   |&lt;/p&gt;

&lt;p&gt;This conversion process is important when working with computers or electronic systems that directly handle binary information.&lt;/p&gt;




&lt;h4&gt;
  
  
  &lt;strong&gt;Conclusion of the Introduction to the Binary System&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The binary system is essential for the functioning of modern computers, as it reflects the nature of electronic circuits that have two states. Compared to the decimal system, which we use in our daily lives, the binary system operates with only two digits: &lt;strong&gt;0&lt;/strong&gt; and &lt;strong&gt;1&lt;/strong&gt;. The conversion between the decimal and binary systems is a simple process of successive divisions and is the foundation of all digital computing.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conversions Between Binary and Decimal&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In this module, we will learn the two fundamental processes for converting between the binary and decimal numeral systems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Conversion from Binary to Decimal&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conversion from Decimal to Binary&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These processes are essential for understanding how computers interpret and manipulate data.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conversion from Binary to Decimal&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you have a binary number and need to convert it to decimal, the main idea is to use powers of 2. The position of each &lt;strong&gt;bit&lt;/strong&gt; (binary digit) in the binary number represents a power of 2. The conversion follows the principle that each binary digit multiplied by its corresponding position (power of 2) results in a value that, when added to the others, forms the decimal number.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Steps to Convert Binary to Decimal:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Write down the binary number.&lt;/li&gt;
&lt;li&gt;Identify the position of each binary digit, starting from the right (the first position is 0).&lt;/li&gt;
&lt;li&gt;Multiply each binary digit by the corresponding power of 2.&lt;/li&gt;
&lt;li&gt;Add up the results obtained for each binary digit.&lt;/li&gt;
&lt;li&gt;The final result will be the equivalent decimal value.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Practical Example: Convert the binary number 1011 to decimal&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The binary number is &lt;strong&gt;1011&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Starting from the right to the left, the positions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first &lt;strong&gt;1&lt;/strong&gt; is in position &lt;strong&gt;3&lt;/strong&gt; (2³).&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;0&lt;/strong&gt; is in position &lt;strong&gt;2&lt;/strong&gt; (2²).&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;1&lt;/strong&gt; is in position &lt;strong&gt;1&lt;/strong&gt; (2¹).&lt;/li&gt;
&lt;li&gt;The last &lt;strong&gt;1&lt;/strong&gt; is in position &lt;strong&gt;0&lt;/strong&gt; (2⁰).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, multiply each binary digit by the corresponding power of 2:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;( 1 \times 2^3 = 1 \times 8 = 8 )&lt;/li&gt;
&lt;li&gt;( 0 \times 2^2 = 0 \times 4 = 0 )&lt;/li&gt;
&lt;li&gt;( 1 \times 2^1 = 1 \times 2 = 2 )&lt;/li&gt;
&lt;li&gt;( 1 \times 2^0 = 1 \times 1 = 1 )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add the results:&lt;br&gt;
[&lt;br&gt;
8 + 0 + 2 + 1 = 11&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;Therefore, &lt;strong&gt;1011 (binary)&lt;/strong&gt; is equal to &lt;strong&gt;11 (decimal)&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conversion from Decimal to Binary&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To convert a decimal number to binary, the process is the reverse: we use the &lt;strong&gt;successive division by 2&lt;/strong&gt; method. The decimal number is repeatedly divided by 2, and the remainders from each division form the binary number from bottom to top.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Steps to Convert Decimal to Binary:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Divide the decimal number by 2.&lt;/li&gt;
&lt;li&gt;Write down the remainder of the division.&lt;/li&gt;
&lt;li&gt;Use the quotient from the division to divide again by 2.&lt;/li&gt;
&lt;li&gt;Repeat the process until the quotient is 0.&lt;/li&gt;
&lt;li&gt;The binary number is the sequence of remainders read from bottom to top.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Practical Example: Convert the decimal number 13 to binary&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Divide 13 by 2:
[
13 \div 2 = 6 \quad \text{(remainder 1)}
]&lt;/li&gt;
&lt;li&gt;Divide 6 by 2:
[
6 \div 2 = 3 \quad \text{(remainder 0)}
]&lt;/li&gt;
&lt;li&gt;Divide 3 by 2:
[
3 \div 2 = 1 \quad \text{(remainder 1)}
]&lt;/li&gt;
&lt;li&gt;Divide 1 by 2:
[
1 \div 2 = 0 \quad \text{(remainder 1)}
]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, reading the remainders from bottom to top, we get &lt;strong&gt;1101&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Therefore, &lt;strong&gt;13 (decimal)&lt;/strong&gt; is equal to &lt;strong&gt;1101 (binary)&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Summary of Methods&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Conversion&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Method&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Binary to Decimal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Use powers of 2, multiply each binary digit by the corresponding power, and add the results.&lt;/td&gt;
&lt;td&gt;( 1011_2 = 8 + 0 + 2 + 1 = 11_{10} )&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Decimal to Binary&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Divide the decimal number successively by 2, note the remainders, and read them from bottom to top.&lt;/td&gt;
&lt;td&gt;( 13_{10} = 1101_2 )&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Exercises to Practice&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Convert the binary number &lt;strong&gt;11010&lt;/strong&gt; to decimal.&lt;/li&gt;
&lt;li&gt;Convert the decimal number &lt;strong&gt;25&lt;/strong&gt; to binary.&lt;/li&gt;
&lt;li&gt;Convert the binary number &lt;strong&gt;111111&lt;/strong&gt; to decimal.&lt;/li&gt;
&lt;li&gt;Convert the decimal number &lt;strong&gt;7&lt;/strong&gt; to binary.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Arithmetic Operations in the Binary System&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In this module, we will learn how to perform the main arithmetic operations with binary numbers. Binary operations follow principles similar to those in the decimal system, but with specific rules for dealing with only two digits: &lt;strong&gt;0&lt;/strong&gt; and &lt;strong&gt;1&lt;/strong&gt;. We will explore &lt;strong&gt;addition&lt;/strong&gt;, &lt;strong&gt;subtraction&lt;/strong&gt;, &lt;strong&gt;multiplication&lt;/strong&gt;, and &lt;strong&gt;division&lt;/strong&gt; in the binary system.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Binary Addition&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Binary addition is quite simple, but we need to pay attention to the &lt;strong&gt;carry&lt;/strong&gt; (or "transport") when the sum of two binary digits results in &lt;strong&gt;10&lt;/strong&gt;. Below are the basic rules for binary addition:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;( 0 + 0 = 0 )&lt;/li&gt;
&lt;li&gt;( 1 + 0 = 1 )&lt;/li&gt;
&lt;li&gt;( 0 + 1 = 1 )&lt;/li&gt;
&lt;li&gt;( 1 + 1 = 10 ) (Here, the &lt;strong&gt;1&lt;/strong&gt; is carried over to the next column.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Practical Example: Add 1011 + 1101&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Let’s add the binary numbers &lt;strong&gt;1011&lt;/strong&gt; and &lt;strong&gt;1101&lt;/strong&gt; step by step:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Align the numbers vertically:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    1011
   + 1101
   ------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Start adding from right to left:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;( 1 + 1 = 10 ): Write down &lt;strong&gt;0&lt;/strong&gt; and carry over &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 1 + 0 + 1 ) (carry) = &lt;strong&gt;10&lt;/strong&gt;: Write down &lt;strong&gt;0&lt;/strong&gt; and carry over &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 0 + 1 + 1 ) (carry) = &lt;strong&gt;10&lt;/strong&gt;: Write down &lt;strong&gt;0&lt;/strong&gt; and carry over &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 1 + 1 + 1 ) (carry) = &lt;strong&gt;11&lt;/strong&gt;: Write down &lt;strong&gt;1&lt;/strong&gt; and carry over &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Since there is a remaining carry, place the &lt;strong&gt;1&lt;/strong&gt; to the left:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    1011
   + 1101
   ------
   11000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Therefore, &lt;strong&gt;1011 + 1101 = 11000&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Binary Subtraction&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Binary subtraction is a bit more complex because when the top digit is smaller than the bottom digit, we need to &lt;strong&gt;borrow&lt;/strong&gt; from the next column, just like in decimal subtraction.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Rules for Binary Subtraction:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;( 0 - 0 = 0 )&lt;/li&gt;
&lt;li&gt;( 1 - 0 = 1 )&lt;/li&gt;
&lt;li&gt;( 1 - 1 = 0 )&lt;/li&gt;
&lt;li&gt;( 0 - 1 = 1 ) (with borrowing: subtract &lt;strong&gt;1&lt;/strong&gt; from the next column, and the number becomes &lt;strong&gt;10&lt;/strong&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Practical Example: Subtract 1011 - 110&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Let’s subtract &lt;strong&gt;110&lt;/strong&gt; from &lt;strong&gt;1011&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Align the numbers:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    1011
   -  110
   ------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start subtracting from right to left:

&lt;ul&gt;
&lt;li&gt;( 1 - 0 = 1 )&lt;/li&gt;
&lt;li&gt;( 1 - 1 = 0 )&lt;/li&gt;
&lt;li&gt;( 0 - 1 = 1 ) (borrow &lt;strong&gt;1&lt;/strong&gt; from the next column, turning the &lt;strong&gt;1&lt;/strong&gt; into &lt;strong&gt;0&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;( 1 ) (now &lt;strong&gt;0&lt;/strong&gt; after borrowing) - ( 1 = 1 ).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Therefore, &lt;strong&gt;1011 - 110 = 1001&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Binary Multiplication&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Binary multiplication follows a process similar to decimal multiplication, but since we are dealing with only two digits, the rules are simpler. When multiplying by &lt;strong&gt;0&lt;/strong&gt;, the result is &lt;strong&gt;0&lt;/strong&gt;; when multiplying by &lt;strong&gt;1&lt;/strong&gt;, the result is the original number.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Rules for Binary Multiplication:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;( 0 \times 0 = 0 )&lt;/li&gt;
&lt;li&gt;( 0 \times 1 = 0 )&lt;/li&gt;
&lt;li&gt;( 1 \times 0 = 0 )&lt;/li&gt;
&lt;li&gt;( 1 \times 1 = 1 )&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Practical Example: Multiply 101 × 11&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Align the numbers:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     101
   ×   11
   ------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Multiply &lt;strong&gt;101&lt;/strong&gt; by &lt;strong&gt;1&lt;/strong&gt; (the unit digit of the second number):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     101
   ×    1
   ------
     101
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Multiply &lt;strong&gt;101&lt;/strong&gt; by &lt;strong&gt;1&lt;/strong&gt; (the tens digit of the second number), but shift the result to the left (equivalent to multiplying by &lt;strong&gt;10&lt;/strong&gt; in decimal):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     101
   ×   10
   ------
    1010
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add the two results:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     101
   + 1010
   ------
    1111
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Therefore, &lt;strong&gt;101 × 11 = 1111&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Binary Division&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Binary division follows a process similar to the long division we use in the decimal system. Here, we repeatedly divide the binary number, subtracting multiples of the divisor until the quotient is &lt;strong&gt;0&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Practical Example: Divide 1101 by 10&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Align the numbers:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    1101 ÷ 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Start dividing from left to right:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;10&lt;/strong&gt; fits into &lt;strong&gt;11&lt;/strong&gt; once, so we place &lt;strong&gt;1&lt;/strong&gt; in the quotient and subtract &lt;strong&gt;10&lt;/strong&gt; from &lt;strong&gt;11&lt;/strong&gt; (leaving &lt;strong&gt;1&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Bring down the next digit (&lt;strong&gt;0&lt;/strong&gt;), resulting in &lt;strong&gt;10&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;10&lt;/strong&gt; fits into &lt;strong&gt;10&lt;/strong&gt; once, so we place &lt;strong&gt;1&lt;/strong&gt; in the quotient and subtract &lt;strong&gt;10&lt;/strong&gt; from &lt;strong&gt;10&lt;/strong&gt; (leaving &lt;strong&gt;0&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Bring down the next digit (&lt;strong&gt;1&lt;/strong&gt;), resulting in &lt;strong&gt;1&lt;/strong&gt;. Since &lt;strong&gt;10&lt;/strong&gt; does not fit into &lt;strong&gt;1&lt;/strong&gt;, we place &lt;strong&gt;0&lt;/strong&gt; in the quotient.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The quotient is &lt;strong&gt;110&lt;/strong&gt;, and the remainder is &lt;strong&gt;1&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Therefore, &lt;strong&gt;1101 ÷ 10 = 110&lt;/strong&gt; with a remainder of &lt;strong&gt;1&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Summary of Arithmetic Operations in the Binary System&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Operation&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Method&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Binary Addition&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Add the binary digits, considering the carry (if the sum is &lt;strong&gt;10&lt;/strong&gt;).&lt;/td&gt;
&lt;td&gt;( 1011 + 1101 = 11000 )&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Binary Subtraction&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Subtract the digits, borrowing when necessary.&lt;/td&gt;
&lt;td&gt;( 1011 - 110 = 1001 )&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Binary Multiplication&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Multiply each digit by &lt;strong&gt;0&lt;/strong&gt; or &lt;strong&gt;1&lt;/strong&gt;, shifting to the left.&lt;/td&gt;
&lt;td&gt;( 101 \times 11 = 1111 )&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Binary Division&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Divide the number, subtracting multiples of the divisor until the quotient is &lt;strong&gt;0&lt;/strong&gt;.&lt;/td&gt;
&lt;td&gt;( 1101 \div 10 = 110 )&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Exercises to Practice&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Binary Addition&lt;/strong&gt;: Add &lt;strong&gt;11001&lt;/strong&gt; and &lt;strong&gt;1011&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binary Subtraction&lt;/strong&gt;: Subtract &lt;strong&gt;10010&lt;/strong&gt; from &lt;strong&gt;11011&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binary Multiplication&lt;/strong&gt;: Multiply &lt;strong&gt;110&lt;/strong&gt; by &lt;strong&gt;101&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binary Division&lt;/strong&gt;: Divide &lt;strong&gt;10110&lt;/strong&gt; by &lt;strong&gt;11&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Applications of Binary Mathematics in Computer Architecture&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In this module, we will explore the applications of binary mathematics in computer architecture, covering &lt;strong&gt;digital logic&lt;/strong&gt;, &lt;strong&gt;logic circuits&lt;/strong&gt;, and how binary is essential for &lt;strong&gt;data storage&lt;/strong&gt; and &lt;strong&gt;processing&lt;/strong&gt;. Additionally, we will discuss the importance of binary in &lt;strong&gt;communication&lt;/strong&gt; and &lt;strong&gt;data transfer&lt;/strong&gt; between devices.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Digital Logic&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Digital logic is the foundation of computer architecture and digital systems. It involves the application of logical operations, such as &lt;strong&gt;AND&lt;/strong&gt;, &lt;strong&gt;OR&lt;/strong&gt;, &lt;strong&gt;NOT&lt;/strong&gt;, and &lt;strong&gt;XOR&lt;/strong&gt;, using binary numbers (&lt;strong&gt;0&lt;/strong&gt; and &lt;strong&gt;1&lt;/strong&gt;). These operations are implemented in electronic circuits, enabling computers to perform a wide variety of complex functions.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Binary Logical Operations&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Logical operations are performed by &lt;strong&gt;logic gates&lt;/strong&gt;, which are the basic building blocks of digital logic. Each gate performs a specific logical operation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AND Gate&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Operation&lt;/strong&gt;: Returns &lt;strong&gt;1&lt;/strong&gt; if both operands are &lt;strong&gt;1&lt;/strong&gt;; otherwise, returns &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Truth Table&lt;/strong&gt;:
| A | B | A AND B |
|---|---|---------|
| 0 | 0 |    0    |
| 0 | 1 |    0    |
| 1 | 0 |    0    |
| 1 | 1 |    1    |&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;OR Gate&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Operation&lt;/strong&gt;: Returns &lt;strong&gt;1&lt;/strong&gt; if at least one of the operands is &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Truth Table&lt;/strong&gt;:
| A | B | A OR B |
|---|---|--------|
| 0 | 0 |    0   |
| 0 | 1 |    1   |
| 1 | 0 |    1   |
| 1 | 1 |    1   |&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;NOT Gate (Inversion)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Operation&lt;/strong&gt;: Inverts the value of the operand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Truth Table&lt;/strong&gt;:
| A | NOT A |
|---|-------|
| 0 |   1   |
| 1 |   0   |&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;XOR Gate (Exclusive OR)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Operation&lt;/strong&gt;: Returns &lt;strong&gt;1&lt;/strong&gt; if the operands are different; otherwise, returns &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Truth Table&lt;/strong&gt;:
| A | B | A XOR B |
|---|---|---------|
| 0 | 0 |    0    |
| 0 | 1 |    1    |
| 1 | 0 |    1    |
| 1 | 1 |    0    |&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Example of a Logic Circuit Performing Binary Operations&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Consider the following simple logic circuit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inputs&lt;/strong&gt;: A = 1, B = 0&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operation&lt;/strong&gt;: ( A \text{ AND } (B \text{ OR } A) )&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;First, calculate the &lt;strong&gt;OR&lt;/strong&gt; operation:
[
B \text{ OR } A = 0 \text{ OR } 1 = 1
]&lt;/li&gt;
&lt;li&gt;Then, apply the &lt;strong&gt;AND&lt;/strong&gt; operation:
[
A \text{ AND } 1 = 1 \text{ AND } 1 = 1
]&lt;/li&gt;
&lt;li&gt;Therefore, the final result of the operation is &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These logical operations are fundamental for building processors and digital circuits in computers, enabling the control and manipulation of binary data.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Data Storage and Processing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Computers use binary mathematics to store and process data efficiently. Let’s understand how this happens.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Data Storage&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;At the hardware level, data is stored in memory (RAM, hard drives, etc.), and each stored value is represented by binary numbers. The process of storing and retrieving data is done by storage units that use binary cells.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bit&lt;/strong&gt;: The smallest unit of storage in a computer. It can store only two values: &lt;strong&gt;0&lt;/strong&gt; or &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Byte&lt;/strong&gt;: A group of &lt;strong&gt;8 bits&lt;/strong&gt;, which can represent &lt;strong&gt;256&lt;/strong&gt; different values (from &lt;strong&gt;0&lt;/strong&gt; to &lt;strong&gt;255&lt;/strong&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These bits are organized into blocks called &lt;strong&gt;words&lt;/strong&gt; (with 16, 32, or 64 bits), allowing integers, characters, and even images to be represented in the binary system.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Data Processing&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;When the processor (CPU) performs operations, it uses binary numbers. Arithmetic and logical operations are carried out through arithmetic and logic circuits.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For example, the binary addition of two binary numbers is performed using an &lt;strong&gt;adder circuit&lt;/strong&gt;, which can be a full adder or a half adder.&lt;/li&gt;
&lt;li&gt;These operations of addition, subtraction, multiplication, and division allow the processor to manipulate data efficiently. The CPU converts mathematical operations into binary commands, directly manipulating binary data.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Use of Binary in Communication Between Devices&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Communication between devices in a computer or network also relies on the binary system. Data is transmitted as streams of bits between devices, such as memory, the processor, and peripherals (e.g., hard drives and monitors).&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Example: Ethernet Communication&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;In data communication over networks, such as Ethernet, bits are transmitted through cables or radio waves, depending on the technology. The sequence of &lt;strong&gt;0s&lt;/strong&gt; and &lt;strong&gt;1s&lt;/strong&gt; is converted into electrical or optical signals, allowing devices to communicate. Each device interprets these binary signals to reconstruct the sent information.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Data Transfer in File Systems&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;When a file is saved on a computer, it is converted into a binary sequence and stored on the hard drive. When the file is accessed or transferred to another device, it is read as a sequence of bits and converted back to its original format (whether text, image, audio, etc.).&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Summary of Concepts&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Digital Logic&lt;/strong&gt;: The foundation for building digital circuits in computers, using binary logical operations like AND, OR, NOT, and XOR.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Storage&lt;/strong&gt;: Data is stored as sequences of bits and bytes in memory devices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Processing&lt;/strong&gt;: The processor manipulates binary data through arithmetic and logical operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Communication&lt;/strong&gt;: Communication between devices is achieved through sequences of bits transmitted over networks and cables.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Exercises to Practice&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Digital Logic&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solve the expression ( A \text{ AND } (B \text{ OR } C) ) for ( A = 1 ), ( B = 0 ), and ( C = 1 ).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Data Storage&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convert the decimal number &lt;strong&gt;85&lt;/strong&gt; to its 8-bit binary representation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Data Processing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Perform the binary addition of &lt;strong&gt;1101&lt;/strong&gt; and &lt;strong&gt;1011&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Data Communication&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How would data be represented for transmission over Ethernet? What would the bit sequence be for the number &lt;strong&gt;23&lt;/strong&gt;?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Practical Exercises&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In this module, we will practice the main operations in the binary system. The exercises cover &lt;strong&gt;conversions between binary and decimal&lt;/strong&gt;, performing &lt;strong&gt;arithmetic operations&lt;/strong&gt; (addition, subtraction, multiplication, and division), and examples of representing &lt;strong&gt;negative numbers&lt;/strong&gt; in the binary system. These exercises will help solidify your understanding of how to work with binary numbers and how these operations are applied in practice.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. Conversions Between Binary and Decimal&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 1: Convert the binary number 101110 to decimal.&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write the binary number: ( 101110_2 ).&lt;/li&gt;
&lt;li&gt;Decompose it into powers of 2:

&lt;ul&gt;
&lt;li&gt;( 1 \times 2^5 = 32 )&lt;/li&gt;
&lt;li&gt;( 0 \times 2^4 = 0 )&lt;/li&gt;
&lt;li&gt;( 1 \times 2^3 = 8 )&lt;/li&gt;
&lt;li&gt;( 1 \times 2^2 = 4 )&lt;/li&gt;
&lt;li&gt;( 1 \times 2^1 = 2 )&lt;/li&gt;
&lt;li&gt;( 0 \times 2^0 = 0 )&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add the values: ( 32 + 0 + 8 + 4 + 2 + 0 = 46 ).&lt;/li&gt;
&lt;li&gt;Therefore, ( 101110_2 = 46_{10} ).&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 2: Convert the decimal number 65 to binary.&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide 65 by 2, noting the quotient and remainder:

&lt;ul&gt;
&lt;li&gt;( 65 \div 2 = 32 ) with remainder &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 32 \div 2 = 16 ) with remainder &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 16 \div 2 = 8 ) with remainder &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 8 \div 2 = 4 ) with remainder &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 4 \div 2 = 2 ) with remainder &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 2 \div 2 = 1 ) with remainder &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;( 1 \div 2 = 0 ) with remainder &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The binary number is obtained by reading the remainders from bottom to top: ( 1000001_2 ).&lt;/li&gt;
&lt;li&gt;Therefore, ( 65_{10} = 1000001_2 ).&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. Arithmetic Operations with Binary Numbers&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Binary Addition&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Exercise 3: Add 1101 and 1011 in binary.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Align the numbers:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     1101
   + 1011
   --------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start from the right:

&lt;ul&gt;
&lt;li&gt;( 1 + 1 = 10 ) (write &lt;strong&gt;0&lt;/strong&gt;, carry &lt;strong&gt;1&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;( 0 + 1 + 1 = 10 ) (write &lt;strong&gt;0&lt;/strong&gt;, carry &lt;strong&gt;1&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;( 1 + 0 + 1 = 10 ) (write &lt;strong&gt;0&lt;/strong&gt;, carry &lt;strong&gt;1&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;( 1 + 1 + 1 = 11 ) (write &lt;strong&gt;1&lt;/strong&gt;, carry &lt;strong&gt;1&lt;/strong&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Result: ( 1101_2 + 1011_2 = 11000_2 ).&lt;/li&gt;
&lt;li&gt;Therefore, ( 1101_2 + 1011_2 = 11000_2 ).&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Binary Subtraction&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Exercise 4: Subtract 1101 from 10110 in binary.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Align the numbers:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     10110
   -  1101
   --------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Subtract from the right:

&lt;ul&gt;
&lt;li&gt;( 0 - 1 ) requires borrowing. After borrowing, it becomes ( 10 - 1 = 1 ).&lt;/li&gt;
&lt;li&gt;( 1 - 0 = 1 ).&lt;/li&gt;
&lt;li&gt;( 1 - 1 = 0 ).&lt;/li&gt;
&lt;li&gt;( 0 - 1 ) requires borrowing. After borrowing, it becomes ( 10 - 1 = 1 ).&lt;/li&gt;
&lt;li&gt;( 1 - 1 = 0 ).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Result: ( 10110_2 - 1101_2 = 10001_2 ).&lt;/li&gt;
&lt;li&gt;Therefore, ( 10110_2 - 1101_2 = 10001_2 ).&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Binary Multiplication&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Exercise 5: Multiply 101 by 11 in binary.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Perform simple binary multiplication:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      101
   ×    11
   --------
      101    (101 × 1)
   + 1010    (101 × 1, shifted one position to the left)
   --------
    1111
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Result: ( 101_2 \times 11_2 = 1111_2 ).&lt;/li&gt;
&lt;li&gt;Therefore, ( 101_2 \times 11_2 = 1111_2 ).&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Binary Division&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Exercise 6: Divide 1101 by 10 in binary.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide 1101 by 10:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;10&lt;/strong&gt; fits into &lt;strong&gt;11&lt;/strong&gt; once. Subtract &lt;strong&gt;10&lt;/strong&gt; from &lt;strong&gt;11&lt;/strong&gt;, leaving &lt;strong&gt;1&lt;/strong&gt;. Place &lt;strong&gt;1&lt;/strong&gt; in the result.&lt;/li&gt;
&lt;li&gt;Bring down the next bit (&lt;strong&gt;0&lt;/strong&gt;). Now, we have &lt;strong&gt;10&lt;/strong&gt;. &lt;strong&gt;10&lt;/strong&gt; fits once, subtract &lt;strong&gt;10&lt;/strong&gt; from &lt;strong&gt;10&lt;/strong&gt;, leaving &lt;strong&gt;0&lt;/strong&gt;. Place &lt;strong&gt;1&lt;/strong&gt; in the result.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The final result is &lt;strong&gt;11&lt;/strong&gt;, and the remainder is &lt;strong&gt;0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Result: ( 1101_2 \div 10_2 = 11_2 ) (remainder &lt;strong&gt;0&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Therefore, ( 1101_2 \div 10_2 = 11_2 ).&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;3. Representation of Negative Numbers in the Binary System (Two's Complement)&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 7: Represent -6 in binary using two's complement (with 8 bits).&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write &lt;strong&gt;6&lt;/strong&gt; in binary (with 8 bits): ( 00000110_2 ).&lt;/li&gt;
&lt;li&gt;Invert all the bits (one's complement): ( 11111001_2 ).&lt;/li&gt;
&lt;li&gt;Add &lt;strong&gt;1&lt;/strong&gt; to the result (two's complement):
[
11111001_2 + 1 = 11111010_2
]&lt;/li&gt;
&lt;li&gt;Therefore, &lt;strong&gt;-6&lt;/strong&gt; in two's complement (8 bits) is ( 11111010_2 ).&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Exercise 8: Represent -13 in binary using two's complement (with 8 bits).&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write &lt;strong&gt;13&lt;/strong&gt; in binary (with 8 bits): ( 00001101_2 ).&lt;/li&gt;
&lt;li&gt;Invert all the bits (one's complement): ( 11110010_2 ).&lt;/li&gt;
&lt;li&gt;Add &lt;strong&gt;1&lt;/strong&gt; to the result (two's complement):
[
11110010_2 + 1 = 11110011_2
]&lt;/li&gt;
&lt;li&gt;Therefore, &lt;strong&gt;-13&lt;/strong&gt; in two's complement (8 bits) is ( 11110011_2 ).&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Summary&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Binary-Decimal Conversions&lt;/strong&gt;: Use powers of 2 to convert binary numbers to decimal and divide by 2 repeatedly to convert decimal numbers to binary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binary Operations&lt;/strong&gt;: Learn how to perform addition, subtraction, multiplication, and division using binary rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two's Complement&lt;/strong&gt;: The method for representing negative numbers in the binary system, essential for arithmetic operations with negative numbers.&lt;/li&gt;
&lt;/ul&gt;




</description>
    </item>
    <item>
      <title>Code Craft #7 - Working with Text and Formatting Elements in HTML</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Fri, 21 Mar 2025 12:15:02 +0000</pubDate>
      <link>https://dev.to/xtirian/code-craft-7-working-with-text-and-formatting-elements-in-html-2hnn</link>
      <guid>https://dev.to/xtirian/code-craft-7-working-with-text-and-formatting-elements-in-html-2hnn</guid>
      <description>&lt;h3&gt;
  
  
  Course Objectives
&lt;/h3&gt;

&lt;p&gt;In this module, you will learn how to use the main text tags in HTML, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Headings (&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Paragraphs (&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Line breaks (&lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Text styles: bold (&lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt;), italic (&lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt;), underline (&lt;code&gt;&amp;lt;u&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Unordered lists (&lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;), ordered lists (&lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt;), and definition lists (&lt;code&gt;&amp;lt;dl&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Links (&lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  1. Headings in HTML
&lt;/h3&gt;

&lt;p&gt;Headings in HTML are used to define titles and subtitles. There are six levels of headings, ranging from &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; (the most important) to &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt; (the least important).&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;This is the main title of the page&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;This is a subtitle (level 2)&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;This is a subtitle (level 3)&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt;This is a subtitle (level 4)&lt;span class="nt"&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h5&amp;gt;&lt;/span&gt;This is a subtitle (level 5)&lt;span class="nt"&gt;&amp;lt;/h5&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h6&amp;gt;&lt;/span&gt;This is a subtitle (level 6)&lt;span class="nt"&gt;&amp;lt;/h6&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; is used for the main title, usually found at the top of the page.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt; are used for subtitles, with &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; being the most important after &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Importance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Headings are important for structuring content and also help with search engine optimization (SEO), as they indicate the hierarchy of information.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Paragraphs (&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag is used to define a paragraph of text. All content that forms a paragraph should be wrapped in the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a paragraph of text. The content inside the &lt;span class="nt"&gt;&amp;lt;code&amp;gt;&lt;/span&gt;&lt;span class="ni"&gt;&amp;amp;lt;&lt;/span&gt;p&lt;span class="ni"&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/code&amp;gt;&lt;/span&gt; tag will be displayed as a paragraph.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Paragraphs help organize text, making it more readable and structured.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whenever you use the &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag, the browser will display space before and after the paragraph, making the text more organized.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Importance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag makes it easier to organize textual content on the page.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Line Breaks (&lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt; tag is used to insert a line break within text. It does not have a closing tag, as it is a self-closing tag.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a paragraph with a line break.&lt;span class="nt"&gt;&amp;lt;br&amp;gt;&lt;/span&gt;Now, the line has been broken, and the text continues below.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt; tag does not create a new paragraph but simply breaks the line at the point where it is inserted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Importance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt; when you need to divide text without creating a new paragraph.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Text Styles
&lt;/h3&gt;

&lt;p&gt;You can style text in various ways with HTML, such as bold, italic, and underline. For this, we use the following tags:&lt;/p&gt;

&lt;h4&gt;
  
  
  Bold (&lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; tag is used to make text bold without assigning semantic importance.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a text with &lt;span class="nt"&gt;&amp;lt;b&amp;gt;&lt;/span&gt;bold&lt;span class="nt"&gt;&amp;lt;/b&amp;gt;&lt;/span&gt;.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Italic (&lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt; tag is used to make text italic, typically used for emphasis.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a text with &lt;span class="nt"&gt;&amp;lt;i&amp;gt;&lt;/span&gt;italic&lt;span class="nt"&gt;&amp;lt;/i&amp;gt;&lt;/span&gt;.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Underline (&lt;code&gt;&amp;lt;u&amp;gt;&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;u&amp;gt;&lt;/code&gt; tag is used to underline text.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a text with &lt;span class="nt"&gt;&amp;lt;u&amp;gt;&lt;/span&gt;underline&lt;span class="nt"&gt;&amp;lt;/u&amp;gt;&lt;/span&gt;.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Importance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;These tags are useful for emphasizing content. Although the &lt;code&gt;&amp;lt;b&amp;gt;&lt;/code&gt; tag is commonly used, it is worth noting that in some situations, it is more semantic to use &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; for bold and &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; for italic, as they carry semantic meaning related to importance or emphasis.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. Lists in HTML
&lt;/h3&gt;

&lt;p&gt;HTML allows you to create ordered and unordered lists. Lists help organize content in a clear and readable way.&lt;/p&gt;

&lt;h4&gt;
  
  
  Unordered Lists (&lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; tag defines an unordered list, where each item is marked with a bullet point.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Item 1&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Item 2&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Item 3&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each list item is defined by the &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; tag.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Ordered Lists (&lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt; tag defines an ordered list, where items are numbered.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ol&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;First item&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Second item&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;Third item&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Just like in unordered lists, each item is defined by the &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; tag, but the browser automatically numbers the items.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Definition Lists (&lt;code&gt;&amp;lt;dl&amp;gt;&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;dl&amp;gt;&lt;/code&gt; tag is used for definition lists, where we have a term and its description.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dl&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dt&amp;gt;&lt;/span&gt;HTML&lt;span class="nt"&gt;&amp;lt;/dt&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dd&amp;gt;&lt;/span&gt;A markup language used to create web pages.&lt;span class="nt"&gt;&amp;lt;/dd&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dt&amp;gt;&lt;/span&gt;CSS&lt;span class="nt"&gt;&amp;lt;/dt&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dd&amp;gt;&lt;/span&gt;A language used to style web page content.&lt;span class="nt"&gt;&amp;lt;/dd&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dl&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;dt&amp;gt;&lt;/code&gt; defines the term, and &lt;code&gt;&amp;lt;dd&amp;gt;&lt;/code&gt; defines the description.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. Links (&lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; tag is used to create links (anchors), allowing you to navigate between pages or external sites.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.google.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Visit Google&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;href&lt;/code&gt; attribute defines the destination of the link. When the user clicks on the text "Visit Google," they will be redirected to Google's website.&lt;/li&gt;
&lt;li&gt;Links can be used to navigate between internal or external pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other useful attributes for links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;target&lt;/code&gt;: Defines where the link will open.

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;target="_blank"&lt;/code&gt; opens the link in a new tab.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.google.com"&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Visit Google&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;Now you have learned how to work with the most common tags for text formatting in HTML. Knowing how to properly use headings, paragraphs, line breaks, lists, and links helps organize and make the content of your web pages clearer and easier to understand. Remember to use these tags semantically to ensure that the page content is well-structured, accessible, and understandable for both users and search engines.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Code Craft #6 - Basic Structure of an HTML Document</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Fri, 21 Mar 2025 12:08:49 +0000</pubDate>
      <link>https://dev.to/xtirian/code-craft-6-basic-structure-of-an-html-document-1k0e</link>
      <guid>https://dev.to/xtirian/code-craft-6-basic-structure-of-an-html-document-1k0e</guid>
      <description>&lt;h3&gt;
  
  
  Course Objectives
&lt;/h3&gt;

&lt;p&gt;In this module, you will learn about the basic structure of an HTML document, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The doctype declaration (&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The main elements (&lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Important elements within the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;: &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;How opening and closing tags work.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  1. What is HTML?
&lt;/h3&gt;

&lt;p&gt;Just a remind, HTML (HyperText Markup Language) is the language used to create web pages. It provides the structure of the page and defines the content that will be displayed in the browser. Each HTML page is composed of a set of "tags" that organize and structure the content.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Doctype Declaration
&lt;/h3&gt;

&lt;p&gt;The first line of an HTML document should always be the document type declaration, known as &lt;code&gt;DOCTYPE&lt;/code&gt;. It tells the browser which version of HTML is being used. For HTML5, the correct declaration is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt; declaration indicates that the document is using HTML5, which is the latest and most widely used version. This line is not a traditional HTML tag but an instruction that helps the browser render the content correctly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why is it important?
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Ensures the browser follows the HTML5 standard.&lt;/li&gt;
&lt;li&gt;Avoids compatibility issues between different browsers.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Basic Structure of an HTML Document
&lt;/h3&gt;

&lt;p&gt;A basic HTML document follows a simple structure, composed of opening and closing tags. Below is the minimal structure of an HTML document:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"pt-br"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My Page&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Welcome to my page!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a simple HTML example.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. Main Elements of an HTML Document
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag is the root element of an HTML document. Everything on the page, including visible content and header information, must be placed inside this tag.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Opening: &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Closing: &lt;code&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag can also include the &lt;code&gt;lang&lt;/code&gt; attribute to specify the language of the page content:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"pt-br"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; element contains information about the document, such as metadata, links to external files (CSS, fonts, etc.), and the page title. This data is not displayed directly on the page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Opening: &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Closing: &lt;code&gt;&amp;lt;/head&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Inside the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, we usually include:&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;meta charset="UTF-8"&amp;gt;&lt;/code&gt;: Defines the character encoding used in the document, ensuring special characters (like accents) are displayed correctly.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;&lt;/code&gt;: Ensures the page is responsive, adjusting the layout for different screen sizes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt;: Defines the page title, which appears in the browser tab.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt;: Used to link external files, such as CSS stylesheets.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Example of a complete &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My Page&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag contains the visible content of the page, such as text, images, videos, links, tables, etc. Everything the user sees on the page must be inside this tag.

&lt;ul&gt;
&lt;li&gt;Opening: &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Closing: &lt;code&gt;&amp;lt;/body&amp;gt;&lt;/code&gt;
Example of content inside the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Welcome to my page!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a simple HTML example.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5. Elements Inside the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; element defines the page title, which appears in the browser tab or title bar. The title is crucial for SEO (Search Engine Optimization) and accessibility.
Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My Page&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tag provides metadata about the page, such as character encoding, descriptions, keywords, etc. In the example above, we used two important &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tags:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;charset&lt;/code&gt;: Defines the character encoding of the document (usually UTF-8).
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;viewport&lt;/code&gt;: Essential for responsive design, adjusting the page scale on mobile devices.
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; tag is used to link external files, such as stylesheets (CSS), icons, fonts, etc. The most common use is to include a stylesheet:&lt;br&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"style.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  6. Opening and Closing Tags
&lt;/h3&gt;

&lt;p&gt;In HTML, most elements require an opening tag and a closing tag. The opening tag defines the start of the element, and the closing tag marks its end.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Opening Tag: Starts the element and can contain attributes.
Example: &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;a href="url"&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Closing Tag: Ends the element.
Example: &lt;code&gt;&amp;lt;/h1&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;/p&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;/a&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some tags, like &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;, are self-closing and do not require a closing tag, but it is still important to know them.&lt;br&gt;
Example of opening and closing tags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a paragraph.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"image.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Example image"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;Now that you know the basic structure of an HTML document, you can start creating your own pages. Remember that while HTML is the foundation, it works in conjunction with other technologies like CSS and JavaScript to create interactive and styled pages.&lt;/p&gt;

&lt;p&gt;In the next module, we will explore how to add more complex content to your HTML page. Until then!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Code Craft # 5 - Introduction to HTML, CSS, and JavaScript</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Thu, 20 Mar 2025 16:35:11 +0000</pubDate>
      <link>https://dev.to/xtirian/code-craft-4-introduction-to-html-css-and-javascript-3cc6</link>
      <guid>https://dev.to/xtirian/code-craft-4-introduction-to-html-css-and-javascript-3cc6</guid>
      <description>&lt;p&gt;Building websites involves several steps and tools, and three core programming languages that form the foundation of any website are HTML, CSS, and JavaScript. Together, these languages are the backbone of modern web development. Let’s break down what each one does and how they work together to create functional and visually appealing websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTML: Content and Layout
&lt;/h2&gt;

&lt;p&gt;HTML, or &lt;strong&gt;HyperText Markup Language&lt;/strong&gt;, is the language that defines the structure and content of a webpage. In other words, HTML creates the "building blocks" of any website, such as paragraphs, images, links, and headings. It determines what is displayed on the page but not how the content appears visually.&lt;br&gt;
&lt;strong&gt;HTML Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;HTML Page Example&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Welcome to My Website&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is an example paragraph.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.example.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click here to visit the site.&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;What does HTML do?
HTML provides the basic structure of a webpage. With it, you can add text, images, videos, and links, organizing content in a logical manner. Without HTML, there would be no content displayed on a webpage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CSS: Styling and Visual Appearance
&lt;/h2&gt;

&lt;p&gt;CSS, or &lt;strong&gt;Cascading Style Sheets&lt;/strong&gt;, is a language used to style the content created with HTML. CSS is responsible for the visual appearance of your website, allowing you to define colors, fonts, spacing, and layout. Without CSS, HTML pages would look basic and unappealing, lacking any design or style.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSS Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f0f0f0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Arial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#555&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;ul&gt;
&lt;li&gt;What does CSS do?
CSS controls the appearance of HTML elements. It can change the background color, font style, element spacing, and even create simple animation effects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What can you do with CSS?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modify the layout and visual formatting of a website.&lt;/li&gt;
&lt;li&gt;Change colors, fonts, and the overall design of content.&lt;/li&gt;
&lt;li&gt;Create simple animations and transitions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JavaScript: Interactivity and Dynamic Features
&lt;/h2&gt;

&lt;p&gt;JavaScript is a programming language that enables you to add interactivity to a webpage. While HTML is used to structure the content and CSS is used to style it, JavaScript allows you to dynamically alter the content after the page has loaded. With JavaScript, you can create animations, modify content, validate forms, and much more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;myButton&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;onclick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;You clicked the button!&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What does JavaScript do?&lt;/strong&gt;&lt;br&gt;
JavaScript allows you to create dynamic features such as interactive menus, real-time content changes, form validation, and animations. It adds life to a webpage, making it more engaging for users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What can you do with JavaScript?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create dynamic features, such as interactive menus and animations.&lt;/li&gt;
&lt;li&gt;Modify content on a page after it has loaded.&lt;/li&gt;
&lt;li&gt;Add interactivity and customization to your website’s behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Comparison Between HTML, CSS, and JavaScript
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HTML is responsible for the structure and content of a webpage.&lt;/li&gt;
&lt;li&gt;CSS is used to define the visual appearance and layout of the elements.&lt;/li&gt;
&lt;li&gt;JavaScript allows for interactivity and dynamic functionality, changing the page based on user behavior.
These three languages work together to form the foundation of almost any website. HTML provides the content, CSS handles the appearance, and JavaScript adds interactivity.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Can You Do with Each Programming Language?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HTML: With HTML, you create the basic structure of your website, including titles, paragraphs, links, and the general layout.&lt;/li&gt;
&lt;li&gt;CSS: CSS allows you to make the website visually appealing. Through styling rules, you change the colors, fonts, sizes, and layout.&lt;/li&gt;
&lt;li&gt;JavaScript: JavaScript makes your website interactive, enabling features like animations, interactive menus, and form validation.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;While it is possible to create and maintain a website without much coding knowledge using a content management system, understanding the basics of HTML, CSS, and JavaScript gives you more control over your website's design and functionality. These languages are fundamental for creating modern, dynamic websites, and with a basic understanding, you can start modifying your site or even building one from scratch.&lt;/p&gt;

&lt;p&gt;If you’re just starting with web development, it’s essential to learn HTML, CSS, and JavaScript to understand how they interact and how each one contributes to creating dynamic and visually attractive websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn More About HTML, CSS, and JavaScript
&lt;/h2&gt;

&lt;p&gt;If you're eager to dive deeper into HTML, CSS, and JavaScript, there are plenty of great resources available online. Whether you're a beginner or looking to enhance your skills, the following platforms offer structured courses, tutorials, and hands-on coding exercises. In this series of posts, I'll lead you to the knowledge you need to get started or practice what you've already learned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn HTML&lt;/strong&gt;&lt;br&gt;
To get started with HTML and master the basics of building websites, check out this free course on &lt;a href="https://www.w3schools.com/html/" rel="noopener noreferrer"&gt;W3 HTML Tutorial&lt;/a&gt;. It covers everything from the structure of an HTML document to creating links, images, and lists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn CSS&lt;/strong&gt;&lt;br&gt;
Once you have a handle on HTML, it’s time to learn CSS to make your sites visually appealing. &lt;a href="https://www.w3schools.com/css/" rel="noopener noreferrer"&gt;W3 CSS Course&lt;/a&gt; will walk you through how to style your web pages, including managing colors, fonts, and layouts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn JavaScript&lt;/strong&gt;&lt;br&gt;
For those who want to add interactivity and dynamic elements to their websites, JavaScript is a must. &lt;a href="https://www.freecodecamp.org/" rel="noopener noreferrer"&gt;Freecodecamp JavaScript Course&lt;/a&gt; offers a comprehensive guide to understanding the core concepts of JavaScript and how to manipulate HTML and CSS to create engaging experiences.&lt;/p&gt;

&lt;p&gt;By taking these courses and practicing what you learn, you’ll be well on your way to becoming proficient in web development and able to create your own interactive and visually stunning websites.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>#Computing architecture - Basic architecture of a computer</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Tue, 18 Mar 2025 20:18:38 +0000</pubDate>
      <link>https://dev.to/xtirian/computing-architecture-basic-architecture-of-a-computer-4m8b</link>
      <guid>https://dev.to/xtirian/computing-architecture-basic-architecture-of-a-computer-4m8b</guid>
      <description>&lt;h2&gt;
  
  
  What does computer architecture mean?
&lt;/h2&gt;

&lt;p&gt;Computer architecture is the term used to describe the design and organization of a computer system. It refers to the structure and essential components that make up a computer, such as the central processing unit (CPU), memory, input and output devices, and the communication channels between these components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Architecture:&lt;/strong&gt; relates to the design of the total set of instructions that the computer will be able to execute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Organization:&lt;/strong&gt; is the definition and physical and logical implementation of the computer. The organization makes the specifications defined by computer architecture feasible.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What you will learn by the end of this "course"
&lt;/h2&gt;

&lt;p&gt;Ao final deste curso, você será capaz de:&lt;br&gt;
By the end of this course, you will be able to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understand the basic components of computer architecture, their relationships, and functions;&lt;/li&gt;
&lt;li&gt;Understand binary mathematics and its application in the formation of logical (digital) circuits;&lt;/li&gt;
&lt;li&gt;Understand the main logic gates and how digital circuits are formed;&lt;/li&gt;
&lt;li&gt;Understand the main components of the processor and its internal architecture;&lt;/li&gt;
&lt;li&gt;Understand the types of memory and their characteristics;&lt;/li&gt;
&lt;li&gt;Understand the main components of the motherboard and their functions;&lt;/li&gt;
&lt;li&gt;Understand the main internal and external buses of the motherboard;&lt;/li&gt;
&lt;li&gt;Understand storage devices and their functionalities;&lt;/li&gt;
&lt;li&gt;Understand RAID (Redundant Array of Independent Disks) techniques for disks (Don’t worry, you’ll know what RAID is soon);&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why study Computer Architecture?
&lt;/h2&gt;

&lt;p&gt;Studying computer architecture is essential for several reasons, whether you're interested in technology or want to work in areas such as systems development, software engineering, hardware design, or related fields. Here are some of the main reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deep understanding of how a computer works: Knowing how the CPU processes instructions, how memory is managed, and how data circulates within the system is crucial.&lt;/li&gt;
&lt;li&gt;Performance optimization: Understanding architecture helps write more efficient code and optimize system performance, whether regarding memory usage, parallel processing, storage access, or designing faster systems.&lt;/li&gt;
&lt;li&gt;Hardware and software development: For hardware engineers, understanding computer architecture is vital for designing chips, circuits, and integrated systems. Software developers who understand computer architecture can write more effective programs tailored to the hardware and optimize CPU and memory usage.&lt;/li&gt;
&lt;li&gt;Enables solving low-level problems: Computer architecture teaches how to deal with low-level issues, such as memory management, interrupt handling, code optimization, and hardware-software interfacing.&lt;/li&gt;
&lt;li&gt;Preparation for technological innovations: The field of computer architecture is always evolving with emerging technologies, such as quantum computing, neuromorphic processors, and parallel computing. Having a solid foundation in computer architecture allows you to stay updated and ready to work with these new technologies.&lt;/li&gt;
&lt;li&gt;Foundation for operating systems and networks: Operating systems rely on a deep understanding of computer architecture to efficiently manage resources like processing, memory, and input/output.&lt;/li&gt;
&lt;li&gt;Solving complex problems: Many problems in computing systems cannot be solved without a profound understanding of computer architecture.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Basic elements of computer architecture
&lt;/h2&gt;

&lt;p&gt;Von Neumann architecture describes the basic components of a computer, which are still used in modern systems despite many technological advancements. Its key elements are:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22dqixtwbldobcrnhxvq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22dqixtwbldobcrnhxvq.jpg" alt="Image description" width="700" height="490"&gt;&lt;/a&gt;&lt;br&gt;
Fonte da imagem: &lt;a href="https://pt.wikipedia.org/wiki/Arquitetura_de_von_Neumann#/media/Ficheiro:Von_Neumann_architecture.svg" rel="noopener noreferrer"&gt;https://pt.wikipedia.org/wiki/Arquitetura_de_von_Neumann#/media/Ficheiro:Von_Neumann_architecture.svg&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPU (Central Processing Unit)&lt;/strong&gt;: Responsible for processing information stored in memory, including programs and data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory&lt;/strong&gt;: Stores both the data and the programs needed for the computer's operation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Input/Output Devices (I/O):&lt;/strong&gt; Allow interaction between the computer and the user or external environment. Examples include keyboard, mouse, monitor, and printers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buses&lt;/strong&gt;: Communication channels that connect all components, enabling data, commands, and address traffic between them. They are divided into data, control, and address buses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The basic operation described follows this flow: data is input through I/O devices (such as the keyboard), the CPU processes it, accesses memory for information, and then sends results back to output devices (such as the monitor). All components exchange information via the buses. This simple architecture still applies to both modern computers and the first systems developed by Von Neumann in the 1940s.&lt;/p&gt;

&lt;h2&gt;
  
  
  CPU (Central Processing Unit) - The Processor
&lt;/h2&gt;

&lt;p&gt;The Central Processing Unit is the primary component of computer architecture. It is an integrated circuit that executes all user programs and controls all other computer devices.&lt;br&gt;
Its main function is to fetch data stored in the computer's memory, determine what procedure should be performed with that data, execute the procedure, and return the results to the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory
&lt;/h2&gt;

&lt;p&gt;Every computer has a certain amount of memory (which can vary from computer to computer), which consists of a set of circuits capable of storing the data and programs executed by the computer itself. Memories are classified into different categories.&lt;br&gt;
&lt;em&gt;Note: The amount of memory is given by the number of bits that a processor can manage.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5li2u3yudenb7ot7ulje.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5li2u3yudenb7ot7ulje.jpg" alt="Image description" width="623" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Main Memory: In simple terms, the main memory is seen as a set of chips that are inserted into the computer’s motherboard.&lt;/li&gt;
&lt;li&gt;Secondary Memory: Secondary memory is not made up of chips, but instead consists of devices that use other storage technologies. Some examples of secondary memory: hard drive, SSD, DVD.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Buses
&lt;/h2&gt;

&lt;p&gt;The bus, also called BUS, is simply a common pathway through which data travels inside the computer. These are conducting lines that allow information to move from the CPU to peripherals and vice versa. This pathway is used for communication and can be established between two or more computer elements.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Code Craft # 4 - Into the github basics</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Mon, 17 Mar 2025 14:24:42 +0000</pubDate>
      <link>https://dev.to/xtirian/code-craft-4-into-the-github-basics-48nf</link>
      <guid>https://dev.to/xtirian/code-craft-4-into-the-github-basics-48nf</guid>
      <description>&lt;h2&gt;
  
  
  Before You Start!
&lt;/h2&gt;

&lt;p&gt;Before we begin exploring the basics of Git and GitHub, it’s essential to ensure that you have your environment set up correctly. Git is a powerful version control tool widely used by developers to manage code and track changes over time. GitHub, on the other hand, is an online platform that integrates with Git, allowing you to store, share, and collaborate on projects in the cloud.&lt;/p&gt;

&lt;p&gt;If you haven’t set up Git on your machine or don’t have a GitHub account yet, don’t worry! &lt;a href="https://dev.to/xtirian/3-a-complete-guide-to-setting-up-git-and-github-for-beginners-548"&gt;In this complete guide&lt;/a&gt;, you will be walked through the steps to install Git, create your GitHub account, configure your SSH keys, and much more. This will ensure that you're ready to follow the rest of the content securely and effectively.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What You Should Know:&lt;/em&gt;&lt;br&gt;
Install Git on your operating system&lt;br&gt;
Configure your GitHub account and link it to Git&lt;br&gt;
Manage your SSH keys for more secure authentication&lt;br&gt;
Verify your setup to ensure everything is working properly&lt;/p&gt;

&lt;p&gt;To get started, follow the step-by-step instructions in our &lt;a href="https://dev.to/xtirian/3-a-complete-guide-to-setting-up-git-and-github-for-beginners-548"&gt;complete guide to setting up Git and GitHub for beginners&lt;/a&gt;. This guide will provide detailed instructions to ensure your development environment is ready for using Git and GitHub.&lt;/p&gt;


&lt;h2&gt;
  
  
  Into the basics
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Create the Repository
&lt;/h2&gt;

&lt;p&gt;Now that you have your Git and GitHub set up, it's time to create your first repository! A repository is where all your project files, code, and version history will be stored. This step-by-step guide will show you how to create a repository on GitHub.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign in to GitHub&lt;/li&gt;
&lt;li&gt;Open your web browser and go to GitHub.&lt;/li&gt;
&lt;li&gt;If you already have an account, click on Sign in at the top-right corner and enter your credentials.&lt;/li&gt;
&lt;li&gt;If you don’t have an account yet, click on Sign up to create a new account.&lt;/li&gt;
&lt;li&gt;Create a New Repository&lt;/li&gt;
&lt;li&gt;Once you’re signed in, click on the + sign in the top-right corner of the screen.&lt;/li&gt;
&lt;li&gt;From the drop-down menu, select New repository&lt;/li&gt;
&lt;li&gt;Set Repository Details&lt;/li&gt;
&lt;li&gt;Repository name: Choose a unique name for your repository. For example, if you're working on a project called "MyApp", you can name the repository MyApp.&lt;/li&gt;
&lt;li&gt;Description (optional): Write a brief description of your project. For example, "This is a simple web application built with HTML, CSS, and JavaScript."&lt;/li&gt;
&lt;li&gt;Public or Private: Decide whether you want your repository to be public or private: Public: Anyone can see and contribute to your repository; Private: Only you and collaborators can access the repository.&lt;/li&gt;
&lt;li&gt;Initialize the Repository&lt;/li&gt;
&lt;li&gt;Initialize this repository with a README: It's recommended to check this box, as a README file is essential for providing an introduction to your project.&lt;/li&gt;
&lt;li&gt;Add .gitignore: A .gitignore file tells Git which files or directories to ignore (for example, system files or IDE configurations).&lt;/li&gt;
&lt;li&gt;You can choose a template based on your project type (e.g., Node, Java, Python).&lt;/li&gt;
&lt;li&gt;Choose a license (optional): If you want to specify the terms under which others can use your code, you can add a license. GitHub provides a variety of open-source licenses to choose from.&lt;/li&gt;
&lt;li&gt;Create the Repository
Once you've filled out the necessary details, click on the Create repository button.&lt;/li&gt;
&lt;li&gt;Clone the Repository to Your Local Machine (Optional)
To start working with the repository on your local machine, you can clone it using Git:&lt;/li&gt;
&lt;li&gt;Go to the repository page on GitHub.&lt;/li&gt;
&lt;li&gt;Click on the Code button and copy the URL under Clone with HTTPS.&lt;/li&gt;
&lt;li&gt;Open your terminal and run the following command:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github.com:USERNAME/REPOSITORY-NAME.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;This will create a local copy of the repository on your computer where you can start adding files and making changes.&lt;/li&gt;
&lt;li&gt;To test this, &lt;code&gt;cd&lt;/code&gt; int othe new folder that was downloaded and the enter &lt;code&gt;git remote -v&lt;/code&gt; on you command line: You should see and output similar that:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;origin  git@github.com:USERNAME:git_test.git &lt;span class="o"&gt;(&lt;/span&gt;fetch&lt;span class="o"&gt;)&lt;/span&gt;
origin  git@github.com:USERNAME:git_test.git &lt;span class="o"&gt;(&lt;/span&gt;push&lt;span class="o"&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Add Files to Your Repository&lt;/li&gt;
&lt;li&gt;Create or copy the project files you want to add to the repository into the cloned folder on your local machine.&lt;/li&gt;
&lt;li&gt;Use the following Git commands to add, commit, and push changes:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit"&lt;/span&gt;
git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Use the Git Workflow
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Git workflow&lt;/strong&gt; is a standard process used to manage and track changes in your project using Git. It helps developers maintain organized, consistent, and collaborative development environments. Understanding and following the Git workflow is crucial for effective version control, especially as you start working with teams and collaborating on code.&lt;/p&gt;
&lt;h3&gt;
  
  
  Git Workflow Steps
&lt;/h3&gt;

&lt;p&gt;Let’s break down the typical Git workflow into simple, digestible steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone the Repository (for the first time)&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;When starting a project, you need to create a local copy of the repository from GitHub (or any other remote service). This is done using git clone.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/your-username/your-repository.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;This command will download the entire repository to your local machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Create a New Branch (Optional but recommended)&lt;/li&gt;
&lt;li&gt;When working on a feature or fix, it’s a good practice to create a new branch. This keeps your main branch clean and allows you to experiment without affecting the main project. The main branch (commonly named main or master) should always contain stable, production-ready code.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;This creates and switches to a new branch called feature-name. You can replace feature-name with a descriptive name for your task.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Make Changes and Modify Files&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now that you’re working on your feature branch, make your changes to the codebase. This could be adding new files, editing existing ones, or fixing bugs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stage Changes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Git doesn't automatically track changes in your files. After you make modifications, you need to "stage" the changes, which tells Git which files you want to include in your next commit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To stage files, use:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &amp;lt;file-name&amp;gt;  &lt;span class="c"&gt;# Add a specific file&lt;/span&gt;
git add &lt;span class="nb"&gt;.&lt;/span&gt;            &lt;span class="c"&gt;# Add all modified files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Commit Changes&lt;/li&gt;
&lt;li&gt;After staging your files, the next step is to commit the changes. A commit is like a snapshot of your code at a particular point in time.&lt;/li&gt;
&lt;li&gt;When committing, always provide a meaningful commit message that explains what changes were made. This helps you and others understand the history of the project.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add new feature to index page"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Push Changes to GitHub&lt;/li&gt;
&lt;li&gt;After committing, it’s time to push your changes to the remote repository (GitHub). This uploads your changes and makes them accessible to others.&lt;/li&gt;
&lt;li&gt;If you’re working on a branch (like feature-name), push the branch to GitHub:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin feature-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;If you're working on the main branch (or whatever the default branch is named), use:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Create a Pull Request (for Collaboration)&lt;/li&gt;
&lt;li&gt;If you're working in a team or collaborating on a project, after pushing your branch, you’ll typically open a Pull Request (PR) on GitHub. A PR lets others review and discuss your changes before they are merged into the main branch.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On GitHub, navigate to your repository, click on the Pull Request tab, and create a new PR from your feature branch to the main branch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Merge Changes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the pull request is reviewed and approved, it will be merged into the main branch. If you’re working solo and confident in your changes, you can merge it directly through the command line:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout main       &lt;span class="c"&gt;# Switch back to the main branch&lt;/span&gt;
git merge feature-name  &lt;span class="c"&gt;# Merge changes from your feature branch&lt;/span&gt;
git push origin main     &lt;span class="c"&gt;# Push merged changes to GitHub&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Pull the Latest Changes (before working again)&lt;/li&gt;
&lt;li&gt;Before starting work the next day (or anytime you want to sync with the latest code), always make sure to pull the latest changes from the remote repository. This is particularly important if you are collaborating with others.&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Why This Workflow Matters
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Keeps Your Code Organized: By following a clear workflow, you avoid conflicts and ensure that each change is logically grouped and tracked.&lt;/li&gt;
&lt;li&gt;Prevents Conflicts: Working on branches means you can develop independently without affecting the main project. It also makes it easier to merge changes later.&lt;/li&gt;
&lt;li&gt;Encourages Collaboration: Using pull requests and branching allows multiple developers to work on different features simultaneously and merge their work without disrupting the main codebase.&lt;/li&gt;
&lt;li&gt;Improves Version Control: Committing often with meaningful messages helps you track every change and revert to previous versions if necessary.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Modify Files
&lt;/h2&gt;

&lt;p&gt;Now let’s say you’re working on a project and want to modify files. For this example, we’ll create a new HTML file, modify it, and then commit those changes using the Git workflow.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scenario: Create and Modify index.html
Clone the repository (if you haven’t already): If you haven’t cloned the repository to your local machine yet, do so by running this command in your terminal:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/your-username/your-repository.git
&lt;span class="nb"&gt;cd &lt;/span&gt;your-repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;This will create a local copy of your GitHub repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Create a new file (index.html): Now, let’s say you want to create a new HTML file called index.html:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create a new file using a text editor or the command line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Open index.html in your editor (e.g., Visual Studio Code, Sublime, or even a simple text editor) and add some basic HTML code:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My Web Page&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Welcome to My Web Page!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a simple page created for the example.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Modify an existing file: Let’s say you already have a file, style.css, and you want to modify it to add some styles for the index.html file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Open style.css and add some CSS styles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Arial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f4f4f4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#333&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;h2&gt;
  
  
  Push Your Work to GitHub
&lt;/h2&gt;

&lt;p&gt;Once you’ve created and modified your files, you need to follow these steps to push your changes to GitHub.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stage your changes: After creating and modifying your files, you need to tell Git which changes you want to include in your next commit. To stage the changes, use:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add index.html style.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;If you modified several files and want to stage everything, you can use:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Commit your changes: After staging the files, you need to commit them with a message that explains what you’ve done. For example:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add index.html and modify style.css"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Push the changes to GitHub: Now that your changes are committed locally, it’s time to push them to GitHub so they are saved remotely. To push the changes, use:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;This will push your changes to the main branch of your GitHub repository.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Summary of the Example Workflow:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone the repository (if not done already).&lt;/li&gt;
&lt;li&gt;Create and modify files:&lt;/li&gt;
&lt;li&gt;Created index.html and added basic HTML structure.&lt;/li&gt;
&lt;li&gt;Modified style.css to add custom styles.&lt;/li&gt;
&lt;li&gt;Stage changes:&lt;/li&gt;
&lt;li&gt;Used git add to stage the files you modified.&lt;/li&gt;
&lt;li&gt;Commit changes:&lt;/li&gt;
&lt;li&gt;Committed your changes with a clear message using git commit -m.&lt;/li&gt;
&lt;li&gt;Push changes:&lt;/li&gt;
&lt;li&gt;Pushed the commit to GitHub with git push origin main.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;By following this Git workflow, you can effectively track your changes and collaborate with others on your project. Whether you're adding new files or modifying existing ones, this process ensures your work is always saved and shared on GitHub.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>git</category>
    </item>
    <item>
      <title>Code Craft #3 - A Complete Guide to Setting Up Git and GitHub for Beginners</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Fri, 14 Mar 2025 19:14:15 +0000</pubDate>
      <link>https://dev.to/xtirian/3-a-complete-guide-to-setting-up-git-and-github-for-beginners-548</link>
      <guid>https://dev.to/xtirian/3-a-complete-guide-to-setting-up-git-and-github-for-beginners-548</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Git is an essential tool for any developer, providing powerful version control for your projects. Throughout your journey in software development, you'll work with Git extensively. Although the ins and outs of Git will become clearer as you progress, understanding the basics now will set you up for success.&lt;/p&gt;

&lt;p&gt;GitHub and GitLab, on the other hand, are platforms that integrates with Git, enabling you to upload, host, and manage your code in the cloud. It provides a web interface to interact with Git repositories, making collaboration easier. While Git and GitHub/GitLab are often used together, it's important to note that they are separate entities, developed by different companies.&lt;/p&gt;

&lt;p&gt;This guide will walk you through the steps to install and configure Git, create a GitHub account, set up your SSH keys, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Git
&lt;/h2&gt;

&lt;p&gt;Before we dive into configuration, we first need to install Git. Here are the installation steps for different operating systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux: You can typically install Git through your distribution's package manager. For Ubuntu-based systems:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;MacOS: You can install Git using Homebrew:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure Git and GitHub
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a GitHub Account
Head over to GitHub and sign up for an account. During the signup process, you will be prompted to provide an email address. This email will be tied to your contributions and will be visible in your Git history.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re concerned about privacy, you can choose to keep your email address private. To do this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign in to GitHub&lt;/li&gt;
&lt;li&gt;Go to Settings → Emails&lt;/li&gt;
&lt;li&gt;Enable the option "Keep my email addresses private."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub will then provide you with a private email address that you can use for your commits. You’ll need this when configuring Git in the next step.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setup Git
Now that you have a GitHub account, it's time to link Git to your GitHub profile. This is important for associating commits with your identity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open your terminal and run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Jhon Doe"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"jhondoe@provider.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Additionally, GitHub recently switched the default branch name from &lt;code&gt;master&lt;/code&gt; to &lt;code&gt;main&lt;/code&gt;. Set your default branch to main with this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; init.defaultBranch main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also recommend configuring Git to use merge behavior for pull requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; pull.rebase &lt;span class="nb"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To verify that everything is set up correctly, run these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--get&lt;/span&gt; user.name
git config &lt;span class="nt"&gt;--get&lt;/span&gt; user.email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will display your name and email address, confirming the configuration was successful.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For macOS Users
macOS users may also want to configure Git to ignore .DS_Store files, which are created by the Finder application. To do this, run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; .DS_Store &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; ~/.gitignore_global
git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.excludesfile ~/.gitignore_global
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create and Link an SSH Key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using SSH keys allows you to authenticate with GitHub securely without having to enter your password every time you push code. Let's set this up!&lt;/p&gt;

&lt;p&gt;Check if You Have an Existing SSH Key:&lt;br&gt;
First, check if you already have an SSH key by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; ~/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see a message like "No such file or directory," it means you don’t have an existing SSH key, and you'll need to create one.&lt;/p&gt;

&lt;p&gt;Generate a New SSH Key: To generate a new SSH key, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When prompted, hit Enter to save the key in the default location. You can optionally add a passphrase for extra security.&lt;/p&gt;

&lt;p&gt;Link Your SSH Key to GitHub: Once your SSH key is generated, it’s time to link it to GitHub. First, you need to copy your SSH key to your clipboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat ~/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the entire output, which starts with ssh-ed25519 and ends with your username and hostname.&lt;/p&gt;

&lt;p&gt;Next, go to GitHub, navigate to Settings → SSH and GPG keys, and click on New SSH Key. Paste your SSH key into the provided field, name it, and click Add SSH key.&lt;/p&gt;

&lt;p&gt;Test Your SSH Connection: &lt;br&gt;
To verify that everything is set up correctly, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a message that says, "Hi username! You’ve successfully authenticated, but GitHub does not provide shell access." This means you’ve successfully connected your SSH key to GitHub!&lt;/p&gt;

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

&lt;p&gt;Congrats on setting up Git and GitHub! This is an important first step in your development journey. Even if you didn’t understand every detail, that’s perfectly normal—this is just the beginning.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>git</category>
    </item>
    <item>
      <title>Code Craft #2 - How the Web Works</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Thu, 13 Mar 2025 23:25:04 +0000</pubDate>
      <link>https://dev.to/xtirian/how-the-web-works-38f7</link>
      <guid>https://dev.to/xtirian/how-the-web-works-38f7</guid>
      <description>&lt;p&gt;The internet is a global network of connected computers that enables the exchange of information and access to services. This exchange happens efficiently thanks to a well-structured and interdependent system. Let’s understand how each part of this network interacts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How does information travel across the internet?&lt;/strong&gt; When you access a website on your web browser, what happens behind the scenes is communication between clients and servers. The client, in this case, the browser, requests information from the server, which stores the data of the requested page. To understand how the request reaches the server and how the data returns to the client, it's important to understand the role of packets. The data of a webpage (such as text, images, and videos) is divided into packets to be sent more efficiently across the network. Each packet contains a portion of the data, as well as information about the source and destination of the message. These packets travel across the internet until they reach the correct server, where they are reassembled and sent back to the client.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The role of servers and DNS When you type an address&lt;/strong&gt;, such as &lt;a href="//www.google.com"&gt;"www.google.com"&lt;/a&gt;, the browser needs to know which server to access. This is where the DNS (Domain Name System) comes in, translating the website name into an IP address. The DNS server acts like a list of addresses: it locates the server hosting the site and provides the necessary IP address for communication.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How packets connect to communication with the server The web&lt;/strong&gt; server is where the content of web pages is stored. Once the DNS resolves the IP address, the browser, acting as a client, sends a request to the server, which then sends the data packets back to the client. When these packets reach the browser, they are reassembled, and the webpage appears on the user's screen.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The difference between a client, server, and how communication occurs&lt;/strong&gt; A client is any device that requests data from a server. This includes not just web browsers, but also applications like an email client or a messaging app. The server, on the other hand, stores data and resources and responds to the requests made by clients. The browser, therefore, is a client that requests and displays content stored on web servers.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each device and server’s IP address is essential for communication to occur. The web server has a unique IP address that allows the client (browser) to locate it. This process is completely transparent to the user but is crucial to ensure that the data reaches its destination.&lt;/p&gt;

&lt;h2&gt;
  
  
  To summarize, lets chop the concepts in little parts
&lt;/h2&gt;

&lt;p&gt;What is a web server? A web server is a software or hardware system that stores and serves web pages to users' devices over the internet. When you type in a website's address (like google.com), the web server sends the necessary files (HTML, images, etc.) to your device for you to view the website.&lt;/p&gt;

&lt;p&gt;What is a network? A network is a collection of devices (like computers, phones, or printers) that are connected to one another to share resources and data. This can happen either over local area networks (LAN) or larger networks like the internet.&lt;/p&gt;

&lt;p&gt;What is the internet? The internet is a global network of interconnected computers and devices that communicate with each other to share information. It’s essentially a vast system that enables access to websites, email, streaming, and many other services.&lt;/p&gt;

&lt;p&gt;What is an IP address? An IP (Internet Protocol) address is a unique identifier assigned to each device connected to a network. It’s like the address of your device on the internet, allowing other devices to locate and communicate with it.&lt;/p&gt;

&lt;p&gt;What is a router? A router is a device that connects multiple networks, typically your local network (like your home Wi-Fi) to the internet. It directs data packets between devices within your network and the wider internet.&lt;/p&gt;

&lt;p&gt;What is an ISP? An ISP (Internet Service Provider) is a company that provides you with access to the internet. Examples include Comcast, AT&amp;amp;T, or Verizon.&lt;/p&gt;

&lt;p&gt;What are packets and how are they used to transfer data? Packets are small chunks of data that are sent over the internet. Large files or messages are broken down into packets, which are transmitted separately across the network and reassembled at the destination.&lt;/p&gt;

&lt;p&gt;What is a client? A client is any device or program that makes a request to a server. For example, when you use a web browser, your browser is acting as a client, requesting web pages from a server.&lt;/p&gt;

&lt;p&gt;What is a server? A server is a computer or system that provides resources, services, or data to other computers (clients) over a network. For instance, a web server hosts websites that clients can request and view.&lt;/p&gt;

&lt;p&gt;What is a web page? A web page is a document or content on the World Wide Web, typically made up of text, images, videos, or other multimedia that is displayed in a browser when you visit a website.&lt;/p&gt;

&lt;p&gt;What is a web browser? A web browser is a software application (like Chrome, Firefox, or Safari) that allows you to view and interact with web pages on the internet.&lt;/p&gt;

&lt;p&gt;What is a search engine? A search engine (like Google or Bing) is a tool that helps users find information on the internet by searching through indexed websites and displaying relevant results.&lt;/p&gt;

&lt;p&gt;What is a DNS request? DNS (Domain Name System) is like the internet’s phonebook. A DNS request is made when you type a website address (like google.com) into your browser. It translates that human-readable domain name into an IP address that computers use to find the server hosting the website.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>web3</category>
    </item>
    <item>
      <title>Code Craft #1 - A quick introduction about Web Development</title>
      <dc:creator>Matheus Fernandes</dc:creator>
      <pubDate>Thu, 13 Mar 2025 17:29:34 +0000</pubDate>
      <link>https://dev.to/xtirian/a-quick-introduction-about-web-development-264i</link>
      <guid>https://dev.to/xtirian/a-quick-introduction-about-web-development-264i</guid>
      <description>&lt;h2&gt;
  
  
  Introduction: what you need to know to start
&lt;/h2&gt;

&lt;p&gt;Web development is one of the most dynamic fields in the technology market. With the rise of digital solutions, professionals working in web development and web applications play a crucial role. If you're just starting out or planning to, here's an initial guide to help you begin your journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Web Developers
&lt;/h2&gt;

&lt;p&gt;Before diving into careers, it's important to understand the three main specializations within web development:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Front-End Developer&lt;/strong&gt;: Works with everything the user sees and interacts with directly on a website or application. This includes the structure, layout, and functionality of a page. The main technologies here are HTML, CSS, and JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Back-End Developer&lt;/strong&gt;: Focuses on server-side aspects, databases, and application logic. The back-end ensures that information is processed and delivered correctly to the front-end. Technologies like Node.js, Ruby on Rails, Django, Java, and others are common in this area.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full-Stack Developer&lt;/strong&gt;: Combines both front-end and back-end skills. This professional has the ability to build a complete web application, from design to server infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Type of Careers
&lt;/h2&gt;

&lt;p&gt;The job market offers different career options for web developers. Each has its particularities, advantages, and challenges:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large Companies&lt;/strong&gt;: Working at a large company can provide stability, benefits, and the opportunity to work on large-scale projects. However, the work can often be more segmented, with well-defined specializations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Startups&lt;/strong&gt;: If you're looking for a more dynamic and challenging environment, working at a startup may be ideal. In these places, you'll likely use a variety of skills, solve complex problems, and grow quickly. The downside may be a lack of stability and a more intense workload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Freelancer&lt;/strong&gt;: Working independently offers flexibility and autonomy. You can choose the projects you want to work on and set your own hours. However, it’s also necessary to have management skills, as you'll be responsible both for development and for acquiring clients and managing your time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consultants&lt;/strong&gt;: If you have solid experience, you can work as a consultant for companies, helping them define the best technical solutions for their projects. Here, you can make a significant impact on companies of different sizes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Choose Your Learning Path?
&lt;/h2&gt;

&lt;p&gt;Before following any learning roadmap, it's important to have clarity about the type of developer you want to become and the type of career you want to pursue. The website &lt;a href="//roadmap.sh"&gt;roadmap.sh&lt;/a&gt; provides an excellent visual guide to show the learning steps for front-end, back-end, and full-stack developers.&lt;/p&gt;

&lt;p&gt;But before looking at the roadmap, here are a few considerations:&lt;/p&gt;

&lt;p&gt;What are your interests? If you enjoy visual interactions and design, front-end might be the best choice for you. If you prefer working with logic and servers, back-end could be a good fit.&lt;/p&gt;

&lt;p&gt;What type of work do you want to do? If you want to work at large companies or startups, your choice of technology might influence your decision.&lt;/p&gt;

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

&lt;p&gt;Web development is an exciting journey full of possibilities. Whether in large companies, startups, as a freelancer, or a consultant, there are many opportunities for those who are willing to learn and adapt. With the right tools and the motivation to evolve, you can follow the path that best matches your skills and interests.&lt;/p&gt;

&lt;p&gt;Remember: the key is to get started! Choose the path that resonates most with your profile and keep exploring. And don’t forget, practice is essential to becoming a successful web developer.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
