<?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: Aminah Rashid</title>
    <description>The latest articles on DEV Community by Aminah Rashid (@aminah_rashid).</description>
    <link>https://dev.to/aminah_rashid</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%2F1704105%2F34513454-5093-4a3e-b51b-856ececa0ef5.jpg</url>
      <title>DEV Community: Aminah Rashid</title>
      <link>https://dev.to/aminah_rashid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aminah_rashid"/>
    <language>en</language>
    <item>
      <title>Automating the Mundane: My Journey with Node-cron</title>
      <dc:creator>Aminah Rashid</dc:creator>
      <pubDate>Sat, 29 Jun 2024 23:38:05 +0000</pubDate>
      <link>https://dev.to/aminah_rashid/automating-the-mundane-my-journey-with-node-cron-2gi7</link>
      <guid>https://dev.to/aminah_rashid/automating-the-mundane-my-journey-with-node-cron-2gi7</guid>
      <description>&lt;p&gt;Have you ever had that bad feeling of having forgotten something important? Imagine that "something" to be remembering to mark one's daily attendance at work. While developing an attendance management system, this exact scenario posed a considerable problem: How could I ensure that users log in their presence consistently when they forgot to do so? This led me to explore automated solutions, ultimately discovering Node-cron as an effective tool for scheduling tasks in Node.js applications..&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;br&gt;
Imagine this: a brand-new attendance system, shiny, ready to check in and out every user. The trouble was that it relied on people to remember to use it. Anyone who has ever forgotten their keys can testify that human memory is not always the most reliable thing in the world. I needed some surefire method whereby these attendance records would be verified and updated automatically so that our digital tracker wouldn't stray when people forgot or occasionally tried to take advantage of it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learning Approach And Solution Steps&lt;/strong&gt;&lt;br&gt;
To address this challenge, I began with online research, using resources like developer forums and documentation. When Node-cron was suggested as a potential solution, I adopted a structured learning approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I then referred to the official Node-cron documentation, and tried to learn the basics.&lt;/li&gt;
&lt;li&gt;I found a goldmine of practical knowledge in a tutorial video titled &lt;a href="https://youtu.be/6gmdFPlkuhQ"&gt;"Scheduling Tasks in Node.js | Cron Jobs in real projects,"&lt;/a&gt; which was very practical.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Node-cron: The Scheduling Master&lt;/strong&gt;&lt;br&gt;
Let me introduce you to basis of Node-cron, the unsung hero of task automation in the Node.js world.You can think of it as a super-smart alarm clock for your code. Using cron expressions—a series of five fields representing minutes, hours, days, months, and weekdays—you will tell your application strictly when it should execute specific functions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz2qiv156riiif33ou9pm.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz2qiv156riiif33ou9pm.PNG" alt="Image description" width="737" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For instance, "0 19 * * *" will mean "Execute this task every day at precisely 7:00 PM!" It is like an assistant who will never stop or forget to do his job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node-cron Basics&lt;/strong&gt;&lt;br&gt;
The following are some code snippets that will give users a feel for what Node-cron can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Daily Task at a Specific Time
const cron = require('node-cron');

cron.schedule("0 19 * * *", () =&amp;gt; {
  console.log("This task runs at 7:00 PM every day!");
});

Hourly Task
cron.schedule("0 * * * *", () =&amp;gt; {
  console.log("This task runs at the start of every hour.");
});

Weekly Task on Mondays
cron.schedule("0 9 * * 1", () =&amp;gt; {
  console.log("This task runs every Monday at 9:00 AM.");
});

