3 ms·
One 'best' practice that irks me: "Avoid static methods or attributes in Java". I find static final attributes to be quite good to avoid magic numbers or strin
by pnt12 11y ago
One 'best' practice that irks me: "Avoid static methods or attributes in Java".
I find static final attributes to be quite good to avoid magic numbers or strings. Static methods also seem better for functional, stateless methods. Why instiate an object when you don't need it?
I assume most professionals know when or not to use static. However, most of my university colleagues avoid it like the plague, because every professor says "static is usually bad practice".
- recursive 11y agoMy favorite "best" practice to violate is "All fields must be private."
- MichaelBurge 11y agoI can't remember the last time I've actually made a field private.