Good exercises to transition from coding in VB.NET to C#?

前端 未结 10 778
滥情空心
滥情空心 2021-01-19 01:48

What are some good exercises that an intermediate/advanced VB.NET web programmer should to do gain syntax chops on C#?

I imagine some good examples would be:

相关标签:
10条回答
  • 2021-01-19 02:26

    I made the trasition by taking one of my hobby projects that was done in VB.NET and re-write it in C#. That got me started in a good manner; learning the syntax while working in a known problem domain, while also providing real-world problems to solve.

    0 讨论(0)
  • 2021-01-19 02:26

    Play with your own code using an automatic converter.

    It should work fairly well for most things. You'll mostly just need to figure out how to rework lambdas and some other situations like that.

    Reflector is also very good to help you figure out how to play with converting your code.

    As for learning the differences, see MSDN's white paper on this. It's a bit out of date, but a good starting point. A more complete, but less textual reference-like comparison, is available here.

    0 讨论(0)
  • 2021-01-19 02:27

    Practice forgetting VB.NET [:)], then learn C# as a usual person would learn. I don't think VB.NET-coders have some special way of learning C#... You'll just be familiar with the .NET class library, it's a plus.

    0 讨论(0)
  • 2021-01-19 02:28

    If you have a basic grasp of the language, I would recommend working through project Euler (http://projecteuler.net/) in C#. It starts out very easy and slowly becomes more and more difficult, requiring you to learn more about the language [you are using to develop the solutions] in order to solve the problems.

    It may make sense to pick up a C# reference book, if you haven't already.

    I think you will be surprised how quickly you transition.

    0 讨论(0)
提交回复
热议问题