17 lines
436 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The meaning of a boolean parameter may seem perfectly clear when you first write a method call, but that meaning is likely to fade for you over time, and could be completely opaque to those who come behind you.
Instead, object literals should be used.
== Noncompliant Code Example
----
widget.repaint(false); // Noncompliant; does this mean never repaint?
----
== Compliant Solution
----
widget.repaint({immediate: false});
----