Most common or vicious mistakes in C# development for experienced C++ programmers

后端 未结 13 1501
没有蜡笔的小新
没有蜡笔的小新 2020-12-23 19:10

What are the most common or vicious mistakes when experienced C++ programmers develop in C#?

13条回答
  •  滥情空心
    2020-12-23 19:44

    Thinking that "garbage collection" = "I never have to worry about object lifetime at all". For instance, opening a FileStream and forgetting to close it.

    Or:

    1. Allocating a lot of objects
    2. Putting them in a big global dictionary (usually after "I know, I'll make a cache")
    3. Wondering why the application's memory usage always goes up and never down ("but it's supposed to garbage collect!")

提交回复
热议问题