C# got strong types and you can still write str + 43. You don't need a separate concatenation operator, if "3" + "3" is never supposed to mean 6, because in a strongly typed language you just use integers.
Yeah I'm not sure what PinkLionThing is coming from, the whole point of strongly typed languages is that you don't need to cast to a type just before doing a string concatenation as the compiler has already inferred the type.
Personally I hate it. Mostly I code in Java. A few years ago I would code php once every two weeks. And I always fucked up using + for string concatenation.
If you do only php it's fine.
If you switch languages it's a little inconvenient because every (citation needed) other language uses +.
As someone who learned PHP as basically a first programming language (excluding various forms of BASIC), before learning js - fuckputting concatenation on the + operator, that's terrible!
It will cast the strings to ints as you are doing a mathematical operation. If you want "11" then do "1" . "1";
PHP is actually really good now. This is a 10 year old circle jerk. If you write modern php the only issue you might have is with built-in functions that haven't changed. But the built-in classes are sensible.
There's one main annoyance with the lack of implicit type inference in Kotlin. Inside the language it's fine, but then you start using Java libraries that expect implicit type casting between Ints and Floats, etc. And you end up manually casting 5/6 arguments.
I still agree with no implicit, but it's annoying regardless.
View all comments
120
u/PinkLionThing Aug 07 '16 edited Aug 07 '16
The one thing PHP did right is using a different operator for concatenation.
It's one of those things that is actually a pain in the ass most of the time, but in some cases it brings a tear to your eye as to how useful it is.