fennell.dev is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

Search results for tag #python

Bradley M. Kühn »
@bkuhn@fedi.copyleft.org

I'm an 👴 so I know C & Perl at an expert level. I'm solid in , , , and (but slow b/c I must look up details on standard APIs, etc.). I'm learning , knew once upon a time, & dabbled in . I also know (of all things!).

I'm doing a medium text-processing/sqlite-db-update system. I'm still convinced that if you've gobs of wonky-formatted text flying at you, is still the right choice.

But I'm open-minded.

    Bradley M. Kühn »
    @bkuhn@fedi.copyleft.org

    @keithzg

    This is very plausible theory. Despite Python being the perennial counter example used by haters, I just noted elsewhere in the thread I'm de-facto maintainer of a Python system that feels a bit "write once, read never" to me because it overuses esoteric Python language features.

    There are dozens of ways (some well motivated!) a programmer can write software that no one (even themself) can maintain!

    Cc: @cdonat @barubary

      Bradley M. Kühn »
      @bkuhn@fedi.copyleft.org

      Fascinating analysis, @valhalla. I have spent my career (since I did graduate school in programming language internals) focused on the (false) interpreter/compiler dichotomy as a question of what the language *implementation* looked like.

      I've never considered the question from essential a UI perspective — as your “REPL” test does. 🤔

      @barubary's point that gdb could well be considered a REPL for C/C++ is also fascinating.

      Cc: @gwadej @elricofmelnibone

        Bradley M. Kühn »
        @bkuhn@fedi.copyleft.org

        @lazyb0y

        Esp. w/ LLM-gen-AI , I've seen horrendously poor code written in every language that I know.

        I'm de-facto maintainer of a system rn written that overuses so many esoteric features that folks who write Python *daily* reviewed & told me it's hard to maintain b/c it's “too clever for its own good”.

        Every proglang has its own way to create “write once, read never” code. , C, & C++ do require extra human discipline to avoid that.

        Cc: @cdonat @barubary

          Bradley M. Kühn »
          @bkuhn@fedi.copyleft.org

          @barubary

          This meme originated from & enthusiasts in late 1990s when 's popularity outranked both of them.

          I speculate the meme persists from non-polygots who are annoyed (or even insecure) that they can't fix code in any language that is presented to them.

          Obvious answer to @cdonat's troll is Perl is one of a few languages that has effectively its own DSLs built in.

          I remain fascinated at the need snobs have to denigrate other people's work.🤷

            𝓒𝓱𝓻𝓲𝓼𝓽𝓸𝓯 𝓓𝓸𝓷𝓪𝓽 »
            @cdonat@hostsharing.coop

            @bkuhn @Sdowney

            Hm, you want to get away from messy sh/awk/sed, but chose a language, that you yourself consider an almost-drop-in-replacement. How's that going to work out?

            Back in the days I wrote medium sized applications in Perl: ~10k lines. I used to joke, that the only issue was, I couldn't read them. There is a reason, Perl is considered a "write-only-language" as soon as more than one developer is involved.

              Bradley M. Kühn »
              @bkuhn@fedi.copyleft.org

              @gwadej

              I did not go to the YAPC::NA that was in Houston. ISTR my last YAPC was in 2002, maybe?

              will always be special to me as a FOSS activist because — while the 1992–2002 Perl community *definitely* had serious toxicity problems — I learned there what community was about, and how could make & usage of software egalitarian.

              Fascinatingly, I later hung out in the community, & it was much less software-freedom-oriented than Perl's community.

                Bradley M. Kühn »
                @bkuhn@fedi.copyleft.org

                @gwadej

                I have the same approach; I suspect we're the same age and era of computing so not surprising. But I generally stay really open-minded that new Perl code might be a Bad Idea™, which is why I started this thread.

                I really don't think the small-to-medium system I'm working on this weekend would make sense to write in or . @paulv kinda did convinced me that *if* I had time to learn well before the deliverable is due, it'd be a better choice.

                Cc: @elricofmelnibone

                  Bradley M. Kühn »
                  @bkuhn@fedi.copyleft.org

                  @elricofmelnibone

                  I still use command-line compositions with cat and `[ef]?grep`, but anywhere `sed` or `awk` would go, I use `perl -[pn]e` instead.

                  I agree with awk++ analysis of Perl: it remains *at least that*, which is why I believe it has value. Some of the language-bias content in this thread willfully ignores this point: even if was once held up as a direct competitor to , , &/or , there is also language evolution of purposes. (cf: again).

                    Bradley M. Kühn »
                    @bkuhn@fedi.copyleft.org

                    @Sdowney

                    I think the fact that continued, current, regular usage sh/awk/sed indicates that there is value in Perl, *even if* only to show a more comprehensive & less messy way to do what is available in sh/awk/sed.

                    I find there is always a point in shell scripting where everything gets so much easier if you just make it a 250-line Perl script instead.

                    Python and Go *cannot* almost-drop-in-replace sh/awk/sed like that. I don't know any language but that can!

                      Bradley M. Kühn »
                      @bkuhn@fedi.copyleft.org

                      @hyblon
                      The joke is painfully apt. *Many* people use LLM-gen-AI to take software from their most hated programming language into their favorite — just 'cause. It's .

                      I've tried this with (well written) code to , & I definitely got out when the work is human-unattended.

                      LLM-gen-AI can *help* a human do translations tasks, of course, but the temptation to “never look at code not in my favorite language since I have LLM-gen-AI” is dangerous.

                      Cc: @bignose

                        4 ★ 1 ↺
                        Cosmin boosted

                        Matthew Fennell »
                        @matthew@fennell.dev

                        I started using pdb while writing some stuff in , and it's really nice to interact with!

                        I like that:

                      • You can define breakpoints just using the breakpoint() function, making conditional breakpoints very natural:
                      • if [condition]:
                        breakpoint()
                      • You don't need any special invocation to start the debugger - just run the script as you normally would and you end up in a pdb shell when a breakpoint is hit.
                      • In other languages, I slightly dread starting a debug session because I have to remember the flag to pass extra args, add all the breakpoints on startup etc. This leads to long sessions because I don't want to lose the investment I've put into my breakpoints.

                        But in Python, I have much shorter debug sessions and I can get right to a point of invocation really quickly, verify something, and close the debugger straight away.

                      • It interacts nicely with the repl:
                      • I use the repl much more because I can end up in a repl right with the context and variables that I need.

                        Defining more breakpoints within the repl is really nice to unpack nested datastructures in the same way it would be done in the code:

                        >>> for key, some_list in some_dict.items():
                        ... for value in some_list:
                        ... breakpoint()
                        I end up writing things in the repl first, but within the context that the code would be written in reality.

                        It's really thoughtfully designed - thank you to the people who made it so!