Jason Knight
1 min readSep 19, 2020

--

Your second example I'd give a failing grade to both... multiple returns and multiple lines for nothing since you could just use a ternary.

On section 8, I'd probably do a loose false compare, since empty and undefined are likely invalid as well. Even just "0" would be invalid since it's not an e-mail, so get that out of the way too.

I'd also give an "F" to all the code in section 15. PX metric fonts are accessibility trash :D

You should probably also edit section 16 so both your examples actually do the same thing. Just saying.

But overall your article hits most of the right points. It is amazing how often I see redundant/pointless "else", if/else doing switch's job, !important out of people who can't seem to grasp specificity, Don't even get me started about all the "let's grab everything" queries, and failure to safe-check variables.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

No responses yet