Guest User

Untitled

a guest
Jun 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. if (condition1 && condition2 && condition3)
  2. {
  3. // Do something
  4. }
  5.  
  6. if ((object != null) && (object.SomeFunc() != value))
  7. {
  8. // A bad way of checking (or so I thought)
  9. }
  10.  
  11. if (object != null)
  12. {
  13. if (object.SomeFunc() != value)
  14. {
  15. // A much better and safer way
  16. }
  17. }
  18.  
  19. // perfectly legal and quite a standard way to express in C++/C#
  20. if( x != null && x.Count > 0 ) ...
  21.  
  22. // will fail in VB6 if x is Nothing.
  23. If x Is Not Nothing And x.Count > 0 Then ...
Add Comment
Please, Sign In to add comment