Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

<Tazman> damn my office is cold. <Tazman> need a hot secretary to warm it up. -- Seen on #Linux


devel / comp.lang.ada / Why "Hello World" as a first exercise?

SubjectAuthor
* Why "Hello World" as a first exercise?Richard Iswara
+- Re: Why "Hello World" as a first exercise?Paul Rubin
+- Re: Why "Hello World" as a first exercise?AdaMagica
+* Re: Why "Hello World" as a first exercise?Randy Brukardt
|+* Re: Why "Hello World" as a first exercise?Dennis Lee Bieber
||`- Re: Why "Hello World" as a first exercise?Randy Brukardt
|`- Re: Why "Hello World" as a first exercise?Richard Iswara
`- Re: Why "Hello World" as a first exercise?Keith Thompson

1
Why "Hello World" as a first exercise?

<se05ic$741$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5628&group=comp.lang.ada#5628

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!mRBVMlGoFUnDsRgMYRJiSw.user.46.165.242.75.POSTED!not-for-mail
From: haujekch...@gmail.com (Richard Iswara)
Newsgroups: comp.lang.ada
Subject: Why "Hello World" as a first exercise?
Date: Fri, 30 Jul 2021 13:17:46 +0700
Organization: Aioe.org NNTP Server
Message-ID: <se05ic$741$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="7297"; posting-host="mRBVMlGoFUnDsRgMYRJiSw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
X-Mozilla-News-Host: snews://nntp.aioe.org:563
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Richard Iswara - Fri, 30 Jul 2021 06:17 UTC

Why is it most of the courses of introduction to programming or
programming language use a "Hello World" kind of program as a demo or
first exercise?
Why not do a proper input loop as a showcase or a first exercise? With
an input loop procedure you get:
1. How to read and output an input.
2. Show the if-then-else structure.
3. Show the loop structure.
4. Show error messages and how to properly handle it.
5. On Ada in particular you are showing the type system.
6. If it is a subprogram then input loop shows how to do and call the
subprograms.
And last but not least it teaches and reinforces to the student how to
think about safety in programming.
So why a useless look at me, ain't I cool "Hello World"?

Sorry I had to vent after an unsatisfying exchange over at arstechnica.

Re: Why "Hello World" as a first exercise?

<87wnp85dkg.fsf@nightsong.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5629&group=comp.lang.ada#5629

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.ada
Subject: Re: Why "Hello World" as a first exercise?
Date: Fri, 30 Jul 2021 02:57:35 -0700
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <87wnp85dkg.fsf@nightsong.com>
References: <se05ic$741$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="e885916d827ee8791e5dd58b46c5e53c";
logging-data="10436"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19i2dFqMN8lNoziiIn7/znF"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:F04c+wrL6l69V20ikCShTCgRcI4=
sha1:4excWR1h/ZqTvwZsVLDJ88giZnQ=
 by: Paul Rubin - Fri, 30 Jul 2021 09:57 UTC

Richard Iswara <haujekchifan@gmail.com> writes:
> Why is it most of the courses of introduction to programming or
> programming language use a "Hello World" kind of program as a demo or
> first exercise?

The actual exercise is to (if necessary) get the compiler and tools
installed, make the source file, invoke the compiler, and run the
executable. Depending on the environment, this can be quite a serious
challenge. Going from there to a more complicated program is simple by
comparison.

I believe the "hello world" meme started with Brian Kernighan's
1970s-era tutorial for the then-new C language, but I could be wrong
about that.

Re: Why "Hello World" as a first exercise?

<4d663ac5-710e-49b0-8691-3b56ca5e4d5bn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5630&group=comp.lang.ada#5630

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:1593:: with SMTP id d19mr1514844qkk.472.1627639077235;
Fri, 30 Jul 2021 02:57:57 -0700 (PDT)
X-Received: by 2002:a25:818a:: with SMTP id p10mr2115143ybk.363.1627639077095;
Fri, 30 Jul 2021 02:57:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Fri, 30 Jul 2021 02:57:56 -0700 (PDT)
In-Reply-To: <se05ic$741$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.103.138; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.103.138
References: <se05ic$741$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4d663ac5-710e-49b0-8691-3b56ca5e4d5bn@googlegroups.com>
Subject: Re: Why "Hello World" as a first exercise?
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Fri, 30 Jul 2021 09:57:57 +0000
Content-Type: text/plain; charset="UTF-8"
 by: AdaMagica - Fri, 30 Jul 2021 09:57 UTC

You're right, this Hello World doesn't tell anything about the language, its syntax, semantics, what these have to do with safety. But you find this nonsense, as you say, everywhere.
But how to begin? The opinions vary. They depend on the audience - beginner, experienced,...

I say: Give them a simple problem and ask: What kind of (numeric) type do you need to fulfil the needs of the solution.
Others disagree: It's to complicate for a beginner to say "type Meter_Rod is range 0 .. 2_000;", just use Integer for the beginning.

The question is: How to avoid bad habits from other languages from the beginning?

Re: Why "Hello World" as a first exercise?

<se20le$6e5$1@franka.jacob-sparre.dk>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5638&group=comp.lang.ada#5638

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!paganini.bofh.team!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Why "Hello World" as a first exercise?
Date: Fri, 30 Jul 2021 18:06:21 -0500
Organization: JSA Research & Innovation
Lines: 58
Message-ID: <se20le$6e5$1@franka.jacob-sparre.dk>
References: <se05ic$741$1@gioia.aioe.org>
Injection-Date: Fri, 30 Jul 2021 23:06:22 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="6597"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Fri, 30 Jul 2021 23:06 UTC

"Richard Iswara" <haujekchifan@gmail.com> wrote in message
news:se05ic$741$1@gioia.aioe.org...
> Why is it most of the courses of introduction to programming or
> programming language use a "Hello World" kind of program as a demo or
> first exercise?

Because the problem isn't about programming at all, but rather getting
through all of the admistrivia needed to actually run a program. Starting
with a canned program of some kind is simply the best plan.

My first actual programming class spent the first two or three sessions on
the administrative things: where is the computer center? How do you use a
keypunch? (I admittedly am showing my age here; but at least we were the
second last semester to use the keypunches.) How to submit a card deck? What
magic incantations are needed to get the computer to accept a card desk?
Where to find your results afterwards (this being a batch system)? Etc. The
actual program was very secondary to all of that (I don't remember what it
was, but we had to key it and submit the results -- in order to prove that
we understood all of the admistrivia).

Obviously, there are differences from then to today, but there still is a
lot of admistrivia -- both in an academic environment and also at home. (How
to use the IDE? How to build a program? How to capture the results? Etc.) So
it is very valuable for any student to prove that they understand how to
enter and build a trivial program before they turn to actually learning
about fundamentals. The flow of any type of course gets interrupted
everytime someone has problems building a program -- the sooner they
understand that, the better.

"Hello World" isn't the most interesting program, but it has the advantage
of being very short and applicable in most contexts (for instance, it makes
sense both in GUI and text environments). And it also shows a primitive way
of doing debugging, something that every student will need to know almost
from the beginning.

Janus/Ada uses a slightly larger program as an installation test at the end
of installation. (At least if you read the installation guide -- I wonder
how many do?) It just sorts a bunch of numbers and displays them to the
screen. It's not really a useful example, but it does prove that the
Janus/Ada system and the things it depends upon are all installed properly.
It doesn't pay to write a program until you are sure of that!

I note that a similar issue happens in a lot of elementary education. I
vividly remember that the first word in the first book that we read when
learning to read started with and entire page devoted to "Tom" (and a line
drawing of a boy). No verb or action or abstraction of any kind. Hardly
useful text but valuable in getting the new readers introduced to the idea
of text associated with pictures having the same meaning.

The point being that there is a lot of stuff unrelated to the topic at hand
that needs to be navigated to learn just about any concept. The sooner that
that stuff can be dealt with, the better.

Randy.

Re: Why "Hello World" as a first exercise?

<6199gg1vsegpsqj6prdrqmmme4qo8avk71@4ax.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5640&group=comp.lang.ada#5640

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc3.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 30 Jul 2021 20:28:06 -0500
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.ada
Subject: Re: Why "Hello World" as a first exercise?
Date: Fri, 30 Jul 2021 21:28:06 -0400
Organization: IISS Elusive Unicorn
Message-ID: <6199gg1vsegpsqj6prdrqmmme4qo8avk71@4ax.com>
References: <se05ic$741$1@gioia.aioe.org> <se20le$6e5$1@franka.jacob-sparre.dk>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 41
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-bPrVo4+7LW3Ys1/+OmVxNMJV58HAerCtNSXEeScANXufa/8yMXcdaDNwU1iY0EWzNcrWn7/O7JVIm5z!DEX80yGAp8hb1s0Nh+o3BZy8QAcfKYlViAigP8DtK+Mb8Y7a6D6EiEjDPekuF/edG8El0+BU
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3222
X-Received-Bytes: 3401
 by: Dennis Lee Bieber - Sat, 31 Jul 2021 01:28 UTC

On Fri, 30 Jul 2021 18:06:21 -0500, "Randy Brukardt" <randy@rrsoftware.com>
declaimed the following:

>My first actual programming class spent the first two or three sessions on
>the administrative things: where is the computer center? How do you use a
>keypunch? (I admittedly am showing my age here; but at least we were the
>second last semester to use the keypunches.) How to submit a card deck? What
>magic incantations are needed to get the computer to accept a card desk?
>Where to find your results afterwards (this being a batch system)? Etc. The
>actual program was very secondary to all of that (I don't remember what it
>was, but we had to key it and submit the results -- in order to prove that
>we understood all of the admistrivia).
>
Sounds like my college... Here are the three 029 keypunches... Here's
how to program a drum card to simplify entering code... Here's the minimum
JCL to run FORTRAN(-IV) (Sigma CP/V had two FORTRAN compilers -- the
traditional compiler outputting a relocatable object [ROM] file, to be
followed by a linker outputting a load module [commonly called a LMN file];
the OS didn't use file extensions, so our practice was to name the source
S:xxx, object O:xxx, executable L:xxx. The other compiler was FLAG --
FORTRAN Load And Go -- compile/link/execute with one invocation). Turn in
the card deck to the operators, here. Come back later to pick up your
printed output.

It wasn't until my second year that we were given access to the
Hazeltine terminals, along with accounts that had some modicum of disk
storage associated with them. The BASIC class got something like 30
"granules" -- about 15kB; others got 100-200 "granules".

CP/V somehow combined time-share (we had something like 50 terminals
scattered over campus and a few high schools with dial-up lines), Batch
Processing, and (not of use to a college installation) supposedly
/real-time/ operations.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: Why "Hello World" as a first exercise?

<fa1b6b58-adeb-421e-c4ed-60a45c8fa4d3@gmail.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5641&group=comp.lang.ada#5641

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!mRBVMlGoFUnDsRgMYRJiSw.user.46.165.242.75.POSTED!not-for-mail
From: haujekch...@gmail.com (Richard Iswara)
Newsgroups: comp.lang.ada
Subject: Re: Why "Hello World" as a first exercise?
Date: Sat, 31 Jul 2021 10:06:17 +0700
Organization: Aioe.org NNTP Server
Message-ID: <fa1b6b58-adeb-421e-c4ed-60a45c8fa4d3@gmail.com>
References: <se05ic$741$1@gioia.aioe.org>
<se20le$6e5$1@franka.jacob-sparre.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="4300"; posting-host="mRBVMlGoFUnDsRgMYRJiSw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Richard Iswara - Sat, 31 Jul 2021 03:06 UTC

On 31/07/2021 06.06, Randy Brukardt wrote:
> "Richard Iswara" <haujekchifan@gmail.com> wrote in message
> news:se05ic$741$1@gioia.aioe.org...
>> Why is it most of the courses of introduction to programming or
>> programming language use a "Hello World" kind of program as a demo or
>> first exercise?
>
> Because the problem isn't about programming at all, but rather getting
> through all of the admistrivia needed to actually run a program. Starting
> with a canned program of some kind is simply the best plan.
>
> My first actual programming class spent the first two or three sessions on
> the administrative things: where is the computer center? How do you use a
> keypunch? (I admittedly am showing my age here; but at least we were the
> second last semester to use the keypunches.) How to submit a card deck? What
> magic incantations are needed to get the computer to accept a card desk?
> Where to find your results afterwards (this being a batch system)? Etc. The
> actual program was very secondary to all of that (I don't remember what it
> was, but we had to key it and submit the results -- in order to prove that
> we understood all of the admistrivia).
>
> Obviously, there are differences from then to today, but there still is a
> lot of admistrivia -- both in an academic environment and also at home. (How
> to use the IDE? How to build a program? How to capture the results? Etc.) So
> it is very valuable for any student to prove that they understand how to
> enter and build a trivial program before they turn to actually learning
> about fundamentals. The flow of any type of course gets interrupted
> everytime someone has problems building a program -- the sooner they
> understand that, the better.
>
> "Hello World" isn't the most interesting program, but it has the advantage
> of being very short and applicable in most contexts (for instance, it makes
> sense both in GUI and text environments). And it also shows a primitive way
> of doing debugging, something that every student will need to know almost
> from the beginning.
>
> Janus/Ada uses a slightly larger program as an installation test at the end
> of installation. (At least if you read the installation guide -- I wonder
> how many do?) It just sorts a bunch of numbers and displays them to the
> screen. It's not really a useful example, but it does prove that the
> Janus/Ada system and the things it depends upon are all installed properly.
> It doesn't pay to write a program until you are sure of that!
>
> I note that a similar issue happens in a lot of elementary education. I
> vividly remember that the first word in the first book that we read when
> learning to read started with and entire page devoted to "Tom" (and a line
> drawing of a boy). No verb or action or abstraction of any kind. Hardly
> useful text but valuable in getting the new readers introduced to the idea
> of text associated with pictures having the same meaning.
>
> The point being that there is a lot of stuff unrelated to the topic at hand
> that needs to be navigated to learn just about any concept. The sooner that
> that stuff can be dealt with, the better.
>
> Randy.
>
>
>
>

Fair points. Obviously now it's a lot different than it was, so why
don't textbooks and online instructions, especially those with online
IDE, don't evolve their approach?
I still think that students should be trained and challenged to think
carefully about implications of their programs. One of the reservations
I have about those online courses or code solutions sites is how many
don't consider documentations and coding safely as part of their grades.
Skills alone do not suffice in the "real world", communications matters
also. How many hours of training after the students graduate will be
wasted by their employers to teach them to consider their codes
carefully. That is IF (that's the big question) the employers do any
kind of training or mentoring. Why don't that kind of consideration is
taught and trained until it become a habit during the students education?

Re: Why "Hello World" as a first exercise?

<se4slu$k8$1@franka.jacob-sparre.dk>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5649&group=comp.lang.ada#5649

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Why "Hello World" as a first exercise?
Date: Sat, 31 Jul 2021 20:16:45 -0500
Organization: JSA Research & Innovation
Lines: 57
Message-ID: <se4slu$k8$1@franka.jacob-sparre.dk>
References: <se05ic$741$1@gioia.aioe.org> <se20le$6e5$1@franka.jacob-sparre.dk> <6199gg1vsegpsqj6prdrqmmme4qo8avk71@4ax.com>
Injection-Date: Sun, 1 Aug 2021 01:16:46 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="648"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Sun, 1 Aug 2021 01:16 UTC

"Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
news:6199gg1vsegpsqj6prdrqmmme4qo8avk71@4ax.com...
> On Fri, 30 Jul 2021 18:06:21 -0500, "Randy Brukardt"
> <randy@rrsoftware.com>
> declaimed the following:
>
>
>>My first actual programming class spent the first two or three sessions on
>>the administrative things: where is the computer center? How do you use a
>>keypunch? (I admittedly am showing my age here; but at least we were the
>>second last semester to use the keypunches.) How to submit a card deck?
>>What
>>magic incantations are needed to get the computer to accept a card desk?
>>Where to find your results afterwards (this being a batch system)? Etc.
>>The
>>actual program was very secondary to all of that (I don't remember what it
>>was, but we had to key it and submit the results -- in order to prove that
>>we understood all of the admistrivia).
>>
> Sounds like my college... Here are the three 029 keypunches... Here's
> how to program a drum card to simplify entering code... Here's the minimum
> JCL to run FORTRAN(-IV) (Sigma CP/V had two FORTRAN compilers -- the
> traditional compiler outputting a relocatable object [ROM] file, to be
> followed by a linker outputting a load module [commonly called a LMN
> file];
> the OS didn't use file extensions, so our practice was to name the source
> S:xxx, object O:xxx, executable L:xxx. The other compiler was FLAG --
> FORTRAN Load And Go -- compile/link/execute with one invocation). Turn in
> the card deck to the operators, here. Come back later to pick up your
> printed output.

Ah. We had the very advanced self-service card reader for simple jobs. You
put your card deck in, pushed a large button, watched a very impressive
swooshing of cards about, and then went and stood around a desk-sized
printer with lots of other people waiting for a page with your user name in
very large letters to head a printout, rip it off (preferably leaving anyone
elses that was attached -- didn't always happen), and go read the output to
see what you did. The original compile-execute-debug-repeat cycle (more like
run-read-punch new cards-repeat cycle).

They had a few Decwriters, but only upper classmen got to use them (and they
wasted tons of paper). Real terminals showed up the next year -- by the time
of the compiler contruction class, most of the classes had moved to PDP/11s
(way slower), but the compiler construction was still on the mainframe. But
almost everything was done on the terminals (Janus/Ada never was on punched
cards, thank goodness). We had to buy one of those huge computer tapes to
rescue our source code and use another labs capability to transfer that to
floppies in order to move our work to the CP/M computer on which RRS was
born. A lot more engineering went into that sort of issue than today
(probably a good thing).

Randy.

Randy.

Re: Why "Hello World" as a first exercise?

<87mtq1ao14.fsf@nosuchdomain.example.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5650&group=comp.lang.ada#5650

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.ada
Subject: Re: Why "Hello World" as a first exercise?
Date: Sat, 31 Jul 2021 19:37:11 -0700
Organization: None to speak of
Lines: 48
Message-ID: <87mtq1ao14.fsf@nosuchdomain.example.com>
References: <se05ic$741$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="45c31737cfd44125daaf4223bdb9fd61";
logging-data="9506"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19L2p1tnFCovvpa4i2eTvCv"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Egea7Hze0TF/EOPESFdt9qe2y3A=
sha1:vOiK9pcnWBsw3Vv4euomkVACrAY=
 by: Keith Thompson - Sun, 1 Aug 2021 02:37 UTC

Richard Iswara <haujekchifan@gmail.com> writes:
> Why is it most of the courses of introduction to programming or
> programming language use a "Hello World" kind of program as a demo or
> first exercise?
> Why not do a proper input loop as a showcase or a first exercise? With
> an input loop procedure you get:
> 1. How to read and output an input.
> 2. Show the if-then-else structure.
> 3. Show the loop structure.
> 4. Show error messages and how to properly handle it.
> 5. On Ada in particular you are showing the type system.
> 6. If it is a subprogram then input loop shows how to do and call the
> subprograms.
> And last but not least it teaches and reinforces to the student how to
> think about safety in programming.
> So why a useless look at me, ain't I cool "Hello World"?
>
> Sorry I had to vent after an unsatisfying exchange over at arstechnica.

All those things you listed absolutely should be covered -- but only
*after* the "Hello World" exercise.

The first time someone with no programming experience tries to write,
compile, and run a program, *something* will very likely go wrong.
Maybe they'll omit a semicolon, or misspell an identifier, or invoke the
compiler without a required option. And they're likely to be shown a
terse error message that might not direct them to the right way to fix
it.

By making the first program something trivial that can reasonably be
entered verbatim, you eliminate several sources of errors. If the
student double checks that the source file exactly matches what's in the
textbook and it doesn't run, it's substantially easier to diagnose the
problem.

Once the student gets "Hello, World" working correctly, if the second
program uses some of the features you mention and *that* doesn't work,
they'll know that the problem is something in the difference between the
first and second programs.

You might try a more ambitious first program if you're an experienced
programmer trying out a new language, but even then I'll probably try
"Hello World" before I try FizzBuzz.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor