.net 6 + c# 10 is a blast to work with !

I double dare you to create hello world with less lines :) (It's actually 1 line in .net 6)

  • 5
    I'm honestly not sure how I feel about this. Note I've done .net since 2.0
  • 5
    @jespersh Well, that’s their « demo » for c#10. If you start touching it, you will need to reintroduce program class.
    But there are really nice things.
    For example, we used to write :
    Namespace bla {

    Now it’s
    Namespace bla;

    1 tab (or 4 spaces) won per line in the file. Because I never in my life saw 2 different namespaces in the same file.
    Global usings : NOICE ! I put System, System.Text, LinQ etc in a global usings file, no need to import them in every class.
    (I joined c# dev around .net 1.1, but it was LinQ introduction what convinced me to go 100% c# vs Java or C++)
  • 1
    Implicit main was around in 9, I think.

    The flat namespace declaration is cool, though, looks like the flattened using.
  • 2
    A hello world in one line? Scheme, Common Lisp, Perl, Python, Ruby, JS, PHP, Bash,powershell and the list goes on my G, but I do like .net so rock on!
  • 5
    I see your 1 line code, here is mine:

    So, have you seen it?
    Yes, 0 lines, 0 bytes. In Stuck, an empty program compiles to Hello World: https://esolangs.org/wiki/Stuck/....
  • 1
    Hey, you got two lines there!
  • 1

    alrighty then.
  • 0
    // Program.fs
    printfn "Hello, World!"
Add Comment