13

Possible Duplicate:
Where should the comma be placed in the salutation of a letter?

I was thinking today about comma usage and the typical first output for a beginning programmer. In the typical example you see "Hello World" but does proper sentence construction/comma usage rules dictate there be a comma between the greeting and the thing being greeted.

I.e. should a proper sentence read "Hello, World"?

27
  • 1
    I voted off topic. It's not general reference; there is no general reference on comma usage, and it's not about English grammar and usage because it's about punctuation. It's hard to choose sometimes. Commented Jul 18, 2012 at 16:06
  • 4
    +1 I can't see that it's off-topic. English grammar includes punctuation; there's a reason why we have the punctuation tags. It's also not really gen ref, for the reason Prof. Lawler pointed out. Not Constructive is the closest bet, I'd say; but I can't bring myself to vote to close this one. I was almost about to say there has to be a duplicate of this somewhere, but I would like to sound rather less trigger-happy.
    – Daniel
    Commented Jul 18, 2012 at 16:21
  • 4
    I searched for duplicates before I posted this. And sure, people don't put the comma in a salutation but shouldn't they? If the answer is "no" that is perfectly acceptable.
    – Brad
    Commented Jul 18, 2012 at 16:23
  • 3
    @Carlo_R. How can you vote on questions you've never seen? Anyhow, everyone who only voted on the best post they ever saw would only vote once.
    – Daniel
    Commented Jul 18, 2012 at 17:01
  • 2
    And remember, since it looks like it really is a duplicate, that closing as a duplicate (especially an obscure and non-obvious one) is the most honorable of the close reasons :)
    – Daniel
    Commented Jul 18, 2012 at 19:28

3 Answers 3

5

Whilst according to my memory inserting the comma is technically correct, it is now rarely seen in everyday communications. I favour Hello World, therefore.

0
5

Conventional orthography demands:

Hello, world!

but, given the context, it doesn't really matter what you type. In my experience, the following is common:

Hello world

Since a "Hello world" program terminates immediately after printing its message, I personally prefer:

Goodbye, world.

4

For what it's worth, Wikipedia calls it the "Hello world" program, but indicates there should be a comma in the output:

A "Hello world" program is a computer program that outputs "Hello, world" on a display device.

Other sources make this two-word phrase an exclamation:

Lesson: A Closer Look at the "Hello World!" Application

Now that you've seen the "Hello World!" application (and perhaps even compiled and run it), you might be wondering how it works. Here again is its code:

class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}

Other times, both the comma and the exclamation point are used:

Hello, world! programs make the text "Hello, world!" appear on a computer screen.

Incidentally, this website lists several Hello world programs, most of which use both the comma and the exclamation point, although there are a few exceptions, like this one:

xhello db 'Hello world !!!$'

Ultimately, though, in this context, it matters very little what's between the quotation marks, so long as the program runs.

1
  • +1 for actually answering and addressing the concerns of the initial reaction to remove the question. This is what I was looking for.
    – T. Markle
    Commented Apr 13, 2014 at 4:11

Not the answer you're looking for? Browse other questions tagged .