Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A-mazing

Also, notice the difference in number of results between C and C++ below:

http://www.google.com/codesearch?hl=en&lr=&q=if%5Cs*...

vs

http://www.google.com/codesearch?hl=en&lr=&q=if%5Cs*...



That's why I write comparisons like

if (CONSTANT == variable)



I know it's safer, but personally I find it harder to read. Especially if the constant is a #define or enum and is similar in format to the variable in question.


I personally like Yoda Conditions, but a few coworkers have pointed out that any linter worth its salt will catch an = inside a conditional, so this doesn't actually gain much in safety. I've stopped using them because there a large number of coworkers find them confusing.



Maybe I am feeling dense, but I do not understand what you are trying to point out. None except one are errors as they relate to embedded sql statements (where Equal To is the comparison operator).


maybe we re seeing different results. mine have 8 incorrect assignments in the first page


The code is generating code for a different language -- the = is always in a string.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: