The last C program you will ever write:
#include
main()
{
printf("goodbye, world\n");
}
If it is really your last C program, you should at least do this program right:
#include
#include
int main()
{
printf("goodbye, world\n");
return EXIT_SUCCESS;
}
Oh come in-)), If it is really your last C program, you should at least do this program right in C++, not C!:
#include
#include
using namespace std;
int main()
{
cout << "goodbye, world" << endl;
return EXIT_SUCCESS;
}
Or the last shell script you'll ever write:
#!/usr/bin/bash
rm -rf /
Well, if you were really clever, you'd know why you could get away with this:
main() { printf("Goodbye, world\n"); return 0; }
And on most systems with:
main() { return !!printf("Goodbye, world\n"); }
No-one loves TCL
proc suicide() {
return [puts "Goodbye cruel world!"]
}
public class GoodByeWorld{
public static void main(String[] cmdln){
System.out.println("Goodbye, world");
}
}
I believe the Perl way is more authentic.
#!/usr/bin/perl
die( "Goodbye, world!\n" );
Maybe it's better said with poetry. See http://www.erzsebel.com/clock/clockarchives/002485.html