is there any difference between C# (unity) and desktop?

Hi…

I´m currently using C# for Unity, and i was wondering Why not to use c# for Desktop development ?..

is there any difference between them?..
I only know that void main () is the same to void start ()

Thanks

You’re confusing the language with the libraries.

C# is the programming language. It’s (for all practical purposes at least) the same across gaming, desktop, and web applications.

What differs is the library or framework used to develop the application. Unity provides its own framework exposed through a set of classes (anything in the UnityEngine namespace). Regular desktop applications on Windows are programmed using either Windows Forms or Windows Presentation Foundation. Each has its own layout, own events, and own entry point into the program.

tl;dr: Yes, there’s a huge difference between them that goes far beyond having main() in one and Start() in the other.

I’d also like to point out that many things you do in unity are not likely to be done (for example) in windows forms. In unity you need to use getcomponent to access other gameobjects and/or their fields, while normal c# would let you use those just by pointing a reference to that specific class/field/member name.
Methods like OnCollisionEnter / Stay / Exit are called by the engine with c++, elseway you would access them from their original class/instatiated object of the same type in general c# programming.
Yeah I’d say unity gives you a way to program well with c# but many things are different for desktop apps

all clear… !!! undestood everything… thank you!