You are viewing a single thread.
View all comments View context
4 points

Immutable members. Set in constructor then read only. The Builder pattern is acceptable if you’re language is an obstacle.

permalink
report
parent
reply
7 points

found the functional programming purist

permalink
report
parent
reply
1 point

permalink
report
parent
reply
3 points

So do you create new objects every time you need to change state?

permalink
report
parent
reply
3 points

You avoid having mutable state as much as possible. This is a pretty standard concept these days.

permalink
report
parent
reply
2 points

Can you please give me an example - let’s say I have a big list of numbers and I need to find how many times each number is there.

I would expect a mutable dictionary/map and a single pass through. How would you do that without mutable datastructure?

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 3.7K

    Monthly active users

  • 1K

    Posts

  • 38K

    Comments