views:

3402

answers:

19

In most scripting languages, a "Hello world!" application is very short:

print "Hello world"

In C++, it is a little more complicated, requiring at least 46 non-whitespace characters:

#include <cstdio>

int main()
{
   puts("Hello world");
}

Java, at 75 non-whitespace characters, is even more verbose:

class A {
  public static void main(String[] args) {
    System.out.print("Hello world");
  }
}

Are there any languages that require even more non-whitespace characters than Java? Which language requires the most?

Notes:

  • I'm asking about the length of the shortest possible "hello world" application in a given language.
  • A newline after "Hello world" is not required.
  • I'm not counting whitespace, but I know there is some language that uses only whitespace characters. If you use that one you can count the whitespace characters.
+1  A: 

I think the one I wrote in 6502 Assembler was pretty long, but I don't have it laying around any more.

Don Branson
The one I wrote in 6502 assembler was three or four lines long. Kind of OS dependent.
Tom Hawtin - tackline
+57  A: 

Ook is quite verbose :-)

#example that prints Hello World!
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
Steven Robbins
Anyone that is using any 'modern' Object Oriented programing language clearly hasn't experienced Ook yet.
Grant
I'm waiting for Jon Skeet's Ook port of protocol buffers ;-)
Steven Robbins
@Steve the prerequisite for those buffers is a terabyte hard drive.
Grant
This can be shortened by removing the exclamation point and newline at the end of "Hello World!".
Bill the Lizard
You live and learn!
PEZ
What is Ook used for?
MainID
@Jinx Masochists
Grant
@Jinx teaching monkeys to code
@nickolai Monkeys? Monkeys?! Apes man.. apes!
Steven Robbins
Oh absoutely fantastic! Dude if I could +1000 I would :)
Binary Worrier
Ook? Ook. Ook? Ook!
splattne
I'm surprised there haven't been more esoteric examples posted yet. Nice job.
hydrapheetz
+16  A: 

BrainFuck is pretty long

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Grant
Ook is longer, as it's a mechanical translation of each BF symbol from one character to 2 4 character symbols (making it 8 times longer :))
workmad3
Yeah, but brainfuck is more widely supported than Ook. It's unfair to say that Ook is "longer" than brainfuck, because the Ook language has the same 8 brainfuck commands, but written out longer.
Chris Lutz
I should write a brainfuck 'clone' where the 8 commands are each an entire book. Dune, Moby Dick, Hop on Pop, The Boxcar children # 31, etc.
Grant
NO, you should NOT write such a language. Please don't :(
Camilo Martin
+8  A: 

Ook has a pretty long one:

http://helloworldsite.he.funpic.de/hello.htm#Ook

also, check just the hello world collection:

http://helloworldsite.he.funpic.de/

workmad3
+5  A: 

Check this huge one written in Redcode.

; Should work with any MARS >= ICWS-86
; with 128x64 gfx core
Start MOV 0,2455
      MOV 0,2458
      MOV 0,2459
      MOV 0,2459
      MOV 0,2459
      MOV 0,2459
      MOV 0,2459
      MOV 0,2460
      MOV 0,2465
      MOV 0,2471
      MOV 0,2471
      MOV 0,2471
      MOV 0,2479
      MOV 0,2482
      MOV 0,2484
      MOV 0,2484
      MOV 0,2484
      MOV 0,2486
      MOV 0,2486
      MOV 0,2486
      MOV 0,2486
      MOV 0,2488
      MOV 0,2493
      MOV 0,2493
      MOV 0,2493
      MOV 0,2493
      MOV 0,2497
      MOV 0,2556
      MOV 0,2559
      MOV 0,2560
      MOV 0,2565
      MOV 0,2570
      MOV 0,2575
      MOV 0,2578
      MOV 0,2585
      MOV 0,2588
      MOV 0,2589
      MOV 0,2592
      MOV 0,2593
      MOV 0,2596
      MOV 0,2597
      MOV 0,2603
      MOV 0,2605
      MOV 0,2608
      MOV 0,2667
      MOV 0,2670
      MOV 0,2671
      MOV 0,2676
      MOV 0,2681
      MOV 0,2686
      MOV 0,2689
      MOV 0,2696
      MOV 0,2699
      MOV 0,2700
      MOV 0,2703
      MOV 0,2704
      MOV 0,2707
      MOV 0,2708
      MOV 0,2714
      MOV 0,2716
      MOV 0,2719
      MOV 0,2778
      MOV 0,2778
      MOV 0,2778
      MOV 0,2778
      MOV 0,2778
      MOV 0,2779
      MOV 0,2779
      MOV 0,2779
      MOV 0,2782
      MOV 0,2787
      MOV 0,2792
      MOV 0,2795
      MOV 0,2802
      MOV 0,2805
      MOV 0,2806
      MOV 0,2809
      MOV 0,2810
      MOV 0,2810
      MOV 0,2810
      MOV 0,2810
      MOV 0,2812
      MOV 0,2818
      MOV 0,2820
      MOV 0,2823
      MOV 0,2882
      MOV 0,2885
      MOV 0,2886
      MOV 0,2891
      MOV 0,2896
      MOV 0,2901
      MOV 0,2904
      MOV 0,2911
      MOV 0,2912
      MOV 0,2913
      MOV 0,2914
      MOV 0,2917
      MOV 0,2918
      MOV 0,2919
      MOV 0,2922
      MOV 0,2928
      MOV 0,2930
      MOV 0,2933
      MOV 0,2992
      MOV 0,2995
      MOV 0,2996
      MOV 0,3001
      MOV 0,3006
      MOV 0,3011
      MOV 0,3014
      MOV 0,3021
      MOV 0,3022
      MOV 0,3023
      MOV 0,3024
      MOV 0,3027
      MOV 0,3028
      MOV 0,3030
      MOV 0,3032
      MOV 0,3038
      MOV 0,3040
      MOV 0,3103
      MOV 0,3106
      MOV 0,3107
      MOV 0,3107
      MOV 0,3107
      MOV 0,3107
      MOV 0,3107
      MOV 0,3108
      MOV 0,3108
      MOV 0,3108
      MOV 0,3108
      MOV 0,3108
      MOV 0,3109
      MOV 0,3109
      MOV 0,3109
      MOV 0,3109
      MOV 0,3109
      MOV 0,3111
      MOV 0,3111
      MOV 0,3111
      MOV 0,3120
      MOV 0,3121
      MOV 0,3124
      MOV 0,3124
      MOV 0,3124
      MOV 0,3126
      MOV 0,3129
      MOV 0,3130
      MOV 0,3130
      MOV 0,3130
      MOV 0,3130
      MOV 0,3130
      MOV 0,3131
      MOV 0,3131
      MOV 0,3131
      MOV 0,3131
      MOV 0,3135
      JMP 0
CMS
posted the linked code for you
Kip
+5  A: 

whitespace has a long one but I guess they are obviously all whitespace characters

jmein
There's an exception at the end of the post which allows counting the whitespace characters in whitespace.
Kip
do tabs count as two?
in whitespace there are tabs and linebreaks so I would assume so because they are the only things you can use
jmein
I tried to post the code for you, but SO seems to trim() each line of code..
Kip
at college when we handed in our work for this language (we did a hello world program for fun) we replace space with [sp] tab with [tab] and line feed with [lf] so that you could actually read it but I am kinda busy today so dont have time to do it now
jmein
+40  A: 

I think I would have to opt for COBOL, which I think needs about 14 lines of code.

This version is only slightly more verbose than required:

000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID.     HELLOWORLD.
000300
000400*
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.
001100 FILE SECTION.
001200
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400     DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500     DISPLAY "Hello world!" LINE 15 POSITION 10.
100600     STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800     EXIT.
Tim Almond
+1 for being pretty much the only answer with a real world language.
Michael Burr
@ Michael Burr - agreed
SnOrfus
I added the linked code for you..
Kip
I nearly tagged this "offensive" as a gut reaction... nothing personal mind you, just that COBOL really is almost offensive.
Paul Hollingsworth
+68  A: 

