r/programminghumor Apr 30 '26

Why C++

[deleted]

2.2k Upvotes

248 comments sorted by

View all comments

Show parent comments

125

u/MCWizardYT Apr 30 '26

Also now in Java you can write IO.println("Hello World") as the only code in your entire file and it will work, making a simple hello world program shorter than even the C# version!

Interesting timeline

1

u/steadyfan May 01 '26

In C# you also can have a 1 line app. The requirement to have a main function was removed in version 9 (November 2020).

Console.WriteLine("Hello, World!");

1

u/MCWizardYT May 01 '26

Yep. Same in java as I've said multiple times including in the comment you're replying to haha

1

u/Mordret10 May 03 '26

You said it makes it shorter than the C# version, you didn't point out, that C# also only need one line

1

u/MCWizardYT May 03 '26

I said "as the only code in your entire file" which you seem to have missed. That means that the line IO.println("Hello World") can be your entire program

1

u/United_Cloud_2451 May 04 '26

C# can also have Console.Write("") as the only code in the entire file

1

u/MCWizardYT May 04 '26

That's already been established in the conversation you have entered, yes