Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: Remove the "new" keyword because there is no "delete". #148

Closed
gopherbot opened this issue Nov 13, 2009 · 1 comment
Closed

proposal: Remove the "new" keyword because there is no "delete". #148

gopherbot opened this issue Nov 13, 2009 · 1 comment

Comments

@gopherbot
Copy link
Contributor

by nicolas.b.pierron:

In C: You have an allocation (malloc, ...) and a deallocation (free).
In C++: You have an allocation (new) and a deallocation (delete).

If you remove the deallocation from the view of the user, why are you keeping the
allocation?  
From the user point-of-view, you break the symmetry of the allocation by removing the 
deallocation.  If you are trying to hide your garbage collector by making it as smooth
as 
possible, then why are you trying to inform developers about the garbage collector by
keeping 
this broken symmetry?

Java already made this choice and the consequence is that Java programmers may have 
difficulties to change to C++ if they are not aware of deallocation.

To ease the life of recruiter (in 10 years) and to clarify programmers ideas of
allocation, I 
suggest to remove the "new" keyword which is just a syntactic sugar over the
an empty initialization of a structure.
@agl
Copy link
Contributor

agl commented Nov 13, 2009

Comment 1:

The bug tracker is best suiting to recording precise issues. These sorts of ideas are 
better suited to mailing lists. So I'm closing this issue as an administrative matter, 
not because I'm rejecting the idea out of hand.
However, new(*T) is difficult to replace with initialisation syntax. (Or new(**T) etc)

Status changed to Invalid.

@mikioh mikioh changed the title Proposal: Remove the "new" keyword because there is no "delete". proposal: Remove the "new" keyword because there is no "delete". Aug 31, 2015
@golang golang locked and limited conversation to collaborators Sep 4, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants