DEV Community

Ali Hamza
Ali Hamza

Posted on

Day 97 of Learning MERN Stack

Hello Dev Community! 👋

It is officially Day 97 of my 100-day backend and frontend engineering marathon! 🎯 With only 3 days left on the clock, my push to master pure core web fundamentals is hitting its peak. Today, I engineered two highly practical client-side utilities entirely from scratch using raw HTML, CSS, and Vanilla JavaScript!

Building everything close to the native ecosystem forces you to manage memory lifecycles, clear execution intervals, and manipulate layout nodes safely.


🧠 Deconstructing Today's Fundamental Architecture

Here is how the underlying engineering works inside my latest sandbox implementations across "Screenshot (216).jpg" and "Screenshot (217).jpg":

1. Project 1: Precise Real-Time Countdown Timer

  • The Goal: Calculate and print the exact remaining time delta until a specific forward timestamp, updating the UI smoothly every single second.
  • The Core Tech (As referenced in "Screenshot (216).jpg"):
    • Leveraged setInterval() to fire state computations on a strict 1000ms loop layer.
    • Executed high-precision timestamp mathematics: subtracting Date.now() from the targeted date value to return raw millisecond offsets.
    • Used floor divisions to cleanly break down the remaining delta into distinct structural outputs: Days, Hours, Minutes, and Seconds.

2. Project 2: Algorithmic Paragraph Content Generator

  • The Goal: Take a dynamic numerical value input from the user and instantaneously generate an array-backed dummy text payload to avoid bulky design copy-pasting.
  • The Core Tech (As referenced in "Screenshot (217).jpg"):
    • Configured a custom data array holding diverse mock paragraphs.
    • Wrote event capturing parameters to check the user input value field, validating boundaries instantly upon clicking the invocation trigger.
    • Utilized dynamic array loop slicing and automated node appending to push the calculated paragraph collection directly into the visible DOM without layout flickering.

💡 The Technical Win: Memory Safety in Native Code

When building asynchronous timers using pure JavaScript, a key lesson is preventing layout performance leaks. Ensuring that intervals are efficiently mapped and that structural text arrays are cleanly sliced without rebuilding entire structural parent rows keeps browser memory usage down to a bare minimum.


🎯 Target Milestones for Tomorrow (Day 98)

The final 3-day countdown continues:

  • Moving further into complex client-side applications focusing on state serialization.
  • Preparing the final staging structures for my 100th-day showcase portfolio.

💬 Let's Connect!

To all developers: When writing ticking countdown timers or clocks in your applications, do you rely on third-party date utilities, or do you prefer handling raw time conversions yourself? Let's discuss optimization below!

My active solution archive updates daily on GitHub!
[Links in the Comments]

97 days of absolute focus. Finishing this sprint with rock-solid foundations! 🚀

Top comments (0)