<?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>Forem: Frederick</title>
    <description>The latest articles on Forem by Frederick (@sharpartzgh).</description>
    <link>https://forem.com/sharpartzgh</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%2F1208664%2Fe484d795-cded-4bef-a660-b23e8fa5b7e4.jpg</url>
      <title>Forem: Frederick</title>
      <link>https://forem.com/sharpartzgh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sharpartzgh"/>
    <language>en</language>
    <item>
      <title>Learning Astro Framework</title>
      <dc:creator>Frederick</dc:creator>
      <pubDate>Fri, 26 Sep 2025 12:38:21 +0000</pubDate>
      <link>https://forem.com/sharpartzgh/learning-astro-framework-33co</link>
      <guid>https://forem.com/sharpartzgh/learning-astro-framework-33co</guid>
      <description>&lt;p&gt;Wish me all the best ❤️😂&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How new Date().getFullYear() Saves Our Ass in JavaScript</title>
      <dc:creator>Frederick</dc:creator>
      <pubDate>Sat, 01 Feb 2025 23:43:56 +0000</pubDate>
      <link>https://forem.com/sharpartzgh/how-new-dategetfullyear-saves-our-ass-in-javascript-1h5g</link>
      <guid>https://forem.com/sharpartzgh/how-new-dategetfullyear-saves-our-ass-in-javascript-1h5g</guid>
      <description>&lt;p&gt;JavaScript’s new Date().getFullYear() is one of those lifesaving features that quietly keeps our code running smoothly—until we forget to use it and chaos ensues. Whether you're dealing with age calculations, copyright years, or date-based logic, this simple method ensures we’re always working with the correct year without manually updating our code every January&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem Without It&lt;/strong&gt;&lt;br&gt;
Imagine hardcoding a year in your JavaScript logic:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const currentYear = 2024; // Oops, gotta update this every year!&lt;/code&gt; lol&lt;/p&gt;

&lt;p&gt;A year later, your website still displays "© 2024" in the footer, making it look outdated and neglected. Or worse, you're validating a user’s birth year against a fixed number instead of a dynamic one, breaking your age verification system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How new Date().getFullYear() Saves the Day&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With this simple method, JavaScript dynamically fetches the correct year, no manual updates required:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const currentYear = new Date().getFullYear();
console.log(currentYear); // Always returns the correct year

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

&lt;/div&gt;



&lt;p&gt;✅ No manual updates&lt;br&gt;
✅ Prevents outdated information&lt;br&gt;
✅ Ensures date-based calculations work year-round&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-World Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Automatic Copyright Update&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.getElementById("footer").innerText =&lt;/code&gt;© ${new Date().getFullYear()} My Website&lt;code&gt;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;→ No need to update the footer every year!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Age Verification&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const birthYear = 2000;
const age = new Date().getFullYear() - birthYear;
console.log(`You are ${age} years old.`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Works accurately, every single year.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Expiration Date Calculations&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const expirationYear = new Date().getFullYear() + 5;
console.log(`This offer expires in ${expirationYear}`);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;→ Keeps promotions and subscriptions dynamically updated.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Final Thoughts&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The new Date().getFullYear() method is one of those JavaScript features that saves our butts by keeping our code accurate and up to date without extra maintenance. Forgetting to use it means risking outdated timestamps, broken logic, and a whole lot of unnecessary debugging. So, next time you need the current year—let JavaScript do the work! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Tailwind CSS Works and Why It’s a Good Choice for Frontend Development</title>
      <dc:creator>Frederick</dc:creator>
      <pubDate>Fri, 31 Jan 2025 12:18:39 +0000</pubDate>
      <link>https://forem.com/sharpartzgh/how-tailwind-css-works-and-why-its-a-good-choice-for-frontend-development-34pf</link>
      <guid>https://forem.com/sharpartzgh/how-tailwind-css-works-and-why-its-a-good-choice-for-frontend-development-34pf</guid>
      <description>&lt;p&gt;&lt;strong&gt;How Tailwind CSS Works&lt;/strong&gt;&lt;br&gt;
Tailwind CSS is a utility-first CSS framework that provides low-level utility classes to style elements directly in HTML. Unlike traditional CSS frameworks like Bootstrap, which offer pre-designed components, Tailwind allows developers to compose their own styles using a set of small, reusable classes.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Key Concepts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Utility-First Approach&lt;/em&gt;&lt;br&gt;
Instead of writing custom CSS, developers use pre-defined utility classes like text-blue-500, p-4, flex, and grid to style elements.&lt;br&gt;
 &lt;code&gt;example&lt;/code&gt;&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%2F7fcsbb2kil7c59dhlu64.png" 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%2F7fcsbb2kil7c59dhlu64.png" alt=" " width="800" height="128"&gt;&lt;/a&gt;&lt;br&gt;
&lt;code&gt;This eliminates the need for writing separate CSS files or defining custom class names.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JIT (Just-In-Time) Compilation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Tailwind generates only the CSS classes that are actually used in the project, resulting in a smaller CSS file and improved performance.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Highly Customizable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Developers can extend the default configuration by modifying tailwind.config.js, allowing custom colors, spacing, fonts, and more.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Responsive Design Made Easy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Tailwind uses a mobile-first approach with intuitive responsive classes like sm:, md:, lg:, etc.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;example&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%2F0w13ile8rvs7po1vh14c.png" 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%2F0w13ile8rvs7po1vh14c.png" alt=" " width="800" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Tailwind CSS Is a Good Choice for Frontend Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Faster Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No need to write custom CSS, leading to a streamlined development process.&lt;br&gt;
Utility classes reduce context switching between HTML and CSS files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consistent and Maintainable Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Eliminates the problem of inconsistent class naming and redundant CSS rules.&lt;br&gt;
Promotes reusability and avoids bloated stylesheets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance Optimization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The JIT compiler ensures that only the necessary styles are included, reducing the final CSS file size.&lt;br&gt;
No unused styles like in traditional frameworks.&lt;br&gt;
Better Collaboration&lt;/p&gt;

&lt;p&gt;Since styling is done directly in HTML, it becomes easier for developers and designers to work together without relying on complex CSS files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexible and Unopinionated&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike Bootstrap, Tailwind does not impose a specific design system, allowing full customization and unique designs without overriding predefined styles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thriving Ecosystem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Strong community support with plugins, UI kits, and integrations with React, Vue, and other frameworks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Tailwind CSS is a powerful, efficient, and flexible framework for modern frontend development. Its utility-first approach, responsiveness, and performance benefits make it an excellent choice for developers who want to build custom designs quickly while maintaining clean and maintainable code.&lt;/p&gt;

</description>
      <category>css</category>
      <category>tailwindcss</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
