
A modern “Hello, World” program requires more than just code - luord
https://stackoverflow.blog/2020/03/05/a-modern-hello-world-program-needs-more-than-just-code/
======
allenskd
> Building a new React app with create-react-app requires 4304 directories and
> 28678 files.

Finally, of course I don't consider myself the only person thinking about it
but someone finally pointed the elephant in the room because it's been bugging
me for a very long time, especially with anything related to NodeJS it feels
like to actually get somewhere you need to pull hundreds if not thousands of
tiny libraries dependencies. Once 1, 2, 50 of those tiny libraries becomes
unmaintained and fall into a high risk vulnerability and there's no
replacement that's it , you have to start taking care of it yourself. It could
happen in any language, yes, but I feel it's more prone to happen in NodeJS
given the nature of .... pulling hundreds of modules, even with Java/Maven you
don't really pull that many libraries into your application unless it has some
really wide scope in it.

I don't have any beef with NodeJS itself but the whole subject of having so
much boilerplate code needed to get yourself started is a bit insane. I get
that hardware has become more powerful and storage is cheap but... at which
point is it no longer okay and becomes a burden to distribute said apps?

~~~
dpeck
it happened,
[https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/](https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/)

~~~
jhabdas
There are some good threads (if we could call them that) on GH related to how
LeftPad "broke the Internet" and the original stories about it from Kik
are/were on Medium. Surfing through the related GH threads lead me to
ZeroNet[1], which is fantastic P2P web alternative which works offline and
updates in real-time. It also has a decentralized GitHub alternative which
would mitigate situations like LeftPad.

[1]: [https://zeronet.io](https://zeronet.io)

------
superasn
Maybe I misunderstood it but why would you create a react app for writing
Hello world. In Javascript you can do that in one line
'document.writeln("Hello world")'

That's equivalent of installing Laravel first just to write Hello world in PHP
and saying look how big my vendor folder is.

~~~
pldr2244
Because it makes for a great strawman. “Look, JS tooling is so bloated, just
to emit a Hello world!”

I‘ve since stopped expecting any level of reason when it comes to HN bashing
of modern JS/React/frontend.

~~~
chatmasta
The bashing never seems to come from people using the tooling, either.

------
jfengel
It's my belief that Hello, World is the hardest program I ever write. I have
to track down the compiler, install all the dependencies specific to my
system, figure out where the various files go, and puzzle out how to make them
start. The error messages are usually incomprehensible -- when they exist at
all. Often, errors are simply "nothing happened".

Once the program is running, I have a tool set for debugging it. I can start
from there and add things. But for a new framework/language, the actual
program is often less total work than the initial Hello, World.

------
asperous
In snes Zelda, the dungeons were designed such if only you had an item, it
would be so much easier. Like a rope to clear ledges vs having to go all the
way around.

It is said that this teaches without words.. makes players long for an item
before they have it and when they get it, they already know why it exists and
how it is used.

One advantage of going slower with students and helping them with things like
(oh that didn't work because Microsoft Word changed your quotes), is they
build an understanding of the tools.

Git is a good example. I have so many CS student friends who talk about how
annoying their teacher is for making them use git, and how they don't see any
point in it. From their perspective I totally understand. As soon as they
realize like (oh I needed code I deleted, or oh I need to merge two people's
code) will git start to actually make sense.

~~~
saagarjha
Git's porcelain is absolutely terrible, and I don't fault anyone for thinking
that it's pointless trying to mess around with it, especially because teachers
aren't usually the best at explaining it anyways.

------
saagarjha

       #include <stdio.h>
      
      int main() {
          printf("Hello, world!\n");
          return 0;
      }
    

Unrelated, but I will note that the standard signature is "int main(void)" ;)

------
SlowRobotAhead
> Building a new React app with create-react-app requires 4304 directories and
> 28678 files.

Makes my head spin.

~~~
Waterluvian
I've never fully understood Create React App. Is it for people who just churn
out generic apps at a rate that the time to set up the dev env is a meaningful
cost? I'm not sure I've found setting up webpack or whatnot to be all that
time consuming.

My bigger concern is that I don't want to become a passenger rather than the
driver of my environment and build pipeline.

~~~
pldr2244
Facebook offers an opinionated, production ready, battle tested framework for
bootstrapping a modern React application with tooling/batteries included (with
dependencies automatically maintained if you need to version bump to latest
via react-scripts as a magical dependency).

Unless you’re doing something so completely customised (and even then,
ejecting from CRA is a blessed path), why WOULND’T you use CRA?

~~~
ng12
> why WOULND’T you use CRA?

It's worth noting that CRA is pretty complicated. My home-rolled webpack
configs are significantly simpler than ejected CRA apps. If you're going to be
making significant changes to the configs it's going to be a lot easier with a
custom project.

------
dorkwood
I can still remember being extremely confused the first time I came across a
'hello world' tutorial as a child.

The thoughts running through my head were something like: What is 'hello
world' and why am I writing it? Is it a command that does something? Does
every language have a 'hello world' command, or just this one? Let's see... if
I copy and paste the code and run it, it doesn't seem to do anything except
repeat 'hello world' back to me. I must be missing something...

------
lonelygirl15a
[https://www.artsy.net/artwork/brian-kernighan-hello-
world](https://www.artsy.net/artwork/brian-kernighan-hello-world)

------
sbilstein
Real talk: is the comma in “hello, world!” necessary?

~~~
ganstyles
Yeah! And while we're on the subject, is the ", World" even necessary?

~~~
sk0g
Traditions are traditions, and an industry as young as ours needs to hold on
to the very few we have!

Moving goalposts around on the Hello World code golfing world has some
'consequences' \- there's languages with built in hello world that try and get
it printing with minimal code, and removing the comma, for example, would
invalidate that hack.

~~~
superasn
One tradition I'm happy got lost in the way is using FOO, BAR, BAT in
examples. It made the simplest examples hard to understand and those words
never made any sense to me.

It's always better to use contextual words in most examples.

edit: for more clarity this article (1) explains it quite well

[https://dev.to/kiarathedev/why-i-don-t-use-foo-bar-
baz-1kf7](https://dev.to/kiarathedev/why-i-don-t-use-foo-bar-baz-1kf7)

~~~
sk0g
I'd honestly rather have a,b,c than that! Nobody writes code with such
placeholder variable names, so why demonstrate it that way?

Placeholder variables like i and j don't count! Foo, Baz, etc are annoying to
read too, IMO.

~~~
runarberg
I use foo, bar, baz, etc. all the time when I’m writing tests. But I agree
generally it is better when examples use meaningful name `cd /path/to/file` as
oppose to `cd /foo/bar/baz`

