golang日記

来源:互联网 发布:淘宝卖蚕丝被 编辑:程序博客网 时间:2024/06/10 14:23

首先, 为什么要弄new和make, 我觉得可能是历史原因
stackoverflow上也有相关提问

The introduction documents dedicate many paragraphs to explaining the difference between new() and make(), but in practice, you can create objects within local scope and return them.

Why would you use the (frankly silly) pair of allocators?

继上篇文章的slice和Java的arraylist的异同, 我进行搜索, 我开始思考, 这可能一个语言体制的差异.

在wiki上, 我看到golang属于C家族, 换言之, 对编程的态度可能也是挺不同的.

Java语言让程序员不用这么在乎内存问题, 而C家族则没有让程序员忽视分配内存问题. 也可能是造成new和make的出现的原因