Design comparison
Solution retrospective
-
Most Proud of:
- Practicing Sass (mixins, functions)
- Implementing responsive design.
- Making some design changes.
- Expected Completion Time: 1-3 days
- Actual: about a week (due to ADHD) ๐
- Technologies used
- ๐: HTML
- ๐จ: CSS (SASS)
- ๐ฅ๏ธ: Desktop First Design
- ๐ : Date-fns
-
Changes for Next Time:
- Implement unit testing.
- Experiment with a web framework.
-
Challenges Encountered:
- Dealing with dates in JavaScript, which lacks a built-in subtraction method, particularly when considering leap years.
- Lack of references for exact dimensions or specific styles applied.
- Lack of motivation to complete the challenge.
-
Solutions Implemented:
- Used date-fns for date manipulations.
- Applied the unit or style that seemed most appropriate.
- Consumed snacks while working on the challenge as a source of dopamine fuel.
- Curious if the use of global variables is considered a bad practice.
- Seeking suggestions for better elements to enhance semantic HTML.
- Open to feedback if Iโve overlooked something or if thereโs an issue with the logic or design.
Thank you
Community feedback
- @kodan96Posted 5 months ago
hi there! ๐
For your first question:
Generally it's not a good practice to use and depend on global variables. You should encapsulate most of them into functions, so your code can run with better performance, and using global variables can cause unexpected behavior, especially if you use
this
a lot.In environments where JavaScript is used in concurrent contexts, global variables can introduce race conditions and concurrency issues, making the code prone to errors and difficult to debug.
Following modular programming principles and encapsulation is a better way to handle things. You can also create closures. Of course sometimes it's just easier to use global variables, but it's better to use the least amount of them.
Hope this was helpful ๐
Good luck and happy coding! ๐
Marked as helpful2@CJ-CepePosted 5 months ago@kodan96 Thank you very much ๐. Iโll read about and try encapsulation and modular programming, and reduce the use of global variables in my next projects. This was helpful, thankies again! โค๏ธ
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord