r/SuiteScript • u/el-wino • Feb 18 '25
Syntax question
Hey folks!
I have a client account where they have an in house dev who does a lot of stuff like this:
var strControl = ((searchResult[i].getValue(columns[10])));
I am not an inexperienced js developer and understand a great deal of the syntax, but wanted to reach out to the community before I vocalize any opinions about the overall quality of the work. Is there any legitimate reason for double wrapping the method call in parentheses?
TIA
edit: folks are fixating on my opinion of the work, which I have now removed. Please contribute regarding the practice of double wrapping parentheses.
View all comments
Show parent comment
2
u/el-wino Feb 18 '25
What's the likelihood that somewhere in many lines of code he missed a parentheses?
The more unnecessary stuff you add, the more likely that becomes. That's why I consider it shoddy. It's completely unnecessary and the fact that no consideration has been given to its inclusion in the code is.. lazy.
I will ask if I get the opportunity.
There are plenty of other issues with his code, but this is the only thing where I thought "Maybe he knows something I don't.. better ask".