![]() ![]() If I have to review and test every "a = b + c" exhaustively, my program will never make it to production, which if the program is written in Python, might actually be a good thing. One of the values of a good programming language is that you don't have to review and test every possible permutation of bits in memory because it guarantees that a large amount of these permutations cannot happen. The fact that it is theoretically possible to look at every line and test every input and every scenario does not mean that this is practically possible. There will be Python defenders that will say that this is not a deficiency of the language but of the code reviewing and testing strategy. I have on many occasions launched new versions of a big Python application in production, only to immediately drown in errors, caused by exceptions that were in turn caused by Python code where a single glance confirmed that it could never ever work and consequently had never been run: Not on a developer workstation, not in a unit test, and not in an integration test. In one instances, some years ago, I managed to convince our organization to rewrite our system in Rust. Through my years supporting large Python applications I have seen and experienced horrors that would not have happened had our application been written in a sane, compiled, and type safe language. Worse, Python's duck typing invites smart but terrible code that inevitably comes round and bites us in the ass. That means that we need to have the discipline to check all the input data exhaustively, which history shows we are not very good at. Typically when writing a function you are only partially in control of the data that goes into that function. The problem with Python is of course that it is an interpreted language with dynamic and duck typing : We type in some code, save it, and then only find out at runtime whether a group of statements always works, sometimes works, or does not work at all, based on the data that we put into it. Really the only thing to do is to encapsulate the reactor in concrete, let it cool down, and build a new one from proper building materials. ![]() Instead people stick on new bricks all over the place to keep the thing going. ![]() But now the reactor has been running for a while and we have radiation leaks everywhere and nobody dares touch anything. Using Python for a large application is like building a nuclear reactor using Lego bricks: Yes it has bright colors and it was really simple to get started. I base my fairly harsh judgment on many years of experience running large applications written in Python. However, the ongoing popularity of Python is a problem and one that sets our industry back years for every year of its continuing use. I would have to agree with the author of the post, though grudgingly, that Python is super popular and that good knowledge of Python will help you get a job. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |