@postmodern indeed they do. I mean most languages attempt to handle the immutable problem in one way or another... I find most very lacking or ugly.
@multimeric Yea thats one solution, but thats a lot of additional code you now need to do, and doesnt give you the option of switching between mutable and unmutable versions without more code.
Again there are solutions, but most of them arent very elegant.
In an ideal world an object would be mutable by default, but can be made to be immutable. You pick what makes sense for the scenario. Ideally without needing to write a lot of boilerplate code. For this solution you'd need different methods entierly for the mutable way of changing an object vs the immutable change-and-copy way.
@multimeric The state is made of fields sure, but I usually dont want to manipulate the fields directly all in one place. Usually the fields would get manipulated through some methods attached to the object and usually in a way that will traverse many objects during the process. If I were dealing with a simple object with values then the problem wouldnt be much of a problem to begin with.
@freemo Off the top of my head, I think this would work pretty well if you use a frozen data class. Then in your manipulation methods you can use .replace (https://docs.python.org/3/library/dataclasses.html#dataclasses.replace) to do the manipulations without modifying the current instance. I think it would work well with subclasses as well because it will always be calling the current class constructor.
@multimeric That is a bit limiting since you can only specify fields. In an ideal world youd have a frozen class with methods that can do complex manipulations returning copies rather than being limited to dealing with fields.
You could of course always clone, modify, and refreeze.
But yea there are solutions (this being one of them)... none of them feel very elegant to me.
@freemo Yes, agreed. I've adopted a different mindset to classes; only use for very specific cases, plain functions are better.
@modrobert Im not sure i agree there either. Non-oo coding becomes a mess unless you employ class-like organization (structs or something) in which case your right back to the same immutability/mutability problem
Ya know the more I reflect on the languages I know the more I realize that outside of functional languages none of them really handle immutability well.
Consider that you want most of your objects to be immutable most of the time. Thats all well and good till you realize you want to be able to edit the objects in such a way that it creates duplicates that have some data changed but are likewise immutable.
This tends to stop working, almost entierly, once you get into subclassing. If you parent class has a method that returns a copy of itself with some data modified, this will break in children classes, since you want children classes to return instances of itself, not its parent.
Its not that you cant fix that, but the code gets very ugly very quickly. Generally you are forced to let the code handling the classes do the copying and editing itself, but that is pretty ugly too.
I have had this pattern problem in almost every OO language i messed with, Java, Ruby, Python, etc.
HFT isnt something that puts equal money in everyones pocket (or a large blanket of the population), so no that wouldnt have the direct effect of devaluing money due to dilution.
Printing money can cause dilution and generally is discouraged on its own. However usually there are complex mechnisms in place that dont make it that simple (the money isnt just printed and handed out for free).
My god... #Ruby 's handling of immutability is absolutely horrific... I used to like ruby but I am coming to hate it real fast the more I use it...
You are making the common mistake of confusing money and wealth.. If the value that backs money is destroyed you will usually have less money, but if it happens in a way that effects everyone you likely have the same money and less wealth.
Wealth is not money.
Not sure just because someone at one point in the chain of custody someone traded time for the money doesnt mean money IS time... money represents value, most value requires time to create... but not all of it. I can buy something and resell it at a markup, and invested little or no time int he effort and just made money.
@freemo I think you can look at this from many angles. In my opinion, our institutions should be regulated in a way that optimises for things like improved living standards for the average citizen, average life expectancy, average level of happiness etc.
When companies engage in price fixing, the result will almost invariably be higher prices for the majority of society. This is bad, because it will limit access to goods for the average person.
When individuals collectively agree not to work for less than some amount (you said "price fixing", which I suppose is accurate), the result will hopefully be higher pay for the individuals. This is good, because it improves access to goods for the average person. You might say the price of goods will increase, but prices in a competitive market can't be raised arbitrarily.
Morally if not legally, companies are not people. They don't starve if they can't earn a living, they don't suffer when their kids are hungry etc. There are good reasons for companies to be restricted in ways that individuals are not. I see unions as a mechanism for individuals to collaborate.
> I think you can look at this from many angles. In my opinion, our institutions should be regulated in a way that optimises for things like improved living standards for the average citizen, average life expectancy, average level of happiness etc.
I would mostly agree here. The caveat is that regulating institutions improperly can have the opposite effect. Ergo to achieve that one must be delicate (and usually light-handed) in how that regulation occurs.
> When companies engage in price fixing, the result will almost invariably be higher prices for the majority of society. This is bad, because it will limit access to goods for the average person.
Agreed
> When individuals collectively agree not to work for less than some amount (you said "price fixing", which I suppose is accurate), the result will hopefully be higher pay for the individuals. This is good, because it improves access to goods for the average person. You might say the price of goods will increase, but prices in a competitive market can't be raised arbitrarily.
Strongly disagree. If that were true we would just give everyone infinite free money and everything would be great. In reality it doesnt work that way. when workers are providing **value** and being paid specifically for that value, and at a fair price, then and only then, is it good. Realized value makes everyone more wealthy, but free money that doesnt represent value does not.
Now what does need to happen to be good for everyone is to increase the value of a worker, ergo let that worker be paid more as they are of higher value, and then the extra money will be a boon to society for sure.
> Morally if not legally, companies are not people. They don't starve if they can't earn a living, they don't suffer when their kids are hungry etc. There are good reasons for companies to be restricted in ways that individuals are not. I see unions as a mechanism for individuals to collaborate.
I am totally fine with the restrictions we put on companies. Which is why i continue to support anti-trust laws. But regardless we must recognize they have less power than the people, intentionally so, and thats fine in its natural state (without unions).
If money were strictly equal to time then you cant be given money as a gift since I invested no time to earn that money.
Time is one among many things a person can invest to get wealth, and money is just a standard for measuring wealth at any one instance, but is uncomparable between instances (easily).
Now you are getting it.. its because money doesnt define wealth.. When people take an unfair share through price-fixing then while it looks like they are taking more because they have more dollars and cents in reality the runaway inflation that results means you actually have less but are tricked into thinking you have more.
> If the price is truly unreasonable, the industry dies because nobody can afford it. Not even the workers with unreasonable wages. That's the point.
This only works in a non-price fixed market.. with price fixing there is no such thing as unreasonable price since im able to force people to pay whatever I want.. thats why inflation forces kick in rather than market forces.
> I suspect you argue from the perspective of someone who has more than a fair share... only then is this a bad thing: no actual value produced, then one is a looser in this.
I grew up in the worst sort of poverty imaginable. I argue fromt he perspective of someone who has expiernced the hardship and learned what it takes to address it.
How would that cut off their own supply.. they fix an unreasonable price, make a ton more money as a result, company keeps producing goods but just sells the goods at a much higher price. Inflation goes haywire, you have total economic collapse long term, but short term pressures the employees think they are doing great, afterall they are paid a fortune.
No this isnt theory, this is reality.
Unions price fix **in reality** it is intentional and their stated purpose. This isnt theory or rules. The purpose of a union is to create a coalition and to use that collective bargaining power to price-fix their salary and other benefits. Calling that theory is absurd, its literally the stated purpose.
Jeffrey Phillips Freeman
Innovator & Entrepreneur in Machine Learning, Evolutionary Computing & Big Data. Avid SCUBA diver, Open-source developer, HAM radio operator, astrophotographer, and anything nerdy.
Born and raised in Philadelphia, PA, USA, currently living in Utrecht, Netherlands, USA, and Thailand. Was also living in Israel, but left.
Pronouns: Sir / Mister
(Above pronouns are not intended to mock, i will respect any persons pronouns and only wish pronouns to show respect be used with me as well. These are called neopronouns, see an example of the word "frog" used as a neopronoun here: http://tinyurl.com/44hhej89 )
A proud member of the Penobscot Native American tribe, as well as a Mayflower passenger descendant. I sometimes post about my genealogical history.
My stance on various issues:
Education: Free to PhD, tax paid
Abortion: Protected, tax paid, limited time-frame
Welfare: Yes, no one should starve
UBI: No, use welfare
Racism: is real
Guns: Shall not be infringed
LGBT+/minorities: Support
Pronouns: Will respect
Trump: Moron, evil
Biden: Senile, racist
Police: ACAB
Drugs: Fully legal, no prescriptions needed
GPG/PGP Fingerprint: 8B23 64CD 2403 6DCB 7531 01D0 052D DA8E 0506 CBCE