3 ms·
A) Not your job to police this site, B) just because your feelings were somehow hurt about code you didn't even write, doesn't actually mean I violated commenti
by diminoten 7y ago
A) Not your job to police this site, B) just because your feelings were somehow hurt about code you didn't even write, doesn't actually mean I violated commenting guidelines, and C) maybe you ought to read the guidelines yourself, considering one of them specifically says not to comment when you think a post is inappropriate.
You want a "good critical comment"? Here:
* Try breaking your code up into more than one file. There are other/better ways of releasing Python besides "one file".
* Lay off the code commenting, it's vastly overdone here.
* Use version control tools to version your code, not comments.
* Python convention is to use underscore_case, not camelCase.
* Variable/function/class names should be descriptive, not random letters/numbers/incomprehensible abbreviations.
* Delete commented out code -- it's stored in version control, you're not going to lose it.
* The "initialize" func is a terrible concept and represents a fundamental misunderstanding of how Python classes work. This whole misadventure is a cautionary tale in, "Why a light architecture pass matters even in 'throwaway' scripts."
* Add tests.
* The massive if/else chains can be replaced in a number of different, more readable and therefore superior, ways.
That's some of what I saw in 2 minutes of review. This code is in very poor condition, and if you think the state of this code is an indictment on how hard it is to convert python from 2 to 3, you're more than just a little mistaken. You would need to pay me substantial amounts of money to spend more of my time going deeper into what's wrong with this code, as there is a lot and it is not generally enjoyable to work with code so thoroughly broken as this.
The script (somehow) works. That matters. However, this is not a good representation of why migrating from Python2 to Python3 is hard; this code is in no shape to be used to represent anything other than how not to write Python.