in ,

Struct with “main method” as an entry point, Hacker News


Struct with “main method” as an entry point

7 Nov 2019 ***********.NET, .NET Core, C #

Have you ever thought about the most basic structure of an application? Themain methodand its placement inProgramclass

Today as I was creating yet another console app to test something (boxing of structs, in case you’d like to ask) I looked at theclass Programpiece and tried to rewrite it tostruct. Just to try it. Would it work? Given themaindoes not even have to bepublicand it’sstatic, which works forstruct, it probably should, right?

struct Program { static void Main (string [] args) { Console.WriteLine ("Hello struct!"); } }

Trying to compile this simple piece of code works like a charm. Are you asking what this might be useful for? I don’t have an answer. I think it does not have any real useful application. But this made me look up“specification” of whatmain methodshould look like, at least.

Profile PictureJiří Činčura is an independent developer focusing on data and business layers, language constructs, parallelism and databases. Specifically Entity Framework, asynchronous and parallel programming, cloud and Azure. He’s Microsoft Most Valuable Professional and you can read his articles, guides, tips and tricks at www.tabsoverspaces.com.

Brave Browser
Read More
Payeer

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Outrage as US rapper TI says he has daughter's hymen checked annually – The Guardian, Theguardian.com

Outrage as US rapper TI says he has daughter's hymen checked annually – The Guardian, Theguardian.com

jvilk / BrowserFS, Hacker News

jvilk / BrowserFS, Hacker News