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

Got me. How do old-school C programmers ensure they don't accidentally use = when they mean == ?

There are actually some decent commercial PHP IDEs, believe it or not. I wouldn't be surprised if some of them are able to Warn on loose equality comparisons. I don't have much direct experience with them though.




How do old-school C programmers ensure they don't accidentally use = when they mean == ?

By making the constant the expression's lvalue. But they don't have to do this anymore; gcc warns when you accidentally use = instead of == now.




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

Search: