seanmtracey / Games-with-Pygame

The code for my "Making games with PyGame" series for Raspberry Pi's The MagPi.
https://smt.codes/writings
85 stars 71 forks source link

added simplified chaine comparison #12

Closed prisius closed 7 years ago

prisius commented 7 years ago

added simplified chained comparison on line 34 and 36 instead of two conjonction comparison that does the same thing.

seanmtracey commented 7 years ago

Hi @prisius, thanks for your PR. It's always nice to see people taking the time to engage with my work. I am however, not going to accept the PR. Not because it's bad or wrong, but for the following reasons:

  1. Placing this code here on Github is intended as a convenience to people that have read/are reading my book and don't wish to type out all of the examples to learn. As such, with the exception of the odd change to ensure that the code still runs happily on the latest Raspberry Pi, I intend to keep the examples as close to the printed resource as possible, so as to avoid possibly confusing new learners

  2. I deliberately used the and operator because of it's verbosity. Yes, your code snippet and mine do the exact same thing, but I feel that the chained < operators don't read as easily for people who are just beginning with Python and conditional statements. With the conditional as it is, it reads as:

    if blah1 is greater than blah2 AND blah1 is less than blah2 + blah3:
    doTheThing()

    instead of:

    if blah1 is less than blah2 is less than blah1 + blah3:
    doTheThing()

    which I think is tougher to read on a first pass.

Thanks again for your PR. Happy coding :)

prisius commented 7 years ago

Hello,

First of all, sorry for my poor english and thank you for the reply.

I understand your reasons and apologize for the PR. I never recieved a reply of this quality before, thank you again for the time you take to write this email.

I really appreciate the great work you've done. This help me learning pygame from example because i didn't find any other tutorial with this level of explicitation and a shallow learning curve.

If you have time to send me any other link to a book, e-book, tutorial website made by you, i would like to pay and learn for such a great content.

Thank you for everything.

Best regards.

Bardhok AJVAZI

2016-12-07 22:20 GMT+01:00 Sean Tracey notifications@github.com:

Closed #12 https://github.com/seanmtracey/Games-with-Pygame/pull/12.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/seanmtracey/Games-with-Pygame/pull/12#event-885936825, or mute the thread https://github.com/notifications/unsubscribe-auth/AV7NwQviPM1_qQbSj2GfH_bmMmW8b-Q8ks5rFyMwgaJpZM4LDuzD .

seanmtracey commented 7 years ago

Don't apologise! pull requests are what open source software is all about :D

Thanks for your kind words about my work. I'm sorry to say that I don't have any other teaching resources to help you learn at this time, but the rest of the MagPi Essential series is seriously good (and free to read). Here's the list from Raspberry Pi :)