Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

$ echo "Hello World" > hw.php && php hw.php Hello World $ ls -l hw.php -rw-r--r-- 1 gareth staff 12 Oct 11 11:23 hw.php

By this stupid metric, PHP is the greatest programming language ever made.

12 byte Hello World must mean that it's also the ideal solution for every other programming problem, right?



I believe you entirely missed the point. This was more of an "Look at how you can abuse the loader and play with ELF headers" and in general show an interesting 'hacky' article, not "this is smaller, thus more efficient" argument.


I figured this was posted as a related article to the Dash "Hello World" issue where people are pointing at 17,000 lines of Hello World code, because it includes the runtime when compiled to Javascript.

There was another comment about how this will be the next "Fibonacci debacle", related to how Ted Dzubia trolled the node.js crowd by pointing out it's weakness for CPU-intensive tasks, then had a ton of people wasting time on writing faster Fibonacci algorithms in node just to prove him wrong.

My point was that comparing languages by the size of their Hello World programs is a useless exercise.


Your implementation is not x86 ELF. Regardless, I don't recall the author's insistence that finding the smallest executable was desirable. "Stupid metrics" make for great educational exercises.


I think you need to include the size of the php executable...


First, PHP is the greatest programming language ever made. (imagine DiCaprio screaming "I'm the king of the world!" on the Titanic)

Second, there is no point in using it for that when you have bash ... because bash has echo built-in and bash is a programming language:

$ echo "Hello World!"

1 line bitches! I can feel my unix beard growing ...


Unless you set +H in bash, including a '!' insisde double quotes is a bad idea.


touché




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: