Reputation
1,874
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
1 19 25
Newest
 Nice Answer
Impact
~45k people reached

  • 0 posts edited
  • 0 helpful flags
  • 228 votes cast
Jun
13
comment Does relying on intellisense and documentation a lot while coding makes you a bad programmer?
I'd much rather work with the person who looks everything up than the one who only thinks he knows how everything works.
Jun
12
comment Should I use parentheses in logical statements even where not necessary?
In all the languages I work with regularly it's .member before unary operators, unary before binary operators, * and / before + and - before < and > and == before && before || before assignment. Those rules are easy to remember because they match my "common sense" about how the operators are normally used (e.g., you wouldn't give == greater precedence than + or 1 + 1 == 2 stops working), and they cover 95% of the precedence questions I'd have.
Jun
12
comment Should I use parentheses in logical statements even where not necessary?
+1, parentheses for clarity are fine, but AND vs OR is a fairly basic case which I would want the other devs on my team to know. I worry that sometimes "using parentheses for clarity" is really "using parentheses so I never have to bother to learn the precedence".
Jun
12
comment Should I use parentheses in logical statements even where not necessary?
That said, the same precedence of AND/OR holds in Basic, Python, SQL... my impression is that this is the rule in the vast majority of modern languages (albeit not all).
Jun
12
comment Should I use parentheses in logical statements even where not necessary?
@GradyPlayer, Yeah, I said && and || instead of and and or to try to cover myself here. I think all the C-style languages are consistent about this (C, C++, Java, C#, JavaScript, ...).
Jun
12
comment Should I use parentheses in logical statements even where not necessary?
Just remember && is times and || is plus, and you'll never forget which comes first.
Feb
26
awarded  Caucus
Dec
1
awarded  Notable Question
Sep
9
awarded  Notable Question
Sep
2
awarded  Yearling
Jul
13
awarded  Notable Question
May
3
awarded  Good Question
Nov
24
awarded  Popular Question
Nov
14
awarded  Popular Question
Oct
1
awarded  Nice Question
Sep
3
awarded  Yearling
Aug
23
awarded  Good Question
May
26
awarded  Good Answer
May
13
awarded  Popular Question
May
9
awarded  Favorite Question