It's okay to call functions though, like how your string example calls strtoupper and several others - but it's not okay to write/call your own functions?
I understand it's "not OOP", but "should not be used"?
I think there are well founded reasons why most languages support both paradigms - there are cases for functions and cases for classes, I think, and your string example is sufficiently complex and verbose as to leave me pretty firmly convinced of that.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My point is that static classes should not be used in OOP.
That example with decorated
String
s is an OOP alternative to proceduralStringUtils
class.It's okay to call functions though, like how your string example calls
strtoupper
and several others - but it's not okay to write/call your own functions?I understand it's "not OOP", but "should not be used"?
I think there are well founded reasons why most languages support both paradigms - there are cases for functions and cases for classes, I think, and your string example is sufficiently complex and verbose as to leave me pretty firmly convinced of that.