4 ms·
I was reading through some Python the other day (could have been "learn Python the hard way") and it struck me that one of the things that people like about it
by Stormbringer 16y ago
I was reading through some Python the other day (could have been "learn Python the hard way") and it struck me that one of the things that people like about it is the way it handles Strings, or the 'power' it gives you over strings or something like that.
Objecting to using + or += overloading on strings in Java seems to me to be cutting off your nose to spite your face.
In Objective-C for instance I dearly wish that there were better ways of slapping strings and integers together. But no, everything seems to be a call to some oddball class method with optional formatter classes and other magic constants tossed around with gay abandon. Or alternately, sometimes you can use C-style format strings, and sometimes you can't. Enjoy.
In Python would you object to nesting "s and 's because it feels hackish? In Lisp would you avoid Macros because they are hackish? In Perl would you avoid regexs because they are hackish?
- michaelcampbell 16y ago> Objecting to using + or += overloading on strings in Java seems to me to be cutting off your nose to spite your face. Nowhere did I say you shouldn't use them; I said your assertion of "should" was subjective at best and "clever" in a bad way, since you're only using it for the side effect of auto-boxing the int INTO a string; not its intended purpose of concatenating strings. > In Python would you object to nesting "s and 's because it feels hackish? In Lisp would you avoid Macros because they are hackish? In Perl would you avoid regexs because they are hackish? No, because none of them are.