Open mpmc opened 6 years ago
Yeah, I've seen those - whenever I commit code it gets run through code climate
, and I get reports from pylint.
A lot of them are fairly inconsequential - whitespace/blank line errors, multiple statements, lines too long, continuation, etc
I think I set it to ignore 501 (or maybe increased the character limit), 265 & 701 errors and am also ignoring the visual indents.
Feel free to go through and tidy up whitespace, etc - I've run it through tools before that prettify the code, to make it more PEP compatible, but I didn't like the results too much...
OK I'll clean up the little things. Some questions though (hope you don't mind)..
Any reason why you're using bare exceptions? Why not your own subclass? You could just create a basic sub class.
class appJarException(Exception):
pass
Then where you have the bare exceptions you could do.
try:
pass
except appJarException:
# Do something here..
Similarly is there a reason why some python exceptions are just logged & not raised (missing methods for example)?
Sorry, this is me picking your brain, not trying to tell you "how to suck eggs".
Hi @mpmc - good questions...
In the early days, it was useful to have the GUI run, with bits missing and warning messages - a 12 year-old is much less likely to persevere when their program keeps crashing with cryptic error messages - Python's exception messages are generally horrible, and hard for for younger kids to handle.
So, kids would see a GUI pop-up, with some bits working, and would get much friendlier messages on how to fix the bits that were missing.
The exceptions could have been done better - I implemented a couple of my own exceptions, that do get raised in certain scenarios, but I think, over time things have gotten a bit muddled, and there is a lack of consistency in this area.
I do also, at times, get frustrated with the way appJar handles function calls to unknown functions - as it can result in cryptic messages, when expected return objects are replaced with a function and it all breaks down.
I think this area could do with a bit of a rethink, and refactoring to make it more consistent...
In the early days, it was useful to have the GUI run, with bits missing and warning messages - a 12 year-old is much less likely to persevere when their program keeps crashing with cryptic error messages
I don't think this applies just to 12 year olds. I think most people would give up too.
Python's exception messages are generally horrible, and hard for for younger kids to handle.
If you think Python's error messages are horrible, PHP's can be worse!
At first Python's error messages were very cryptic to me too, but once you see them a few times you figure out where you're going wrong & you stop making the mistakes.
So, kids would see a GUI pop-up, with some bits working, and would get much friendlier messages on how to fix the bits that were missing.
It's very good for people that are just starting but (IMO) it means they become reliant on the code to save them from mistakes.
The exceptions could have been done better - I implemented a couple of my own exceptions, that do get raised in certain scenarios, but I think, over time things have gotten a bit muddled, and there is a lack of consistency in this area.
I think if you implemented your own exceptions you could have the option of showing both friendly messages and/or Python's own.
Another random question, with Python2 pretty much dying do you plan on writing a Python3 only version?
I've ran appJar.py through pylint and it has raised some issues. All of these are listed below. If wanted I can go through and correct them :)