I'm going to say Shakespeare.

The Infamous Hello, world! Program.

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.


                   Act I: Hamlet's insults and flattery.

                   Scene I: The insulting of Romeo.

[Enter Hamlet and Romeo]

Hamlet:
 You lying stupid fatherless big smelly half-witted coward!
 You are as stupid as the difference between a handsome rich brave
 hero and thyself! Speak your mind!

 You are as brave as the sum of your fat little stuffed misused dusty
 old rotten codpiece and a beautiful fair warm peaceful sunny summer's
 day. You are as healthy as the difference between the sum of the
 sweetest reddest rose and my father and yourself! Speak your mind! 

 You are as cowardly as the sum of yourself and the difference
 between a big mighty proud kingdom and a horse. Speak your mind.

 Speak your mind!

[Exit Romeo]

                   Scene II: The praising of Juliet.

[Enter Juliet]

Hamlet:
 Thou art as sweet as the sum of the sum of Romeo and his horse and his
 black cat! Speak thy mind!

[Exit Juliet]

                   Scene III: The praising of Ophelia.

[Enter Ophelia]

Hamlet:
 Thou art as lovely as the product of a large rural town and my amazing
 bottomless embroidered purse. Speak thy mind!

 Thou art as loving as the product of the bluest clearest sweetest sky
 and the sum of a squirrel and a white horse. Thou art as beautiful as
 the difference between Juliet and thyself. Speak thy mind!

[Exeunt Ophelia and Hamlet]


                   Act II: Behind Hamlet's back.

                   Scene I: Romeo and Juliet's conversation.

[Enter Romeo and Juliet]

Romeo:
 Speak your mind. You are as worried as the sum of yourself and the
 difference between my small smooth hamster and my nose. Speak your
 mind!

Juliet:
 Speak YOUR mind! You are as bad as Hamlet! You are as small as the
 difference between the square of the difference between my little pony
 and your big hairy hound and the cube of your sorry little
 codpiece. Speak your mind!

[Exit Romeo]

                   Scene II: Juliet and Ophelia's conversation.

[Enter Ophelia]

Juliet:
 Thou art as good as the quotient between Romeo and the sum of a small
 furry animal and a leech. Speak your mind!

Ophelia:
 Thou art as disgusting as the quotient between Romeo and twice the
 difference between a mistletoe and an oozing infected blister! Speak
 your mind!

[Exeunt]
Bill the Lizard
This is such a find! The syntax coloring does a pretty good job with it too. =)
PEZ
Yeah, markdown made a pretty good effort. :)
Bill the Lizard
It seems like you could write a shorter version of this, but it would go against the spirit of the language. I like it!
Greg
Another gold badge on the way Bill?
OscarRyz
I don't think it will even get to silver. The question would have to be on the front page for days, and I don't see that happening here.
Bill the Lizard
I stand corrected on the silver.
Bill the Lizard
+15  A: 

Malbolge[1][2]:

(=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**
 hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O< 

Takes the longest time to understand ;)

wishi
+32  A: 

Love the Ook sample, but (on a more serious note) I seemed to remember the Hello World in c on early windows platforms being a nightmare. Does this count? (I'd to dig for a while for this, have no idea as to it's veracity)

LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstanc, LPSTR lpCmdLine, int iCmdShow)
{
    HWND hwnd;
    MSG msg;
    WNDCLASSEX wndclass;

    wndclass.cbSize = 
        sizeof (wndclass);
    wndclass.style = CS_HREDRAW |    
        CS_VREDRAW;
    wndclass.lpfnWndProc =   
        WndProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = 
        hInstance;
    wndclass.hIcon = 
        LoadIcon (NULL, 
        IDI_APPLICATION);
    wndclass.hCursor = 
        LoadCursor (NULL, 
        IDC_ARROW);
    wndclass.hbrBackground = 
        (HBRUSH) GetStockObject
        (WHITE_BRUSH);
    wndclass.lpszMenuName = NULL;
    wndclass.lpszClassName = 
        "HellowWorld";
    wndclass.hIconSm = 
        LoadIcon (NULL, 
        IDI_APPLICATION);

    RegisterClassEx(&wndclass);

        hwnd = 
        CreateWindow("HelloWorld", 
        "Hello World Program",
        WS_OVERLAPPEDWINDOW, 
        CW_USEDEFAULT, CW_USEDEFAULT, 
        CW_USEDEFAULT, CW_USEDEFAULT, 
        NULL, NULL, hInstance, NULL);

    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);

    while(GetMessage(&msg, NULL, 
        0, 0))
    {
     TranslateMessage(&msg);
     DispatchMessage(&msg);
    }
    return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
    HDC hdc;
    PAINTSTRUCT ps;

    switch (iMsg)
    {
    case WM_PAINT:
     hdc = BeginPaint(hwnd, 
             &ps);

     TextOut(hdc, 0, 0,  
              "Hello World!", 12);

     EndPaint(hwnd, &ps);
     return 0;
    case WM_CHAR:
        case WM_LBUTTONDOWN:
              MessageBox (hwnd, "You 
              Clicked me!", "Hello 
              World", 
              MB_ICONEXCLAMATION);
              RETURN 0;
       case WM_DESTROY:
     PostQuitMessage(0);
     return 0;
       }
       return DefWindowProc(hwnd,  
       iMsg, wParam, lParam);
}

It does a little more than just print "hello world", but only a little

Binary Worrier
Ha, yeah, I still have the old Petzhold Bible on my bookshelf when I was mental enough to code like this :-) I even did Windows Assembly for a while :S
Steven Robbins
I'm accepting this answer because it is the longest in a "real" language.
Kip
That's staggering. I feel really lucky to have avoided that era and arrived in programming as Java was taking off.
Marcus Downing
Whats wrong with MessageBox()?
jheriko
@Marcus Downing: Now you just have to generate language boilerplate instead of OS boilerplate, class public static int anyone?
Matt Joiner
+12  A: 

Master Programmer's version

[
  uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
  ]
  library LHello
  {
      // bring in the master library
      importlib("actimp.tlb");
      importlib("actexp.tlb");

      // bring in my interfaces
      #include "pshlo.idl"

      [
      uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
      ]
      cotype THello
   {
   interface IHello;
   interface IPersistFile;
   };
  };

  [
  exe,
  uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
  ]
  module CHelloLib
  {

      // some code related header files
      importheader(<windows.h>);
      importheader(<ole2.h>);
      importheader(<except.hxx>);
      importheader("pshlo.h");
      importheader("shlo.hxx");
      importheader("mycls.hxx");

      // needed typelibs
      importlib("actimp.tlb");
      importlib("actexp.tlb");
      importlib("thlo.tlb");

      [
      uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
      aggregatable
      ]
      coclass CHello
   {
   cotype THello;
   };
  };


  #include "ipfix.hxx"

  extern HANDLE hEvent;

  class CHello : public CHelloBase
  {
  public:
      IPFIX(CLSID_CHello);

      CHello(IUnknown *pUnk);
      ~CHello();

      HRESULT  __stdcall PrintSz(LPWSTR pwszString);

  private:
      static int cObjRef;
  };


  #include <windows.h>
  #include <ole2.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include "thlo.h"
  #include "pshlo.h"
  #include "shlo.hxx"
  #include "mycls.hxx"

  int CHello::cObjRef = 0;

  CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)
  {
      cObjRef++;
      return;
  }

  HRESULT  __stdcall  CHello::PrintSz(LPWSTR pwszString)
  {
      printf("%ws
", pwszString);
      return(ResultFromScode(S_OK));
  }


  CHello::~CHello(void)
  {

  // when the object count goes to zero, stop the server
  cObjRef--;
  if( cObjRef == 0 )
      PulseEvent(hEvent);

  return;
  }

  #include <windows.h>
  #include <ole2.h>
  #include "pshlo.h"
  #include "shlo.hxx"
  #include "mycls.hxx"

  HANDLE hEvent;

   int _cdecl main(
  int argc,
  char * argv[]
  ) {
  ULONG ulRef;
  DWORD dwRegistration;
  CHelloCF *pCF = new CHelloCF();

  hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

  // Initialize the OLE libraries
  CoInitializeEx(NULL, COINIT_MULTITHREADED);

  CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER,
      REGCLS_MULTIPLEUSE, &dwRegistration);

  // wait on an event to stop
  WaitForSingleObject(hEvent, INFINITE);

  // revoke and release the class object
  CoRevokeClassObject(dwRegistration);
  ulRef = pCF->Release();

  // Tell OLE we are going away.
  CoUninitialize();

  return(0); }

  extern CLSID CLSID_CHello;
  extern UUID LIBID_CHelloLib;

  CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */
      0x2573F891,
      0xCFEE,
      0x101A,
      { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
  };

  UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */
      0x2573F890,
      0xCFEE,
      0x101A,
      { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
  };

  #include <windows.h>
  #include <ole2.h>
  #include <stdlib.h>
  #include <string.h>
  #include <stdio.h>
  #include "pshlo.h"
  #include "shlo.hxx"
  #include "clsid.h"

  int _cdecl main(
  int argc,
  char * argv[]
  ) {
  HRESULT  hRslt;
  IHello        *pHello;
  ULONG  ulCnt;
  IMoniker * pmk;
  WCHAR  wcsT[_MAX_PATH];
  WCHAR  wcsPath[2 * _MAX_PATH];

  // get object path
  wcsPath[0] = '\0';
  wcsT[0] = '\0';
  if( argc > 1) {
      mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
      wcsupr(wcsPath);
      }
  else {
      fprintf(stderr, "Object path must be specified\n");
      return(1);
      }

  // get print string
  if(argc > 2)
      mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
  else
      wcscpy(wcsT, L"Hello World");

  printf("Linking to object %ws\n", wcsPath);
  printf("Text String %ws\n", wcsT);

  // Initialize the OLE libraries
  hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);

  if(SUCCEEDED(hRslt)) {


      hRslt = CreateFileMoniker(wcsPath, &pmk);
      if(SUCCEEDED(hRslt))
   hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&pHello);

      if(SUCCEEDED(hRslt)) {

   // print a string out
   pHello->PrintSz(wcsT);

   Sleep(2000);
   ulCnt = pHello->Release();
   }
      else
   printf("Failure to connect, status: %lx", hRslt);

      // Tell OLE we are going away.
      CoUninitialize();
      }

  return(0);
  }
hmemcpy
Ouch, COM you can not live withtout it ;-)
Friedrich
What programming demon thought this up?
RCIX
+25  A: 

I'd say DNA has the longest program. Look how much stuff it has to make to get someone to write a program that says "Hello world"! Or even just to say "Hello world"!

MSN

MSN
i was going to say the overhead of the .net framework would make a hello worl program pretty hefty, but it took a lot of dna to create .net in the first place so uh, paper beats rock.
rizzle
+6  A: 

I'd say a raw binary would be the worst... if you are using PE (i.e. a Win32 executable) you have to use at least a thousand bytes just to make the header comply with the spec, since the minimum alignment for sections is 512 bytes and you must include at least two (even though windows can load fine with much less, i.e. using much smaller alignment than you should).

jheriko
You mean, write it like The Real Programmer? lol!
Camilo Martin
+4  A: 

It's tough to write, by which I mean draw, a small Hello World program in Piet. The one shown here is probably not the smallest, but it may be relatively close.

