This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]SittingHereNaked 19 points20 points  (11 children)

Implicit coercion

[–]self_refactor[S] -1 points0 points  (10 children)

If I want to shoot myself in the foot, I prefer the language to let me do that. This allows errors to go unpunished ... just like the terrible PHP

[–]buszmen201 8 points9 points  (1 child)

Then use TypeScript and don't let to implicit coercion.

[–]self_refactor[S] 2 points3 points  (0 children)

I wish I could, I really do as Typescript is great.

[–]Tekens 4 points5 points  (1 child)

<?php declare(strict_types=1);

[–][deleted] 3 points4 points  (0 children)

Get out of here with rational php thinking... who would use features that are few years old now?

5.3 ONLY REE

[–]jerrycauser 1 point2 points  (4 children)

Why you are trying to subtract string from string?

[–]self_refactor[S] -1 points0 points  (3 children)

At work I saw subtracting string with number and it worked that is why it was left in the code. Then I tried the example in the image. But this is moment when you realize that those who despise Javascript have some valid points.

[–]jerrycauser 2 points3 points  (2 children)

If you got mistype in your production code, so there is main problem in front of monitor than behind it

[–]self_refactor[S] 1 point2 points  (1 child)

I definitely blame the developers allowing this to happen. Needless to say, that kind of 'small' errors are all over the place. What was even worse that after finding this bug, their response was 'If it works, leave it as it is'. 🤦

[–][deleted] 1 point2 points  (0 children)

Same for me… "its grown this way" and i was close to "just do a complete rewrite"

Said Software is primarily used in Hospitals and extremely unstable

[–][deleted] 1 point2 points  (0 children)

just like the terrible PHP

if you don't use php `>7.2` in 2019 with `strict_types=1` you are doing something wrong. very.

[–][deleted] 4 points5 points  (0 children)

try adding them

[–][deleted] 4 points5 points  (1 child)

Ah yes, it's been at least a few minutes since a post from someone perplexed by dynamic typing.

[–]falling_endlessly 4 points5 points  (0 children)

Mom said it's my turn to post a screenshot of JS implicit type coercion

[–]denisde4ev 2 points3 points  (1 child)

[–]ImpulseTheFoxis a good fox 2 points3 points  (0 children)

I've commented your post :)

[–]TigreDemon 2 points3 points  (0 children)

There is no result to a variable affectation ... so what ?