←back to thread

45 points scolby33 | 2 comments | | HN request time: 0.001s | source
Show context
theamk ◴[] No.46195792[source]
Deprecations via warnings don't reliably work anywhere, in general.

If you are a good developer, you'll have extensive unit test coverage and CI. You never see the unit test output (unless they fail) - so warnings go unnoticed.

If you are a bad developer, you have no idea what you are doing and you ignore all warnings unless program crashes.

replies(8): >>46196064 #>>46197215 #>>46203939 #>>46220846 #>>46221176 #>>46221435 #>>46221650 #>>46221723 #
1. optionalsquid ◴[] No.46203939[source]
You can turn warnings into errors with the `-Werror` option. I personally use that in CI runs, along with the `-X dev` option to enable additional runtime checks. Though that wont solve the author's problem, since most Python devs don't use either of those options
replies(1): >>46224327 #
2. Y-bar ◴[] No.46224327[source]
In PHP I don’t think there is a native way to convert E_DEPRECATED into E_ERROR, but the most common testing framework has a quick way of doing the same.

https://docs.phpunit.de/en/12.5/configuration.html#the-failo...