@alex-kim-dev
Posted
Awesome job, Tediko! I see you put a lot of effort into this project. I like that everything is well organized, files, code, commits, it's really easy to navigate through and find out how things are connected to each other. And great job on writing readme! Here is some feedback:
- animation feels slow, I would adjust duration to be around 200-300 ms
- accessing local storage might throw errors in some cases, for example if a user turned off all cookies in Chrome, some older browsers might throw even if only third-party cookies are blocked. So It's a good practice to wrap it in a try-catch block
- there are a few places with a lot of nested if-else statements, like in
formValidation.js
. That's increasing cyclomatic complexity and makes code hard to understand, especially for people not familiar with the codebase. Try to avoid nesting conditions. Ideally it should look like this:
() => {
if (conditionA) return value1;
// the following code will be executed only if(!conditionA)
if (conditionB) return value2;
// the following code will be executed only if(!conditionA && !conditionB)
return value4;
}
- would be nice to work a bit on loading performance. I had DOMContentLoaded: 1.99s on fast connection and 5.32s on simulated "fast 3G".
Good luck and until the next awesome project!
Marked as helpful
@Alex-K1m Thanks! Indeed, the animations are too long and therefore use of application isn't as smooth as it should be. I like web animations and I found myself using them far too much π .
Oh, I didn't know that! Now I've take a quick look and in fact using localStorage
directly can be a bad idea. I will definitely take a proper look on the topic.
Aw Jeez! Believe me, I was about to say at the top of the file that I am not responsible for the consequences of reading this validation code π Validation itself was easy but pushing all error messages to object was harder part. It iterates through an object that has a string, array, or object property and within arrays and objects there are many more to check. I'm not happy with this code and know that it shouldn't look like this.
I never got into the subject of performance, but definitely I have to.
Thanks for great feedback Alex! Good luck too!