Most common or vicious mistakes in C# development

2020-02-16 19:48发布

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

标签: c# c++
13条回答
2楼-- · 2020-02-16 20:48

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!")
查看更多
登录 后发表回答