Hacker News new | past | comments | ask | show | jobs | submit login

I say this as a C++ programmer: I think a lot of these errors are non obvious because of the sheer amount of syntactic noise surrounding them. I also write a lot of python, and a lot of these errors are still possible but way more obvious. C++ is seriously the worst about surprising syntax causing temporary blindness from overload, excluding maybe Perl.

Static code analysis is fantastic for a language like this (if you can afford it; not sure what the pricing on this product is -- can't say I've ever seen a cheap static code analyzer though :-) )




I wrote C++ for a few years professionally and found myself able to look through the noise quite a bit. I remember doing a side project in python to expand my horizons and I felt naked without blankets of parenthesis and brackets around all of my stuff.


So, I don't think it is the noise of the syntax; it is the noise of a large code base. I found 12/15 errors (it scored one as missed, though I did find it).

I did well, because I was actually looking for bugs; and I didn't write the code, so had no preconceived notions of what it was supposed to do.

When you have 10s or 100s of thousands of lines of code in your project, however, you aren't going to know where to look for a bug (because they could be anywhere or everywhere); and one can often be blinded by knowing how it is supposed to read, not how it actually reads.


clang's static analyzer performs well and is exceedingly inexpensive




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

Search: