Colin Bitterfield
2 min readDec 27, 2019

--

I read over the article. I found it generally good. You might want to consider explaining something like ‘===’. I don’t program in Javascript. The article reads more generic about programming. I had to look this one up. Python has no similar (and very complex) construct. I also wager that under some conditions this operator uses a lot of CPU time. I am not sure if I agree with all of your assertions as written. Best Practices are not as prescriptive or restrictive. They do exist to prevent problems like SQL injection and other security-related issues. I think there is a quote about Issac Asimov regarding the quality of a store. Programming is the same. The program should be a good program without regard to the language. Commenting code some times is redundant with simple functions (Like a comment about a primary loop start and way down in the code the primary look ending) Something you document the code with “un-necessary” comments to help with complex troubleshooting. Like a chapter number in a book. Everyone knows it’s page 1, but if it is extracted then it’s important to know which page is which page. There are specific principals that most programmers miss. If you look at OWASP 10, they haven’t changed in decades. Therefore, following some best practices is important,

The Strict Equality Comparison Algorithm

If Type(x) is different from Type(y), return false.
If Type(x) is Undefined, return true.
If Type(x) is Null, return true.
If Type(x) is Number, then
If x is NaN, return false.
If y is NaN, return false.
If x is the same Number value as y, return true.
If x is +0 and y is −0, return true.
If x is −0 and y is +0, return true.
Return false.
If Type(x) is String, then return true if x and y are exactly the same sequence of characters (same length and same characters in corresponding positions); otherwise, return false.
If Type(x) is Boolean, return true if x and y are both true or both false; otherwise, return false.
Return true if x and y refer to the same object. Otherwise, return false.

--

--

Colin Bitterfield
Colin Bitterfield

Written by Colin Bitterfield

NIST certified Security Professional | 10+ years experience in infrastructure security and compliance | Experienced in creating security programs.

No responses yet