I’m trying to work on some C# stuff to test out some things in the latest rev of VS (2005 march preview etc etc). C# is so damned confusing for a VB programmer. Most of my build errors are due to capitalization problems for forgetting to put () at the end of method calls.
The whole static void thing is insane – not that there is something wrong with it. Just that it’s really hard to understand how it works and what it friggin’ wants from me :-). Like not being able to call a class’s method from inside of the starting point (static void main) of an app. I bet this is a very common error message for newbies:
“An object reference is required for the nonstatic field, method, or property”
I’m doing extremely simple stuff, it’s taking me forever, but I gotta get over this hump sometime…
I have a lot of respect for people that have a lot of VB experience who have learned how to program in C#. I don’t have the patience because I don’t have the time when I could just do this in VB and have been done with my stupid 10 lines of code an hour ago. Oh well.
update: I did finally grok the static calling non-static thing and that if you want to do that you need an object that owns the non-static method. But really, it made me dizzy. A good explanation (for me at least) was found in this thread in the C-Sharp Station forums.
Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!