Live Code Review | Faker

Поделиться
HTML-код
  • Опубликовано: 27 сен 2024
  • This is a new series called “Under the Hood." In this live stream, I'll dive into the code and design of an open-source project together with you. This is going to be completely unscripted, so you'll see my real-time reactions to the code and how it’s been designed.
    In this episode, I looked at the Faker package: github.com/jok....

Комментарии • 58

  • @ArjanCodes
    @ArjanCodes  3 месяца назад +12

    Ahhh sorry... I totally forgot to give the package a grade at the end! So: I'd give this a 6/10. There's a good attempt at trying to separate generating the various types of data. However, the design heavily relies on object-oriented programming, it does counterintuitive things with module imports, and the proxy class solution is messy in my opinion - that needs a redesign. What are your thoughts? Do you agree?
    Also: let me know in the comments if you'd like me to do another session like this or not!

    • @jeremy-mathieumartin3086
      @jeremy-mathieumartin3086 3 месяца назад

      An inituive comment for me to avoid coupling is to use a base class that accept some args (as locals and providers needed). Then you can use some factories and mapped functions to generate the random address, bank_account, etc. And if we want add some providers or functions to generate them, we modify the factory as well. What do you think ?

    • @fluffykitties9020
      @fluffykitties9020 3 месяца назад +2

      Could you give a few examples of VERY GOOD modules that you've come across, ones that you would give a grade of 10/10? That would make a great video, by the way, explaining like you did in the comment above why you like it.
      In a separate video you could do the opposite, "worst 5 Pyyhon libraries".

    • @franktewierikholscher
      @franktewierikholscher 3 месяца назад

      It was really interesting. I was not present during the live, so I had to look at it later. it was a little boring. I liked the way you picked a random envelope and that in one hour you detect a big problem. But as I said it was going to slow. I had a problem with staying with you.

    • @michakacprzak8984
      @michakacprzak8984 3 месяца назад +3

      Amazing video but it would be great to see examples of libraries with great desgin with higher score

  • @tannerbobanner9453
    @tannerbobanner9453 3 месяца назад +15

    Great video! One thing that I'd mention is that many of us open-source library developers try to build our code to support all currently supported Python versions (I.e. those that haven't reached end-of-life). Currently, this is 3.8+, meaning we don't yet have access to the parameterized generics on builtins like list, which is why we import parameterized versions from the typing module. Once 3.8 reaches EOL, we won't need to import those anymore, and once 3.9 reaches EOL, we will be able to use the union shorthand (X | Y).

    • @ArjanCodes
      @ArjanCodes  3 месяца назад +3

      Very good points! That is definitely a good reason to stick with the older type annotation objects.

    • @AloisMahdal
      @AloisMahdal 3 месяца назад

      Good point. On the other hand, there can be cases when it's enough to run static analysis only using one of newer mypy+python, right? (This argument probably breaks down as the project has more dependencies, since with older Python versions come older versions of your project dependencies, which might not be 100% compatible so it might still be worth to run mypy with all supported environments as well.)

    • @tannerbobanner9453
      @tannerbobanner9453 3 месяца назад

      @@AloisMahdal Not really. The pre-3.9 builtins don't accept parameterization, so attempting to do so will cause runtime errors, as annotations exist at runtime. You could of course not include the type annotations at all, but then static type analysis would not be possible. Another option would be to maintain different versions (one with annotations, one without) for post-3.8 and pre-3.9 respectively, but we generally don't do that as it adds complexity, and having a version without strong typing is not ideal (strong type hinting is very useful for the end user, so we try to use type hints anywhere and everywhere). Realistically, the only option is to use the parameterized versions from the typing module if you want to support 3.8 with the parameterized builtins.

  • @cheweh842
    @cheweh842 3 месяца назад +10

    This was great. Hearing unedited code review feels more authentic and clicks more for me than hearing the same from a polished, edited video.

    • @ArjanCodes
      @ArjanCodes  3 месяца назад +1

      Glad you enjoyed it!

  • @sassydesi7913
    @sassydesi7913 3 месяца назад +2

    This is great, Arjan!! Awesome resource for beginners and experts alike.
    Please make more of these, and preferrably put them under the Playlist 'Under the hood'.

  • @MailForEric
    @MailForEric 3 месяца назад +2

    Yes, do more of these. I liked hearing your unfiltered walkthrough of a Python library. I have 10+ years of experience in Python development and now run a dev team. It's always nice to hear other experienced coders review things. Note for improvement: Your microphone picked up bumps and noises when you hit the desk or your clothes moved.

    • @ArjanCodes
      @ArjanCodes  3 месяца назад

      Thanks for the feedback! :)

  • @cetilly
    @cetilly 3 месяца назад +2

    I love this idea. I would like to see you start with an example of using the library first to help provide context. But definitely want to see you dive into some complex libraries which make no sense to me.

  • @emiliopiotto556
    @emiliopiotto556 3 месяца назад

    Thanks Arjan! one thing I struggle with is arriving at a new project and trying to understand it from scratch. This kind of videos are the only ones that help me practice that skill. Watching your thought process is really valuable.
    Please keep going with your videos, you are my #1 source of learning for programming, and I really enjoy them. Kudos

    • @ArjanCodes
      @ArjanCodes  3 месяца назад +1

      Thank you so much Emilio!

  • @havenisse2009
    @havenisse2009 3 месяца назад +3

    Faker() works - but you are right, it's confusing. It would be interesting if you could rewrite a skeleton of Faker "done right", maybe with 1 or 2 providers each having a few functions.

  • @DanielRodriguez-lu3uu
    @DanielRodriguez-lu3uu 2 месяца назад

    That was a brilliant idea to dive into one of those open source projects. It would be even nicer if you could create a simple package an publish it so we can learn how to start contributing to the open source community. Doesn't need to be anything fancy. Thanks again for your grate content.

  • @amazing-graceolutomilayo5041
    @amazing-graceolutomilayo5041 Месяц назад

    I’m 2 minutes in and I have to say this was such a brilliant idea.
    If I could give you a million subs now, I would!

  • @jakubzbroda
    @jakubzbroda 3 месяца назад

    That was very interesting to watch you in action and seeing whats your train of thought, I like the format!

    • @ArjanCodes
      @ArjanCodes  3 месяца назад

      Glad you enjoyed it, Jakub!

  • @trueboubou5936
    @trueboubou5936 3 месяца назад

    I like the format! Studying other peoples code is really a great way to learn :)

  • @michaelmarinos
    @michaelmarinos Месяц назад

    Love the idea of randomly reviewing a python pacakge. May i propose taking it a step further by cloning the repo, running tests, and exploring how you might contribute? From simple steps, like reading the CONTRIBUTING.rst file to more advanced like making a pull request. Thank you!

  • @АндрійПрус-й8м
    @АндрійПрус-й8м 3 месяца назад

    Like this deep dive session, regred that haven't participated it. Awesome idea🎉

  • @matteorenoldi1865
    @matteorenoldi1865 3 месяца назад +1

    Very interesting! I would like to know more about the approach of using an external database like SQLite or DuckDB to store the info about the Dutch cities - for example - and how these can be later used in the code

  • @maleldil1
    @maleldil1 3 месяца назад +2

    38:07 You absolutely _do not_ need to duplicate type annotations for package users to get them. Instead, you only have to create an empty py.typed file in the package root, and type checkers will pick that up. .pyi files are only to be used by packages that don't want to add type hints in the code itself.

    • @ArjanCodes
      @ArjanCodes  3 месяца назад

      Good to know, thanks!

    • @maleldil1
      @maleldil1 3 месяца назад

      For more information, see PEP 561.

  • @jlmaturanag
    @jlmaturanag 2 месяца назад

    -Every test function has to have only one assert. Why is hard to see which assert is failing?

  • @imaderraiss1609
    @imaderraiss1609 3 месяца назад

    omg i was waiting for something like this

  • @VaibhavSharma-zj4gk
    @VaibhavSharma-zj4gk 14 дней назад

    Thank you I think this is going to be very helpful

  • @franktewierikholscher
    @franktewierikholscher 3 месяца назад

    I think Typing and abc's aren't used because the oldest code is already very old and way back then they weren't so common jet.

  • @mmilerngruppe
    @mmilerngruppe 3 месяца назад

    42:30 what's the point for stub files? Is this yet another silly idea to put more C header files stuff into python?

  • @Slimshady68356
    @Slimshady68356 3 месяца назад

    In your next video ,can you do for langchain I hear people say it is complex source code ,I want to hear your views on it

  • @nathanielswanson5730
    @nathanielswanson5730 3 месяца назад +1

    Sound in this video is not good. There is a deep sound that sounds like someone is hitting the mic.

    • @ArjanCodes
      @ArjanCodes  3 месяца назад +1

      I think I know what the problem with the sound was, I’ll fix that for next time.

    • @nathanielswanson5730
      @nathanielswanson5730 3 месяца назад

      @@ArjanCodes Thanks! And thanks for all the great training!

  • @VolodymyrMoon
    @VolodymyrMoon 3 месяца назад

    Good one, thanks

  • @Gigusx
    @Gigusx 3 месяца назад +2

    Haven't watched yet, but just based on the description - very cool idea! I always enjoy your content on this sort of thing. Looking forward to watching this one :)

  • @RealEstate3D
    @RealEstate3D 3 месяца назад

    An important use case is to replace PII in documents before uploading to AI APIs.

  • @ramimashalfontenla1312
    @ramimashalfontenla1312 3 месяца назад

    Library Roast!! Love this idea!

  • @papeya
    @papeya Месяц назад

    This is such a neat idea of a video format! I learned so much from it, really helped me to bring some concepts together that I learned in your videos. Hope to see more of those :)

    • @ArjanCodes
      @ArjanCodes  Месяц назад

      Stay tuned, I’m doing another one very soon.

  • @juanpgp680
    @juanpgp680 Месяц назад

    Great initiative. Thanks for starting this! One of the best ways to learn :)

    • @ArjanCodes
      @ArjanCodes  Месяц назад +1

      Thanks, the next episode will come soon ☺️.

  • @VikiSil
    @VikiSil 3 месяца назад

    When I saw the video title I thought it will be about impostor syndrome, as in "everyone sometimes feels like under the hood they are a faker". So glad it was not that. And great tips, thank you, this lib will come in useful on my next project.

  • @stanislavzamecnik3049
    @stanislavzamecnik3049 3 месяца назад

    This was great!

    • @ArjanCodes
      @ArjanCodes  3 месяца назад

      Glad you liked it, Stanislav!

  • @lysacreationschavula8605
    @lysacreationschavula8605 3 месяца назад

    Wow, do more of these please