Greg Ward - How to Write Reusable Code - PyCon 2015

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

ความคิดเห็น • 20

  • @DetectivePoofPoof
    @DetectivePoofPoof 8 ปีที่แล้ว +5

    Very nice and straightforward talk. He gave some sensible advice that can apply to any language.

  • @AnunayaSrivastava
    @AnunayaSrivastava 4 ปีที่แล้ว +2

    Great talk! A gem even after 4 years.

  • @drygordspellweaver8761
    @drygordspellweaver8761 2 ปีที่แล้ว

    Nice I was literally just starting with my own use case before expanding it into a library. I think iterative Development is the best way.

  • @cheaterman49
    @cheaterman49 4 ปีที่แล้ว +1

    I think writing tests AND documentation first is in fact a good way to do things. First, it's too painful to write everything at the end. Second, when the code is both being described by text and used by tests, it makes you think better about how to structure it, what are the limits/edge-cases, etc. As mentioned in the talk - if the "function that also has side-effects" has documentation highlighting that fact, it'll be easier to spot and refactor, either right now or later. And if you have a test harness, you can refactor it safely without the risk of breaking anything.

    • @anatolyalekseev101
      @anatolyalekseev101 2 ปีที่แล้ว

      hah yes "writing tests AND documentation first" and then using copilot will probably save a lot of efforts )

  • @TomasSandven
    @TomasSandven 3 ปีที่แล้ว +1

    I wonder what they did with the video to make it look like it was recorded in the early 90s

  • @drd105
    @drd105 8 ปีที่แล้ว +1

    A few points:
    - Top level overview is really good.
    - It's questionable whether his bullet point 3 is really a good advice. There is a reason why most mainstream languages have removed the distinction between functions and procedures. Many times you want to know the effect that a procedure had. And the "anti-pattern 3" does just that. The example which he actually gave from a code review is exactly what defaultdict or setdefault() do in Python. And not using them is considered an anti-pattern in Python. In fact, making print a function instead of a statement moves away from this paradigm (and was actually *the* bad idea imho of Python 3).
    - Frameworks (and their popularity) seem to be designed with mind-capture as their purpose. When everything is free, the only way to make money is to become indispensable for as many people as possible with the hope of getting money in the future from someone who wants to capture your user base.

  • @toshobg
    @toshobg 8 ปีที่แล้ว +15

    this guy remind me of Phil Dunphy from Modern Family

    • @deekay9213
      @deekay9213 4 ปีที่แล้ว

      I am hip, I surf the web, I text

    • @toshobg
      @toshobg 4 ปีที่แล้ว

      @@deekay9213 What ?

  • @anatolyalekseev101
    @anatolyalekseev101 2 ปีที่แล้ว

    I agree on all the points except one: I prefer to make EVERY code, with exclusion of the most application-specific maybe, a part of my own library, to never have to write it second time (DRY principle at work). I would also give more attention to careful designing of public entrypoints parameter types and names, using SOLID, but author thinks it's more extensibility than reusability.

  • @dmsalomon
    @dmsalomon 2 ปีที่แล้ว

    One of the talk that I actually find myself disagreeing with quite a bit. A lot of this comes across as opinion and not necessarily fact

  • @dom1310df
    @dom1310df 4 ปีที่แล้ว +2

    I read a lot of other peoples' code. Most of it is garbage and written by people whose return key seems to be broken.

  • @michaw7408
    @michaw7408 10 หลายเดือนก่อน

    "Do not learn to code from Google" - but why??

  • @cryp0g00n4
    @cryp0g00n4 4 ปีที่แล้ว +3

    maybe I'm just lousy as a programmer but didn't feel like this talk was useful...

    • @bertrodgers2420
      @bertrodgers2420 2 ปีที่แล้ว

      once you work on a large project with silly patterns (ab)used all over the place, you'll realise how important talks like this are and how essential simple limited side-effect code can be

  • @rafehqazi8539
    @rafehqazi8539 9 ปีที่แล้ว +3

    Woah, first to comment!

  • @legion_prex3650
    @legion_prex3650 2 ปีที่แล้ว

    I have to be honest, most of the talks at the pycons are just blunt, obvious stuff for me as an advanced programmers. Who is listening to those platitudes? Are those talks just for beginners who never wrote a line of code before? Just wonder.

    • @Ca1vema
      @Ca1vema ปีที่แล้ว

      There are people transitioning from other languages. My colleague is a whale with decades of programming in C/C++ and he writes all his python code like it's c, no classes, no interfaces, 1k line funcions, and I believe such videos are great help for everyone.

  • @EvenStarLoveAnanda
    @EvenStarLoveAnanda 2 ปีที่แล้ว

    OMG, he does not know about extensible code......?
    What are browser extensions?
    What are add-ons?
    What are plug-ins?
    Completely useless talk.