✅ Having trouble going from the old syntax to top level statements
i have been learning C# using the old syntax. i do not know the name for it, but this is what it is:
but now that i have started working on Visual Studio, i am having a hard time learning what is the meaning of top level statements. So, how to think about this, considering that i have learnt my basics over Notepad?
7 Replies
that you can simple check that and not use top-level statements and just use the old way which is better anyway.
Use TLS if you don't wanna write Main function always . TLS just allows you to quickly prototype. Nothing more about it. Many people still prefer the old way
i too would prefer using the old way
but i have to learn top level statements just in case
Top-level statements - programs without Main methods - C#
Learn about top-level statements. You can create programs without the ceremony of a Program class and a Main method.
You absolutely dont need to learn it, it can be helpful in some scenarios where u just want to skip and write code as if u were scripting c# like python etc.
okay!!