This is a question for people more experienced with Python, but everybody feel free to answer if you feel like you can provide something decent to the discussion.

Also feel free to explain why you feel that way and your experiences with Python and the paradigms.

  • Corbin@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 months ago

    In terms of the standard principal programming paradigms, Python is on the right-hand side in the “Shared state” column. Note two interesting things: first, Python’s box is represented by Java and OCaml; second, the box has two labels, “Sequential object-oriented programming” and “Stateful functional programming”. Python is technically a prototype-based language like ECMAScript, but it can be seen as either object-oriented or functional depending on whether we think of prototypes as classes or closures respectively.

    Note that unlike “Imperative programming”, represented by Pascal and C, Python has closures. It does have closure quirk, also called lambda quirk, which ruins an otherwise-lexically-scoped language, but folks with lots of Python experience are used to working around closure quirk. Python functions are not procedures; they are sugar for objects with a .__call__() method.

    If this is your first time with the principal paradigms, please keep in mind the following quotes. First, from the associated book:

    More is not better or worse than less, just different.

    That is, Turing-completeness doesn’t have a canonical set of computational features. Second, from the chart PDF:

    Two languages that implement the same paradigm can nevertheless have very different “flavors” for the programmer, because they make different choices on what programming techniques and styles to facilitate.

  • bluGill@fedia.io
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    The question is invalid!

    Write the code that makes sense for your problem. This is not religion where choosing the wrong thing can land you in hell for eternity or whatever it is your gods will do if they don’t like you. You should be mixing OO, functional, and procedural code all the time as each does some things well and some things poorly. Of course don’t create a mess by the mix, but good code has a need for all 3 styles. (IIRC there are more styles the good code needs, but I can’t think of what it might be at the moment)

    • I love the almost spiritual nature of software development. It sounds crazy but the best devs I have ever worked with all immediately understood this perspective or had their own version of it.

      The way we have these three categories of programming styles… off in one rhetorical direction, we see millions of little threads, innumerable individual languages, syntaxes, little styles… in the other direction? A monadic unity. All three categories are programming languages, which are just… forms of communication… which is just, well, shifting values of information. And that? Information? Formally it’s the potential for data but philosophically it is the noumena itself. The information world and the real world are one in the same.

      I think people who are under the false impression that “everything has already been discovered” are so unfortunately blind to the beautiful world we have been endowed to discover, especially in contemporary times.

        • yeah that’s definitely the boldest claim made in the OP comment. was surprised to see it hang out unchallenged for so long.

          there’s been a growing trend to assign ontological primacy to information over mass/energy/space/etc. it’s a hot point for debate in computer science and physics research because, as my Kantian diction was kind of intended to imply: we can’t really empirically verify any ontological theories we have so we end up arguing over things that seem semantic from the outside in.

          that means that, at least for now, “information is the noumena” is a matter of opinion. i just have strong, albeit potentially misplaced feelings - that mass, energy, and information are all different expressions of the same substrate that builds reality itself and that there is an undiscovered mechanic governing all three in a self-consistent manner.

  • Kairos@lemmy.today
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    7 months ago

    Neither: it’s a piece of shit.

    If I had a gun to my head and had to answer, it’d be procedural because scopes are a lie in this language.