5 Good Python Practices

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 31

  • @LucaCappelletta
    @LucaCappelletta 2 місяці тому +14

    Comments should describe why something has been done, not what has been done. Using expressive names for variables, functions, classes, etc and some experience it is possible to do so.
    A comment saying that a .split() splits a string is literally redundant

  • @softwareengineer8923
    @softwareengineer8923 Місяць тому +3

    Such a useful and well detailed video, it has been a lovely recap. Thanks a lot👍

  • @cgarzs
    @cgarzs 10 днів тому +1

    11:48 "mo comments mo better" all while a screenshot here would be exactly the kind of example the "good code is it's own comments" crowd would counter with 😂

  • @DrDeuteron
    @DrDeuteron 2 місяці тому +3

    A comment on the comment section, unrelated to comments: it's pythonic to practice EAFP, while you implement LBYL!
    What that means is that you would unpack the split string straight into a dict, and don't even have "parts"--which is whole reason you need comment--and that would be in a try/except block for when you didn't look before you leapt.

  • @JHatLpool
    @JHatLpool Місяць тому

    Nice, clear demonstrations and explanations.

  • @sdmagic
    @sdmagic Місяць тому

    Nicely done. Thanks!

  • @higiniofuentes2551
    @higiniofuentes2551 Місяць тому

    Thank you for this very useful video!

  • @guihprado3366
    @guihprado3366 2 місяці тому +1

    Awesome content as always 👏🏻

  • @higiniofuentes2551
    @higiniofuentes2551 Місяць тому

    What I found with the new developers is they put names as the same of the function and the same for external variables:
    name(name:name).
    And they love to use the name name, and data everywhere!

  • @Unknown_User12679
    @Unknown_User12679 2 місяці тому

    great explanation 🎉

  • @bigpapa21tx1
    @bigpapa21tx1 Місяць тому

    parse_date variable and comment of expecting d / m / y as input would be the better approach. Everything else seems pretty straightforward

  • @dipeshsamrawat7957
    @dipeshsamrawat7957 2 місяці тому

    Thank you 😊

  • @piedepew
    @piedepew 2 місяці тому +3

    Practices

  • @gardnmi
    @gardnmi 2 місяці тому +1

    this_is_redundant: bool = True

  • @sri_harsha_dv
    @sri_harsha_dv 2 місяці тому

    16:18 Why doesn't "type" show while hovering but it was included in the docstring?

  • @SilasDuarte-e9k
    @SilasDuarte-e9k 2 місяці тому +2

    # Code with comments > code with ugly_af_long_variable_names

  • @gio-j3d
    @gio-j3d 2 місяці тому +2

    pls explain requests libery

  • @TheBlueboyRuhan
    @TheBlueboyRuhan 2 місяці тому +15

    does it jiggle

  • @nickfg5190
    @nickfg5190 2 місяці тому +1

    18% GST on payment getways, if we use card sir, visa ke din gaye kay?

  • @Otherfox-be9up
    @Otherfox-be9up Місяць тому

    Simple: don't

  • @akcelero
    @akcelero 2 місяці тому

    hey hey, great material, keep that up!
    just wanted to share with you @idently potential topic for upcoming video: `__init_subclass__`
    recently I bumped into problem which I solved by this method so maybe other devs will found it useful

  • @FrankONeill-v3l
    @FrankONeill-v3l 2 місяці тому +1

    Python I want to love you. But so many times I find myself trapped in dependency hell attempting to make some linguistic sense out of the heap of semantic rubbish you spout so copiously onto the screen. Your package managers number greatly yet each only further confounds with idiomatic complexities and confused functionality. Your syntax proves often counter intuitive and brutally unforgiving with error messages that provoke my laughter at the very insanity of any further attempts resolve the issue. Most notably I scoff at that most frequent objection you give in stating that the poetry I write abuses the emptiness of whitespace and I laugh at your ignorance of the likes of E.E. Cummings and find your makers to be flawed as individuals given the grave handicap they imparted to you of uneducated 'tardness. So back I go to my tried and true love of PERL and I swear to one day become a greater poet true who can wield the more sophisticated expressions the elite of intelligentsia use in Raku.
    F.

  • @FrankONeill-v3l
    @FrankONeill-v3l 2 місяці тому +1

    Python is the most blue-collar and crude of scripts and languages. Use it like you would a toilet plunger yet beware the mess it so easily might make. Not a language conducive to sophisticated or elegant or creative expressions.