• A Modern "Hello World"

    From Lars Poulsen@3:633/10 to All on Fri Dec 5 13:58:18 2025
    The traditional "Hello World" program is sometimes a nice example line
    of code to illustrate the flavor/style of a programming language, but it
    kind of overlooks that very little programming these days runs in a
    command line/text terminal environment. To be relevant in today's world,
    we need the next level of program, maybe something like ...

    Draw a text box that displays a live-updating digital clock: The current
    time in hh:mm:ss format, about 10 mm high. Extra bonus points for
    scaling it when the text box is resized.

    A collection of these in various languages would be quite useful.
    How much would depend on the environment (Windows, MacOS, GNOME)?

    I suspect that the shortest would be HTML/CSS/JavaScript (assuming the availability of a web browser).

    Does such a collection already exist?
    --
    Lars Poulsen - an old geek in Santa Barbara, California

    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lars Poulsen@3:633/10 to All on Fri Dec 5 15:00:45 2025
    On 2025-12-05, Stefan Ram <ram@zedat.fu-berlin.de> wrote:
    Lars Poulsen <lars@beagle-ears.com> wrote or quoted:
    Draw a text box that displays a live-updating digital clock: The current >>time in hh:mm:ss format, about 10 mm high. Extra bonus points for
    scaling it when the text box is resized.

    Since a "Hello World!" program kicks off a lot of courses, it has
    to be super simple. A digital clock is way too complex for that.

    On top of that, there are tons of important languages where
    you just can't build that kind of thing at all. C and C++
    don't even have a visual interface.

    A live clock display is an awesome coding exercise - just don't
    call it a "Hello World" program!

    Okay, can we call it a "starter kit" then?

    I, for one, am badly in need of such a starter kit. After 45 years of programming, I still do not know how to write a program that can do the
    above, and I have no idea how to get started; I do not even know which
    would be the simplest language/framework to do it in.

    The best I personally could do is probably a HTML page calling up a Perl
    script on the server side with a refresh tag.

    And so, we now have one or two generations of programmers that have
    learned a "framework" that loads a gigabyte of runtime to do a simple
    task. No wonder we have bloated and buggy programs at junior programmers
    mix and match frameworks.

    Just a couple decades ago, such a program would be written in a few
    lines of Visual Basic, but I don't think that exists any more.

    --
    Lars Poulsen - an old geek in Santa Barbara, California

    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From John Ames@3:633/10 to All on Fri Dec 5 08:08:23 2025
    On Fri, 5 Dec 2025 15:00:45 -0000 (UTC)
    Lars Poulsen <lars@beagle-ears.com> wrote:

    I still do not know how to write a program that can do the above, and
    I have no idea how to get started; I do not even know which would be
    the simplest language/framework to do it in.

    The problem is that once you go beyond basic command-line environments,
    the answer to the question is almost *entirely* dependent on the OS
    and/or GUI framework; even in the same language, it's different in
    Win32 than it is in OSX, several whole *flavors* of different on *nix
    depending on whether you're using Qt, GTK, Motif, raw X11 calls, or any
    of half-a-dozen other minor toolkits, etc. etc.

    And where it's *not* different, it's because the language offers an
    abstraction that tries to gloss over the differences for you - as in
    Java, and to a lesser extent Python. Which is not necessarily a bad
    thing, but does mean that you're limited by the design choices of the abstraction, which tends to be a least-common-denominator that never
    quite fits in with *any* of the native environments it's targeting.

    Just a couple decades ago, such a program would be written in a few
    lines of Visual Basic, but I don't think that exists any more.

    Sadly, no (although there are attempts to revive it; would-be spiritual successors as well, but only GAMBAS even shows a true understanding of
    what made it great.) For many a year it was the absolute simplest way
    to go from zero to functional GUI application - however, it never did
    run on any platform besides Windows (unless you count the original v.1 VB-for-DOS, which *did* exist but I don't think I've ever seen an
    application built with it.)


    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From John Ames@3:633/10 to All on Fri Dec 5 09:10:16 2025
    On 5 Dec 2025 16:20:40 GMT
    ram@zedat.fu-berlin.de (Stefan Ram) wrote:

    Well, one can, kind of, translate my HTML code to Python:

    Indeed, but this is specific to Python's Tk wrapper; if you were using
    the Qt or GTK bindings it'd be different.


    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From John Ames@3:633/10 to All on Fri Dec 5 09:37:29 2025
    On 5 Dec 2025 17:26:30 GMT
    ram@zedat.fu-berlin.de (Stefan Ram) wrote:

    Yes, and tkinter (the tk wrapper) is part of the standard
    distribution of Python, the one you get when you go to python.org and "download Python". So, in this sense, it's a part of Python.

    True, but not to the extent that, say, the VB form & control interfaces
    are a part of VB. It may come in the standard array of bolt-ons (and
    Python is uniquely good at making those simple to import,) but it's
    still a bolt-on.


    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Scott Lurndal@3:633/10 to All on Fri Dec 5 18:49:04 2025
    John Ames <commodorejohn@gmail.com> writes:
    On 5 Dec 2025 16:20:40 GMT
    ram@zedat.fu-berlin.de (Stefan Ram) wrote:

    Well, one can, kind of, translate my HTML code to Python:

    Indeed, but this is specific to Python's Tk wrapper; if you were using
    the Qt or GTK bindings it'd be different.


    There's always the basic X11 version.

    https://github.com/ereslibre/x11/blob/master/xclock/xclock.c

    Hopefully will still work with that POS Weyland server.

    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Bridgham@3:633/10 to All on Fri Dec 5 14:55:03 2025
    Lars Poulsen <lars@beagle-ears.com> writes:

    The traditional "Hello World" program is sometimes a nice example line
    of code to illustrate the flavor/style of a programming language,

    My take on "Hello World" was that it had nothing to do with illustrating
    the flavor/style of a language. Its purpose was to see that you could
    operate the development chain. That is that you could edit a program,
    compile it, and then run the resulting output. "Hello world" is about
    the simplest program that shows that. In the embedded world, blinky
    serves the same purpose.

    Once that was in place, then you could move on learning the
    language and libraries and whatever else was on the syllabus.

    Dave

    --- PyGate Linux v1.5.1
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)