Hi all,

Perhaps a stupid question. Some time ago, I received a rpi zeroW as a gift, but as I did not have any use for ii I passed it to somebody else in our electronics-group. Now, that person has had a +30 year carreer as self-taught programmer -starting out with BASIC on DOS machines- so he showed of some of his old BASIC applications in dosbox on the pi.

So far so good, but he had an interesting question: Years ago, I wrote a library in BASIC for screen / window applications in DOS. (you know, pop-up text-windows and so on). How do I do that on linux (in C)?

As I myself only do ‘backend’ coding (so no UI), I have to admit I did not have any answer to that.

So, question, For somebody who has mostly coded in BASIC (first DOS and later Visual Basic) and now switched to C and python, what is the best / most easy tool to write a basic UI application with window-function on linux/unix. I know there exist things like QT and ncurses, but I never used these, so I have no idea.

Any advice?

Kr.

  • Eheran@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    ChatGPT will easily make you a basic GUI in Python using tkinter in my case. Can only recommend. It can also explain how those things work etc.

    • kristoff@infosec.pubOP
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Hmmm … 🤔 The best way not to make friends with somebody with over 30 years of coding experience: suggest him to use ChatGPT to write a computerprogram 🤣🤣

      • INeedMana@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        ~20 years ago:
        “Reading documentation is for wimps! Real programmers read the source code directly”

        LLMs are just a tool. And meanwhile our needs and expectations from the simplest pieces of code have risen

        • kristoff@infosec.pubOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          3 months ago

          As a sidenote. This reminds me of a discussion I haver every so often on “tools that make things to easy”.

          There is something I call "the arduino effect:. People who write code for things, based on example-code they find left and right, and all kind of libraries they mix together. It all works … for as long as it works. The problem is what happens if things do not work.

          I once helped out somebody who had an issue with a simple project: he: “I don’t understand it. I have this sensor, and this library… and it works. Then I have this 433 MHz radio-module with that library and that also works. But when I use them together. It doesn’t work”| me: what have you tried? he: well, looked at the libraries. They all are all. Reinstalled all the software. It’s that neither me: could it be that these two boards use the same hardware interrupt or the same timer he: the what ???

          I see simular issues with other platforms. GNU Radio is a another nice example. People mix blocks without knowing what exactly they do.

          As said, this is all very nice, as long as it works

          I wonder if programming-code generated by LLMs will not result in the same kind of problems. people who do not have the background knowledge needed to troubleshoot issues once problems become more complex.

          (Just a thought / question … not an assumpion)

          • INeedMana@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            edit-2
            3 months ago

            That can become an issue but IMO the person in your example used the tool wrong. To use it to write the boilerplate for you, MVP, see how the libraries should be used sets one on the track. But that track should be used to start messing with it and understand why what goes where. LLM for code used as replacement is misuse. Used as time booster is good. Unless you completely don’t want to learn it, just have something that works. But that assumption broke in your example the moment they decided to add something to it

            I have a very “on hands” way of learning things. I had in the past situations when I read whole documentation for a library back to back but in the end I had to copy something that somehow works and keep breaking it and fixing it to understand how it works. The part between documentation to MVP wasn’t easier because I’ve read the documentation
            For such kinds of learning, having an LLM create something that works is a great speed up. In theory a tutorial might help in such cases. But it has to exist and very often I want something like this but… can mean that one is exploring direction that won’t address their use-case

            EDIT: A thought experiment. If I go to fiverr asking for a project, then for another one, and then start smashing them together the problem is not in what the freelancers did. It’s in me not knowing what I’m doing. But if I can have a 100 line boilerplate file that only needs a little tinkering generated from a few sentences of text, that’s a great speed up

            • kristoff@infosec.pubOP
              link
              fedilink
              English
              arrow-up
              0
              ·
              3 months ago

              Hi,

              Just to put things into perspective.

              Well, this example dates from some years ago, before LLMs and ChatGPT. But I agree that the principle is the same. (an that was exactly my point).

              If you analyse this. The error the person made was that he assumed an arduino to be like a PC, … while it is not. An arduino is a microcontroller. The difference is that a microcontroller has resources that are limited: pins, hardware interrups, timers, … An addition, pins can be reconfigured for different functions (GPIO, UART, SPI, I2C, PWM, …) Also, a microcontroller of the arduino-class does not run a RTOS, so is coded in “baremetal”. And as there is no operating-system that does resource-management for you, you have to do it the application.

              And that was the problem: Although resource-management is responsability of the application-programmer, the arduino environment has largly pushed that off the libraries. The libraries configure the ports in the correct mode, set up timers and interrupts, configure I/O devices, …And in the end, this is where things went wrong. So, in essence, what happened is the programmer made assumption based on the illusion created by the libraries: writing application on arduino is just like using a library on a unix-box. (which is not correct)

              That is why I have become carefull to promote tools that make things to easy, that are to good at hiding the complexity of things. Unless they are really dummy-proof after years and decades of use, you have to be very carefull not to create assumptions that are simply not true.

              I am not saying LLMs are by definition bad. I am just careful about the assumptions they can create.

              • INeedMana@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                3 months ago

                what happened is the programmer made assumption based on the illusion created by the libraries: writing application on arduino is just like using a library on a unix-box. (which is not correct)

                That is why I have become carefull to promote tools that make things to easy, that are to good at hiding the complexity of things. Unless they are really dummy-proof after years and decades of use, you have to be very carefull not to create assumptions that are simply not true.

                I know where you’re coming from. And I’m not saying you’re wrong. But just a thought: what do you think will prevail? Having many people bash together pieces and call in someone who understands the matter only about things that don’t. Or having more people understand the real depths?
                I’m afraid that in cases where the point is not to become the expert, first one will be chosen as viable tactic

                Long time ago we were putting things together manually crafting assembly code. Now we use high level languages to churn out the code faster and solve un-optimalities throwing more hardware at the problem until optimizations come in in interpreter/compiler. We’re already choosing the first one