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

kind of tangentially related: despite spending decades programming in C-family languages, i have no idea which operators have precedence over others. in my own code, i always use enough parentheses so that it doesn't matter. if i'm looking at somebody else's code that contains long strings of unparenthesized numbers and operators, i'll have only a vague guess at what the eventual outcome will be.

if i find myself having to maintain code like that, first i'll write unit tests, then add parentheses where i think they ought to go, and make sure the tests still pass.



+1; I think many devs that regularly rotate thru java, python, ruby, javascript, etc. have to over-parenthesize (and engage in other least common denom-type stuff like inserting line-ending semicolons and parens around method args even wehre optional (ruby);




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: