DEV Community

Elisaassa
Elisaassa

Posted on β€’ Edited on

OSD lab3

Lab 3 Blog: Implementing File Size and Execution Time Features

Hey everyone! πŸ‘‹

I'm back with Lab 3, and this time, I focused on supercharging my Code-Formatter-Advisor project by adding two awesome features: File Size Calculation and Execution Time Measurement. These additions are all about giving you more insights and making your experience smoother. Let me share how I rolled these out, managed parallel development with Git branches, and successfully merged everything without a hitch.


πŸš€ Features Implemented

1. πŸ“ File Size Calculation

First up, I added the File Size Calculation feature. Knowing the size of each file in bytes can be a game-changer, especially when you're dealing with large datasets or multiple files. It helps you get a clearer picture of what's being processed.

Issue Created: Add File Size Calculation for Analyzed Files (#3)

How I Did It:

  • New Command-Line Argument: Introduced a --file-size flag. Simple and straightforward!
  • File Size Logic: Leveraged Node.js's fs module to calculate and display the file size right in your terminal or write it to an output file if you prefer.

2. ⏱️ Execution Time Measurement

Next on the list was the Execution Time Measurement feature. Ever wondered how long it takes to analyze each file? This feature answers that by tracking and displaying the time taken for each file's processing.

Issue Created: Add Execution Time Measurement (#4)

How I Did It:

  • New Command-Line Flag: Added a --time flag to toggle this feature on or off.
  • Timing Logic: Used JavaScript's Date object to record the start and end times of the file analysis.
  • Output: Displays the execution time for each file in the terminal or writes it to your specified output file.

🌿 Branch Management and Merging Strategy

To keep things organized and avoid chaos, I adopted a branch-per-feature approach. Here's how I managed it:

Steps I Followed:

  1. Created Separate Branches for Each Feature:

    • issue-3 for the file size calculation.
    • issue-4 for the execution time measurement.
  2. Implemented Features Independently:

    • Worked on each branch separately to keep changes isolated and the codebase clean.
  3. Merging Back into Main:

    • First, merged issue-3 into the main branch.
    • Then, merged issue-4 into main.

Luckily, merging went smoothly with no major conflicts, thanks to keeping the changes minimal and well-organized.


πŸ“ Conclusion

Lab 3 was an incredible learning experience in managing multiple Git branches and merging parallel developments seamlessly. I honed my skills in feature isolation, avoiding merge conflicts, and maintaining code stability throughout the process.

I'm really excited about the new features in Code-Formatter-Advisor. The File Size and Execution Time Measurement functionalities add valuable context, making the tool even more powerful and user-friendly.

Closed Issues:

Thanks for reading! Stay tuned for more updates on the development of Code-Formatter-Advisor.

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Image of DataStax

Langflow: Simplify AI Agent Building

Connect models, vector stores, memory and other AI building blocks with the click of a button to build and deploy AI-powered agents.

Get started for free

πŸ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay