lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 2022-03-10 at 10:21 -0300, Hisham wrote:
>
> On Wed, 9 Mar 2022 at 13:28, Pierre Chapuis <lua@catwell.info> wrote:
> >
> > I came across this post, which discusses the lack of error validation in naive "Hello World" programs in different languages: https://blog.sunfishcode.online/bugs-in-hello-world/
>
> This is fun and all (and I did learn about /dev/full reading it!), but
> I hope it doesn't become part of pedantry lore. Calling that behavior
> a "bug" is really stretching it, after all, I think if you asked
> anybody what's the specification of the well-known programming example
> "hello world" is, they'd just say "it should print 'hello world'" and
> not "it should print 'hello world' and returns an exit code indicating
> whether the print operation was successful or not". :)

Full ACK!

The point of the Hello World (regardless whether it prints text
for humans to see, or lights a LED or toggles a pin on machines
which lack a terminal, or where accessing a terminal is too
tedious for a Hello World environment) is to verify that the
toolchain is present and operational. That is: Can you enter
source code, and are build instructions in place, to have machine
readable code generated, which loads and executes on the target,
and does _something_ no matter what. All you want is to "see"
that effect of executing that something. Typical Hello World
programs may _look_ primitive, but they have a rather specific
purpose which is _not_ what its source code suggests. The blog
article author may have missed that point.

Generating a useful application with correct behaviour under
exceptional conditions is way beyond the scope of a Hello World.
That's regular application development after the usability of the
involved tools was verified. And the lengths which authors go to
to cover each and every situation that might appear is up to the
authors to decide. Depends on why the application gets created,
and how it's supposed to get used. There is not one single answer
to that aspect. A Hello World neither is supposed to "teach" a
complete new ecosystem to a beginner, nor to demonstrate best
practices nor robust programming under arbitrary bad external
influences. Its purpose is to verify the principal operation of
the tools involved, to create something else afterwards which is
not a Hello World application.

There may be exceptions, like the GNU Hello World project. But
this only shares the name, and is so not a typical Hello World
program. Includes everything and the kitchen sink, depends on a
lot of external libraries, is more complex than many small single
purpose utilities, has complex build rules, etc etc. Obviously
was not made for the purpose which Hello World initially was
supposed to cover.


virtually yours
Gerhard Sittig
--
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.