Boolean parameters
It's not fun to look at a method call that sends more than 0 boolean parameters.
There is 100% guarantee that you will look for the documentation about this parameters and it'll slow your code reading speed.
Here is a nice way to avoid the unreadable code and keep on using this meaningless Boolean.
This is not my idea though, it's from Microsoft pdb's, and I think its awesome.
Code Snippet
- SetBinding(false, false, comboBox);
There is 100% guarantee that you will look for the documentation about this parameters and it'll slow your code reading speed.
Here is a nice way to avoid the unreadable code and keep on using this meaningless Boolean.
Code Snippet
- SetBinding(/* auto resolve= */ false, /* two way binding? = */ false, comboBox);
This is not my idea though, it's from Microsoft pdb's, and I think its awesome.
Comments
Post a Comment