3
n1cK1337
24h

The effort it takes in C# to go from zero to 'Hello World' is comparable to converting to some obscure cult.

Comments
  • 6
  • 4
    using System;

    namespace HelloWorldApp {

    class Program {

    static void Main(string[] args) {

    Console.WriteLine("C# is retarded and so is ObjEcT OrieENtEd PrograMMing");

    }

    }

    }
  • 7
    Can seem that way. My C# lizard brain is just above the 'Hello World' project. I wrote a function that prints 'Hello World'

    We had a need to update a db table at EOD, so my boss (brilliant dude) wrote a custom C# process executor (you create the class, with the code you want executed) that is instantiated from within a Docker container, that runs inside another container (TL;DR) on/in our container environment. He essentially wrote Azure Functions from scratch for this specific project, complete with thread mgmt/scheduling, and the works. Even wrote an extension so you could create+execute jobs from your local workstation if you needed to debug "the cloud".

    When I asked "If all we needed to is update the ABC table, why not create a console app, write the update script, and run the app on a schedule?"

    <puzzled look>

    S: "I don't know, there wasn't any other way to do it"
  • 4
    @PaperTrail that's a cool very random story. Have my upvote.
  • 2
    @donkulator with zero I mean a normal software engineer's computer whose only Microsoft code it has ever seen was Office and Excel.
  • 4
    C# is okay, but the Microsoft documentation has a weird feel to it. It feels like a bizzaro communication style for some reason.
  • 1
    the only supported version of C# where this is still the case is the 4.x branch, which is going the way of COBOL and is in no way similar to modern .NET; you're complaining about the legacy version of a language that has already moved on to better problems in the main branch.
  • 1
    @PaperTrail your boss has mastered thinking at scale about problems that are one-off and pocket-sized.
  • 2
    @Demolishun in middle school when we started programming I used to read MSDN in the evenings, it was very casual and clear for an utterly clueless maths nerd, and the examples explained pretty well why each language feature is useful.
  • 1
    @n1cK1337 Which languages are less effort?
  • 3
    To be fair, the size/effort for a minimal program is probably the least important property that a language can have.
  • 0
    Meanwhile, java can already do this:

    void main() {

    System.out.println("Hello, World!");

    }
  • 2
    @BordedDev modern c# can just do

    Console.WriteLine("Hello World!")

    it'll automatically get wrapped in a class and a method.
  • 1
    @lorentz Top level statements are an abomination in the face of nature.
  • 2
    @donkulator Classes are an illusion, there are just structs and functions ;P
  • 2
    It’s just as bad as Java and only slightly worse than c.

    However, Microsoft has heard your woes. There’s an option in visual Studio called top-level statements. This makes it so that you don’t even need a main function, you can start writing code directly in the file like a python project or similar

    I don’t use them because
    -writing namespace and class is not very hard
    -top level statements look weird
  • 1
    @BordedDev all my classes have the faschizzel. All my classes are dope dealers and hang out in leather jacks and skinny jeans.
  • 1
    @donkulator no, it’s great for scripts!
  • 2
    @donkulator top-level statements are useful if the top level program counter is useful, so typically in tools that do a well-defined task in a series of distinct stages and then halt.

    In a program that spends a few seconds starting and stopping and days in between processing requests, the part readers should be focusing on is the dispatch mechanism, so top level statements don't contribute anything.

    Top level statements in files other than the main entry point are awful. There was a time when C# didn't allow them, and I worry they relaxed the rules only to mitigate the equally bad idea of forcing every helper function into a class.
Add Comment