Is there a need for a “use strict” Python compiler?

后端 未结 10 2226
眼角桃花
眼角桃花 2021-02-03 21:26

There exist static analysis tools for Python, but compile time checks tend to be diametrically opposed to the run-time binding philosophy that Python embraces. It\'s possibl

10条回答
  •  无人共我
    2021-02-03 22:20

    It is very difficult to write large programs without 'use strict' in Perl. Without 'use strict', if you use a variable again, and misspell it by leaving a letter out, the program still runs. And without test cases to check your results, you can never find such errors. It can be very time-consuming to find why you are getting wrong results due to this reason.

    Some of my Perl programs consist of 5,000 lines to 10,000 lines of code broken into dozens of modules. One cannot really do production programming without 'use strict'. I would never allow production code to be installed in the factory with languages that do not enforce "variable declarations".

    This is why Perl 5.12.x now has the 'use strict' as the default behavior. You can turn them off.

    PHP has given me quite a few problems because of no variable declaration enforcement. So you need to limit yourself to small programs with this language.

    Just an opinion ...

    abcParsing

提交回复
热议问题