Hacker News new | ask | show | jobs
by donatj 1667 days ago
Hello World in PHP is literally

    Hello World
I know no other language that elegant.
5 comments

If programing stopped there we wouldn't have an argument, its when you design high performant code that is maintained for over 10 years etc.
From the top of my head, Javascript and Common Lisp will also work with "Hello World" (with quotes).
I can’t speak for Lisp, but JavaScript isn’t going to write that to standard out, it would just be a statement that didn’t do anything.

You would need something like

    import { stdout } from 'process';
    
    stdout.write("Hello World");
Fair enough. On the client (just opening dev tools) it would return the string, but as you say, it depends on what we count as valid (repl, server-side, client). Probably the closest would be

    console.log("Hello World")
Being able to do a trivial hello world doesn't make a language elegant.
The easiest Quine imaginable!
m4