MatrixFrog
A: 

gotta be .not surely - all that bloat?

fusi
What? Do you mean .Net?
mizipzor
That bloat makes you code less, in fact. The CPU and RAM hate .NET, but your brain will love it. Isn't Python also in the same road? Code less, do more, and throw the troubles to the CPU.
Camilo Martin
+4  A: 

Symbian ain't pretty:

http://wiki.forum.nokia.com/index.php/Understanding%5Fthe%5FSimple%5FHelloworld%5FSymbian%5Fproject

4 cpp source files, 6 header files, 2 resource files, 3 build files.

OK, so you could do without the resource files, and obviously you can pretty much just concatenate the source files. It's also possible to take some short cuts with the UI framework, or just write a Symbian console app.

But surely the point of a "hello world" isn't code golf, it's to demonstrate the things which an application developer will actually need to do, in a realistic scenario, in order to produce an output?

Steve Jessop
+1  A: 

It really has to be J2EE.

My first experience of the overkill that is EJBs was working through the IBM WAS 4.0 hello world application. (Complete with EJB and RMI) over 5000 lines of code (mostly generated) to pop "Hello World" on to a browser screen.

It would not have been so bad if the whole J2EE community werent so pleased with the whole sorry mess.

[Tutorial Here]
James Anderson
+3  A: 

Here's the shortest "serious" java hello world:

/* Hello World
*/

public interface MessageStrategy {
  public void sendMessage();
}

public abstract class AbstractStrategyFactory {
  public abstract MessageStrategy createStrategy(MessageBody mb);
}

public class MessageBody {
  Object payload;
  public Object getPayload() { return payload; }
  public void configure(Object obj) { payload = obj; }
  public void send(MessageStrategy ms) {
    ms.sendMessage();
  }
}

public class DefaultFactory extends AbstractStrategyFactory {
  private DefaultFactory() {}
  static DefaultFactory instance;
  public static AbstractStrategyFactory getInstance() {
    if (null==instance) instance = new DefaultFactory();
    return instance;
  }

  public MessageStrategy createStrategy(final MessageBody mb) {
    return new MessageStrategy() {
      MessageBody body = mb;
      public void sendMessage() {
        Object obj = body.getPayload();
        System.out.println(obj.toString());
      }
    };
  }
}

public class HelloWorld {
  public static void main(String[] args) {
    MessageBody mb = new MessageBody();
    mb.configure("Hello World!");
    AbstractStrategyFactory asf = DefaultFactory.getInstance();
    MessageStrategy strategy = asf.createStrategy(mb);
    mb.send(strategy);
  }
}
Tomas
Serious Business.
jleedev
+3  A: 

In 2008 I set the record for the shortest Hello world program written in Whirl, weighing in at a hefty 858 individually typed ones and zeros (the only instructions allowed). The next shortest version I found was posted by Kang Seonghoon in 2005, which consisted of a whopping 1330 ones and zeros. Nevertheless, here's my version. Enjoy?

110001100111000111110000010001111100011000000000110000011100000110000010000011000111100000111110000011100001111100100011001110000111111100001001111100011000000000110000011000111110001000000000000000000001001111110000111111000100000000000000000000000000011111000100100000000111111000100000000000001001000011111000001110000111110010001100011000000100010000011000000000000000001100000111001111100111111000100111001111000011100010011111110000111000110000000000000000000000000000000001000100001111100000111000011111001100011100000111000000010001111100000111110001000000000111000110000000000000000000000000000000100100001111100000111000011100010000000000000100010000111110001110001111100111111000011100001100111000111000000000001111100000111000110000110110001000000000010000001111100000111000011111000000010001110000000000000000000000000000000100000011111000001100

Oh, and if you think I'm making this up, I invite you to try my code on Victor Ortiz's flash-based Virtual Whirl Machine. Needless to say, that is one afternoon I'll never get back...

0x24a537r9
Pretty damn cool. :D
Dian