Misplaced Pages

Talk:"Hello, World!" program

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
This is the talk page for discussing improvements to the "Hello, World!" program article.
This is not a forum for general discussion of the article's subject.
Article policies
Find sources: Google (books · news · scholar · free images · WP refs· FENS · JSTOR · TWL
Archives: 1, 2Auto-archiving period: 31 days 
This  level-5 vital article is rated C-class on Misplaced Pages's content assessment scale.
It is of interest to the following WikiProjects:
WikiProject iconComputing Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Misplaced Pages. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.ComputingWikipedia:WikiProject ComputingTemplate:WikiProject ComputingComputing
LowThis article has been rated as Low-importance on the project's importance scale.

Do we really need examples of "Hello, World" in that many select languages?

I can't tell if there is consensus around this, but I don't think we need to have examples of the Hello, World! program in that many languages. It appears that most other articles uses either C or C++ for examples. Shouldn't this article follow that convention? ThatIPEditor 17:48, 14 October 2022 (UTC)

This has gone back and forth. See Misplaced Pages:Articles_for_deletion/List_of_Hello_world_program_examples and a pretty big number of threads in Talk:"Hello,_World!"_program/Archive_1. It used to have lots of examples, they were removed. And then in September 2021 the examples section was re-created and it's been growing since then: Special:Diff/1044294394. I don't have a super strong opinion other than I've removed some very non-notable ones and tried to keep to simplest possible style but I'd be open to a discussion about possibly removing the list or at least cutting it down in size. Skynxnex (talk) 18:39, 14 October 2022 (UTC)
No, we do not need that many examples. It does not aide the reader’s understanding what a Hello, World program is. I have now artificially restricted the set of examples to programming languages with an ISO standard. I would even contest that we need any Examples section at all, because you can find all examples in the respective programming language’s Misplaced Pages article. There you can find explanations, too, which is missing here. Code without explanation/comments is bad. ‑‑ K (🗪 | ) 14:09, 14 November 2022 (UTC)
@Kai Burghardt I've been trying to have time to think through what I think is the best rule/restriction of languages to have in the examples section. Thank you for trying something but I think that the ISO standard is too restrictive in a non-helpful way, partly since more recent languages are much less likely to have an ISO standard than earlier languages. Also noticing in my watch list, it definitely seems like it will forever be an on-going addition/revert/addition/revert from various different users. I don't have a solution for it now but I will try to propose a different rule for the set and maybe how to make it less inviting for people to add more. Although, for many new users of Misplaced Pages being able to add an example of their favorite language is, I'm sure, very tempting. Happy editing. Skynxnex (talk) 18:40, 1 December 2022 (UTC)
@Skynxnex: I don’t think we need to cover recent programming languages. It’s perfectly fine that there is, for example, no Q# – a quantum-computing oriented language – example. The tenacity of ISO standards – the time it takes for drafting and approving a standard – is actually a pretty favorable characteristic. This will prevent us from unnecessarily documenting ephemeral programming languages like – I don’t know – TrumpScript.
   What if we restrict the set to programming languages listed in {{programming languages}}? However, it seems to be an alphabetical list clipped at the (now) 33rd item, and a brief look at the template’s revision history shows there’s been a back and forth, too. Arguably not the best source for limiting the set of examples.
   Another “creative”, yet poor idea for an encyclopedia is to wrap all examples as alternatives for {{random item}}. The page stays short, only one example is displayed , and everyone can still contribute their favorite programming language’s example.
   I think, I’ll keep it the way it is now unless you or ThatIPEditor have some brilliant suggestion. If things get too stupid for me (constant re-addition of some programming language), I’ll replace the entire section with a link to Wikibooks: Computer Programming/Hello world (there’s already a link to that at the bottom).
‑‑ K (🗪 | ) 21:04, 1 December 2022 (UTC)
To be honest, I think it is a good and valid idea to replace the entire section, and all sections with examples in random languages with a link to wikibooks. There are practically infinite languages out there, and it is very... improper to have a huge list of examples. ThatIPEditor 03:00, 4 January 2023 (UTC)
The list of examples are quite literally longer than the rest of the article. ThatIPEditor 03:01, 4 January 2023 (UTC)
@Skynxnex, ThatIPEditor, and Andy Dingley: Another alternative idea: How about strict enforcement of the cite reliable sources policy? Currently almost all examples lack a source. I have observed several micro-edits because “some” version was supposedly “better”. If we say there have to be sources corroborating that certain code is “the” HW in the respective language, there would be less ambiguity.
My problem with that approach, however, is, well, I’ve browsed a couple (printed and published ≈ reliable) programming language teaching books and they do not include a HW (but maybe there are suitable sources anyway). Also I can anticipate that eventually this approach will bloat the Examples section again, since it does not perform a selection on eligible programming languages. Comments? ‑‑ K (🗪 | ) 09:30, 1 September 2023 (UTC)
Sourcing is not the issue here. Andy Dingley (talk) 10:18, 1 September 2023 (UTC)
Thanks for the ping. I guess your proposal is kind related to apply the concept of WP:DUEWEIGHT? I'm not sure how it'd workout, exactly, and we'd probably end up with a lot languages that are conceptually pretty similar, so I'm not sure it'd be an improvement. I think, in general, similar to plot descriptions, we don't require reliable sourcing but I think if there is a disagreement about how to micro-style some example, including sourcing in those cases could help resolve it. Skynxnex (talk) 16:14, 1 September 2023 (UTC)
@Andy Dingley: Well, enforcing a reliable sources requirement will exclude programming languages that have not gained a significant user base, like, I do not know TrumpScript, because no reliable sources have been created. Most are self-published, blogs, etc., something you cannot write an encyclopedic article with.
I’m afraid a central “List of HWs” article will eventually suffer from WP:EXPENSIVE. The German WP has adopted that approach. They have not reached the limit (yet), but over at RC their HW article has that problem.
@Skynxnex and Andy Dingley: I have replaced § Examples with a list of links to Misplaced Pages articles now. This is meant to serve as a “deterrent.” As above my main argument is that unexplained code is bad, so explanations must be added, but this is already done by the respective programming languages’ articles (see above for an earlier comment of mine). The list is pretty long, though (maybe wrap in {{hidden}}?). Do you think this is better? ‑‑ K (🗪 | ) 20:40, 6 September 2023 (UTC)
  • This is probably worse now than it was. All of the supposed constraints for inclusion put forward recently seem irrelevant. In particular, this new list just looks like a justification for "Please throw yet more examples at this page".
This page needs simple criteria for inclusion: Does it make this page better?
Not "Is this langauge meeting some external test, such as an ISO standard?" Not "Is there a HW example already available on a linked page?". Certainly not, "Have I just learned this language in class?"
So in terms of benefit to this article, that should be in terms of factors such as:
  • Historical relevance (so B & K&R C are in)
  • Demonstrating some aspect of why HW was considered a useful attainment. So Assembler (almost any, but maybe 8086 so that a BIOS call is fairly simple) is in. CORAL 66 would be ideal too, if anyone still has one, or something equally gruesome from PL/1 or that era. An early FORTRAN (when Hollerith work was still onerous) would be good. COBOL definitely.
  • Some short list of examples to demonstrate evolution of general purpose languages. So some, maybe all from C dialects and derivatives, showing functional calls through to streamed output.
  • Anything obscurely weird. Common Lisp? XSLT?
But the point is that they should be chosen on their value to this article and the concept of Hello World as a pattern, and as an engineering struggle to achieve (which is now largely hidden by modern languages making the trivial actually trivial to achieve). Andy Dingley (talk) 01:31, 8 September 2023 (UTC)
@Andy Dingley: Well, let’s consider this a trial. So far nobody has inserted new Hello World source code. I claim this is due to the link list. However, we need to take into account the (auto‑)confirmed edit protection until May 23, so some “spam” is probably technically prevented. ‑‑ K (🗪 | ) 10:21, 14 October 2023 (UTC)
I've said it before and I'll say it now (Andy and I have had this debate in the past): while it's conceivable that having some examples of Hello World programs could make the article better, in practice having any examples apart from the B/C examples always devolves into an absolute mess. This is a recurring theme. A very strict editorial line has been the only thing that has kept this article maintainable over the years, but unfortunately it seems that every five years or so we need to relearn this lesson. The github EL linked in this very article is extremely comprehensive, and github (and sites like it) are ideally suited to hosting code. The list of links compromise here is a good idea, but even with just links, the list is already bigger than the rest of the article. My !vote is always: no source code in Wiki articles, and especially not in this article. And I'd extend that to the link compromise. The truth is, when you have no examples, it's much easier to justify saying no to the first one. When there are many, it's a constant battle. Eniagrom (talk) 07:17, 2 November 2023 (UTC)

Semi-protected edit request on 30 August 2023

This edit request to "Hello,_World!"_program has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

I want to add a example for a hello world in java because it is one of the most popular programing languages in the world. public class Main {

   public static void main(String args) {
       System.out.print("Hello World");
   }

} Doctor Notch (talk) 10:40, 30 August 2023 (UTC)

 Done M.Bitton (talk) 13:35, 30 August 2023 (UTC)
@M.Bitton: Java is apparently not standardized by an ISO standard. The § Examples says at its head the examples are limited to standardized programming languages. For more details read discussion § Do we really need examples of "Hello, World" in that many select languages? ‑‑ K (🗪 | ) 19:25, 31 August 2023 (UTC)
@Kai Burghardt: thanks for letting me know. I self-reverted. M.Bitton (talk) 21:57, 31 August 2023 (UTC)
  • "Has an ISO standard" is a poor selection criterion for this article. In both ways: it doesn't indicate that languages are relevant to the article (they add something to it, beyond trainspotting) and it's also an arbitrary restriction of relevant languages. As a clear example, assembler would be a good example to include, because it's so distinctly different from other languages and requires so much additional management of structures or API calls that is abstracted and hidden in high level languages.
A corollary of "examples must be chosen from ISO standards" is that "examples will be chosen from ISO standards" and that will simply produce a list of near-identical structures, adding nothing useful for this article's purposes. Andy Dingley (talk) 22:10, 31 August 2023 (UTC)
Yes, Andy, these are valid points, I agree with you, but this article’s Examples section dominated the entire article at multiple times in its revision history, see discussion above. Saying “ISO standard” is in particular an objective criterion. There is no debate whether some language needs to/can be included, too. I invite you to propose a different criterion. I just dislike criteria that are prone to edit wars (not clear) or not static (e. g. TIOBE index). ‑‑ K (🗪 | ) 08:58, 1 September 2023 (UTC)
Read the talk pages. I've been proposing criteria for this for years. I even supported the "List of ..." article, just to keep this one cleaner.
But without a strong statement here that says "Don't turn this into a gallery for the language you just learned at school", then this result is inevitable. Andy Dingley (talk) 09:05, 1 September 2023 (UTC)
 Undone: This request has been undone. M.Bitton (talk) 22:34, 31 August 2023 (UTC)

Semi-protected edit request on 11 December 2023

This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

Please add the article for "MATLAB" into the "Misplaced Pages articles containing 'Hello, World!' programs" list, between "Malbolge" and "Mercury". Kopper0625 (talk) 03:31, 11 December 2023 (UTC)

 Done RudolfRed (talk) 22:13, 11 December 2023 (UTC)

Semi-protected edit request on 5 February 2024

This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

In the section titled Misplaced Pages articles containing "Hello, World!" programs, please add an entry for the V language (just the letter V).

The full URL is https://en.wikipedia.org/V_(programming_language)#Hello_world 136.54.61.140 (talk) 03:27, 5 February 2024 (UTC)

 Done Tollens (talk) 04:36, 5 February 2024 (UTC)

Go and F# are missing

Go and F# are missing Mubed (talk) 08:49, 29 February 2024 (UTC)

 Done @Mubed. Skynxnex (talk) 14:11, 29 February 2024 (UTC)
Categories: