这几乎是常识:当 Core Foundation 提供您需要的功能时,请使用它。当未提供适当的内容时,请使用您自己的数据结构。
It's pretty much common sense: Use Core Foundation when it provides the functionality you need. Use your own data structures when something appropriate has not been provided.
I think it depends a bit on the specific requirements of the application. If you end up spending too much time implementing the C data structure instead of working on the actual problem, then your best bet is to work with an already existing data structure.
Also, data structures from a good library are generally well tested and can save you a lot of debugging time.
However if, for example, you are thinking in working on a specific behavior of a red black tree algorithm in order to tackle your problem, then indeed you should better write your own version.
发布评论
评论(2)
这几乎是常识:当 Core Foundation 提供您需要的功能时,请使用它。当未提供适当的内容时,请使用您自己的数据结构。
It's pretty much common sense: Use Core Foundation when it provides the functionality you need. Use your own data structures when something appropriate has not been provided.
我认为这有点取决于应用程序的具体要求。 如果您最终花费太多时间实现 C 数据结构而不是解决实际问题,那么最好的选择是使用现有的数据结构。
此外,好的库中的数据结构通常都经过良好的测试,可以节省大量调试时间。
然而,例如,如果您正在考虑研究红黑树算法的特定行为来解决您的问题,那么您确实应该更好地编写自己的版本。
I think it depends a bit on the specific requirements of the application. If you end up spending too much time implementing the C data structure instead of working on the actual problem, then your best bet is to work with an already existing data structure.
Also, data structures from a good library are generally well tested and can save you a lot of debugging time.
However if, for example, you are thinking in working on a specific behavior of a red black tree algorithm in order to tackle your problem, then indeed you should better write your own version.