Monthly Task on the First Day
cron.schedule("0 0 1 * *", () =&amp;gt; {
  console.log("This task runs on the first day of every month at midnight.");
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These examples demonstrate Node-cron's adaptability, handling everything from daily reminders to monthly updates. But how exactly did it tackle our attendance challenge?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Attendance Automation Solution&lt;/strong&gt;&lt;br&gt;
Get ready for the game-changer - the code that revolutionized our attendance system from prone to forgetfulness to completely reliable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cron.schedule("0 19 * * *", async () =&amp;gt; {
  try {
    const users = await User.find();
    for (const user of users) {
      const existingAttendance = await Attendance.findOne({
        userId: user._id,
        createdAt: { $gte: new Date().setHours(0, 0, 0, 0) },
      });
      if (!existingAttendance) {
        await Attendance.create({
          userId: user._id,
          status: "Absent",
        });
      }
    }
    console.log("Attendance records updated.");
  } catch (error) {
    console.error("Error updating attendance records:", error);
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following code will automate the daily attendance checks: fetch all users from the database, check attendance against already available records for the given day, and create new "Absent" records for users who have not marked it. It also flashes a success update message and logs errors encountered during this process for debugging and maintenance. This approach dramatically increases the reliability of an attendance management system by ensuring proper tracking without manual oversight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grow Your Skills At HNG Internship&lt;/strong&gt;&lt;br&gt;
Implementing Node-cron to solve our attendance challenge proved the power of automation in backend development. As a full-stack developer coming from the frontend, I've learned and valued the complexity and importance that server-side solutions bring.&lt;/p&gt;

&lt;p&gt;This experience aligns perfectly with the HNG Internship's practical approach. While HNG offers various tracks, it's particularly valuable for aspiring backend developers. If you're looking to work on real-world projects and expand your skills, this internship is an excellent opportunity.&lt;/p&gt;

&lt;p&gt;My journey with HNG is driven by two goals: gaining hands-on experience with industry-level problems and expanding my international network. Whether you're passionate about Node.js, databases, or APIs, HNG provides a platform to grow, collaborate, and prepare for the tech industry's demands.&lt;/p&gt;

&lt;p&gt;Want to better your backend and raise a hullabaloo by starting your career? Then, the HNG Internship definitely could be that giant step. It's not just about coding; it's about becoming a well-rounded developer ready for real-world challenges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
And there you have it—my tale of Node-cron, which came in to save the attendance system from human negligence. For developers navigating the complexities of scheduling tasks, Node-cron is a game-changer I wholeheartedly endorse. It's like having a mindful assistant on your code: attentive, efficient, and never late.&lt;/p&gt;

&lt;p&gt;In the realm of software development, the most invaluable solutions often operate silently, ensuring seamless operations behind the scenes. Here's to seamless coding experiences ahead!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;br&gt;
Check out these Links, if you wanna learn more about HNG:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://hng.tech/internship"&gt;HNG Internship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hng.tech/premium"&gt;HNG Premium&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>backenddevelopment</category>
      <category>cronjobs</category>
      <category>automation</category>
      <category>node</category>
    </item>
    <item>
      <title>Angular vs React: A Frontend Showdown</title>
      <dc:creator>Aminah Rashid</dc:creator>
      <pubDate>Sat, 29 Jun 2024 20:34:55 +0000</pubDate>
      <link>https://dev.to/aminah_rashid/angular-vs-react-a-frontend-showdown-cpf</link>
      <guid>https://dev.to/aminah_rashid/angular-vs-react-a-frontend-showdown-cpf</guid>
      <description>&lt;p&gt;How many times have you been in the cereal aisle, just trying to make a decision on which box to take? Thats what a whole lot of beginners feel (including yours truly) when they first check out the front-endaries. When you are new it can make your head spin, all the frameworks, libraries and tools… There are so many choices, but two giants from the front end world often rise above all else - Angular and React. But which is the right pick for you? What makes each unique? If you're just getting started with coding or hoping to develop your skill set, gear up - this journey through various frameworks could come in handy on the tough road towards finding your home turf under frontend development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React: The Builder's Dream Kit&lt;/strong&gt;&lt;br&gt;
Imagine you are building a dream house. React is much like the flexible builder's kit that will let you design each and every thing in your home, from the furniture down to the paint color and décor - whatever your fancy was. Sounds exciting, right?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;React provides:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Component-based architecture for this - think modular furniture!&lt;/li&gt;
&lt;li&gt;Virtual DOM for efficient updates - quick room makeovers, anyone?&lt;/li&gt;
&lt;li&gt;JSX, combining HTML with JavaScript (think of it as merging your architecture plan with your interior design document).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, here is the thing: with great freedom comes great responsibility. There are a whole lot of decisions one must make - and that is exciting to some and paralyzing for others. Have you ever felt paralyzed by too many choices?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Angular: The Ready-Made Mansion&lt;/strong&gt;&lt;br&gt;
Let us now turn our attention to Angular. If React is a builder's kit, then Angular is buying the house - fully furnished, with all the amenities set up and ready. You just have to come with your toothbrush!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Angular provides:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A complete framework with built-in tools (no need to shop for extras!).&lt;/li&gt;
&lt;li&gt;Two-way data binding: Your rooms are updated by themselves. &lt;/li&gt;
&lt;li&gt;Dependency injection: Well, this is like having a personal butler in every room.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But remember, all this structure brings along its learning curve. It's almost like having to learn to get around a new house. Again, where are the light switches?&lt;br&gt;
Which one of these approaches speaks more to you? Do you enjoy the freedom of building from scratch, or do you want the ease of using a readymade solution?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Angular vs. React: The Framework Face-Off&lt;/strong&gt;&lt;br&gt;
Now that we have gone through both Angular and React, you probably wonder how they match up against each other. Let's dive into an in-depth comparison of the two to help you make the best decision.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Learning Curve:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Angular:&lt;/strong&gt; Steeper because of TypeScript and due to its comprehensive nature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React:&lt;/strong&gt; Gentler with its simpler JavaScript-based approach.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Performance:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;React:&lt;/strong&gt; Often faster with its Virtual DOM optimizing rendering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Angular:&lt;/strong&gt; Solid, but two-way data binding can slow complex apps. Ever felt like your app was just a bit slower than you kind of expected or hoped for? Well, that might be why.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Community and Ecosystem:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Both have vibrant communities, but React's is massive. According to the 2023  &lt;a href="https://survey.stackoverflow.co/2023/"&gt;Stack Overflow Developer Survey&lt;/a&gt;, React was preferred by about 40.58% of developers, compared to Angular's 17.46%. This means more resources, tutorials, and job opportunities for React.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ekpj3czgeor913hzp76.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ekpj3czgeor913hzp76.PNG" alt="Image description" width="771" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Job Market Demand and Salaries:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
React developers often have an edge in the job market and typically command higher salaries. If you browse platforms like LinkedIn or Indeed, you'll often come across more job postings for React developers compared to Angular developers. According to data from &lt;a href="https://arc.dev/freelance-developer-rates"&gt;Arc&lt;/a&gt;, React developers earn an average hourly rate ranging from $81 to $100, with a median between $61 and $80. In contrast, Angular developers have an average and median hourly rate of $61 to $80. This suggests greater opportunities and potentially better compensation for those skilled in React.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1a89xk74xqzebzvadmzb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1a89xk74xqzebzvadmzb.PNG" alt="Image description" width="800" height="435"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1mg0mpwz4ab2hjis6h7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1mg0mpwz4ab2hjis6h7.PNG" alt="Image description" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Pros and Cons:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Angular:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros:&lt;/strong&gt; Full-featured, consistent, strong typing with TypeScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons:&lt;/strong&gt; Steep learning curve, more verbose code, potentially slower for complex apps.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros:&lt;/strong&gt; Flexible and easy to learn, high performance, large ecosystem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons:&lt;/strong&gt; Extra libraries may be required, and frequent updating could raise compatibility problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick Comparison Table:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-------------------+---------+-----------+
|      Aspect       | Angular |   React   |
+-------------------+---------+-----------+
| Learning Curve    | Steeper | Gentler   |
| Performance       | Good    | Excellent |
| Community Support | Large   | Massive   |
| Job Market Demand | High    | Very High |
+-------------------+---------+-----------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ultimately, it all comes down to your project requirements and whom you've got on your team. Keep in mind that with Angular or React, you can always build a robust application. Which one will you pick for your next project?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choosing Your Framework Champion&lt;/strong&gt;&lt;br&gt;
While both frameworks are powerful, they each shine in different scenarios:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Choose Angular when:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You develop complex, large-scale, feature-rich applications.&lt;/li&gt;
&lt;li&gt;Your team uses and loves TypeScript and wants a full-fledged framework.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Only use React when:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want flexibility and love to customize.&lt;/li&gt;
&lt;li&gt;You are building dynamic, high-performance UIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Unlocking Growth at HNG&lt;/strong&gt;&lt;br&gt;
Calling all aspiring React developers ready to challenge themselves alongside a community of like-minded individuals! If you're up for the adventure in ReactJS, to collaborate on real-world projects, and really want to push yourself to the limit, then the HNG Internship is your way to go. The internship program is structured into stages, and every stage comes with tasks and deadlines designed to test one's skills rigorously so that only the best submissions make it through to the next level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;My Expectations at HNG Internship:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exploring State-of-the-Art Technology:&lt;/strong&gt; Learn and apply new technologies from the innovative React ecosystem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Collaboration:&lt;/strong&gt; Engaging in teams for specific tasks that enhance networking skills and foster innovative solutions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-World Projects:&lt;/strong&gt; Engaging in hands-on tasks that simulate industry challenges, honing skills and fostering practical experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;How I Feel About React:&lt;/em&gt;&lt;/strong&gt; Personally, to me, React feels like home. The component-based architecture and rich ecosystem make it a joy to write elegant solutions. I love working with React and getting my hands dirty with the technology. Far from now, I have been following an approach to learning React that lets me know what is happening behind the curtains, hence making the journey enjoyable. Well, my opinion, but it is like this: if you really know how things come together then things become easier to enjoy and make.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;The Final Render&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
As we wrap up our Angular vs React showdown, remember: there's no one-size-fits-all in the world of frontend frameworks. Angular offers a comprehensive, opinionated approach, while React provides flexibility and a gentler learning curve.&lt;/p&gt;

&lt;p&gt;My take? I'm Team React for now, but I've got mad respect for Angular. The best framework is the one that fits your project, team, and personal style.&lt;/p&gt;

&lt;p&gt;So, fellow code warriors, which framework are you leaning towards? Have you had any "aha!" moments with either? Share your thoughts in the comments - let's keep this frontend fiesta going!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;br&gt;
Check out these Links, if you wanna learn more about HNG:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://hng.tech/internship"&gt;HNG Internship&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hng.tech/premium"&gt;HNG Premium&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>frameworks</category>
      <category>angular</category>
      <category>react</category>
      <category>comparsion</category>
    </item>
  </channel>
</rss>
