Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6225991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:56:44+00:00 2026-05-24T08:56:44+00:00

I see a lot of functional programming related topics mention destructive updates. I understand

  • 0

I see a lot of functional programming related topics mention destructive updates. I understand that it is something similar to mutation, so I understand the update part. But what is the destructive part? Or am I just over-thinking it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:56:44+00:00Added an answer on May 24, 2026 at 8:56 am

    You’re probably overthinking it a bit. Mutability is all there is to it; the only thing being “destroyed” is the previous value of whatever you mutated.

    Say you’re using some sort of search tree to store values, and you want to insert a new one. After finding the location where the new values goes, you have two options:

    • With an immutable tree, you construct new nodes along the path from the new value’s location up to the root. Subtrees not along the path are reused in the new tree, and if you still have a reference to the original tree’s root you can use both, with the common subtrees shared between them. This economizes on space with no extra effort if you have lots of slightly-different copies floating around, and of course you have all the usual benefits of immutable data structures.

    • With a mutable tree, you attach the new value where it belongs and that’s that; nothing else has to be changed. This is almost always faster, and economizes on memory allocation if you only ever have one copy around, but anything that had a reference to the “old” tree now has a reference to the new one. The original has been destroyed; it’s gone forever. If you need to keep the original around, you have to go to the expense of creating an entirely new copy of the whole thing before changing it.

    If “destruction” seems an unnecessarily harsh way to describe a simple in-place update, then you’ve probably not spent as much time as I have debugging code in order to figure out where on Earth some value is being changed behind your back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm programming Windows COM in C++ and I see that a lot of functions
I see a lot of code similar to the following var customrs = MyDataContext.Customers.Where(...);
People at my company see unit testing as a lot of extra work, that
I see a lot of talk on here about functional languages and stuff. Why
I see a lot of example code for C# classes that does this: public
I understand that a lot of people here complain about strcpy, but I haven't
I have a question regarding declarative programming, to see how well I understand the
I see lot of new machines and laptops now having 64 bit hardware and
I see a lot of JDK 1.6 notes about how to open an HTML
I see a lot of people are using code under viewDidLoad to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.