Lead Software Engineer, podcaster, drummer, photographer. Neutral Good Geek.
Salesforce Certified Developer ☁ and Lead Software Engineer at Salesforce.
I understand the objective and the reasoning behind the suggestions, but we shouldn't be totally against the usage of delete.
It can still be useful in situations where you absolutely need to remove a property from an object before an operation, and the object will no longer be used after this operation.
In this case, personally it seems to be a lot more straightforward than the functional approach you've described. Thoughts?
If you absolutely need to remove a property from an object before an operation and the object will no longer be used after this operation. Why don't use a new object that will no have this property instead of delete it from the original object? If you have any things that depend on this property you will create bug and side effects! If you create a new one, you will not :D
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I understand the objective and the reasoning behind the suggestions, but we shouldn't be totally against the usage of
delete
.It can still be useful in situations where you absolutely need to remove a property from an object before an operation, and the object will no longer be used after this operation.
In this case, personally it seems to be a lot more straightforward than the functional approach you've described. Thoughts?
If you absolutely need to remove a property from an object before an operation and the object will no longer be used after this operation. Why don't use a new object that will no have this property instead of delete it from the original object? If you have any things that depend on this property you will create bug and side effects! If you create a new one, you will not :D