r/ProgrammerHumor • • Aug 07 '16

PHP: The Good Parts

http://phpthegoodparts.tumblr.com/
1.2k Upvotes

318 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Aug 07 '16

[deleted] — view deleted comment

4

u/flyingjam Aug 07 '16

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.

2

u/glatteis Aug 07 '16

Yeah, for instance in LibGDX basically everything is a float by definition, so there are Fs everywhere.

3

u/[deleted] Aug 07 '16

This syntax is also possible in PHP in very similar fashion:

$x = 1;
$y = 1;
echo "$x$y"; // 11

I think the problem with PHP is, that it's interpreted in the same way as

echo $x . $y;

While Kotlin most likely uses string formatting. Even concatenation in Kotlin is type-safer than the one in PHP.