Earlier quoted context omitted.
OK, I can appreciate your stance, but can you explain the difference? (Or at least point to a reference that does?)
It comes down to equality. Values have "extensional equality" which means that values A and B are equal exactly and only when they look the same and can be used in the same way. On the other hand, most people are used to "referential equality" which is more strict. It lets me distinguish "your copy" of A from "my copy" of A via their names. Without referential equality things like mutation fail to have any sense, but…
Should I use a Swift struct or a class?
51–56 of 56 posts
Re: Should I use a Swift struct or a class?
#52Re: Should I use a Swift struct or a class?
#53Earlier quoted context omitted.
"And I just don't understand why." I think you've correctly identified the source of confusion -- value vs reference. To you, that might be plain as day. But, to many iOS devs, they really couldn't explain the nuances. I mean, look how much trouble beginner programmers have with the concept of Pointers for pete's sake. But, I think you're right -- weird rules and guidelines just confuse the issue. Andy Matuschak's fu…
The other issue is that too many programmers these days don't have a solid computer science background... I'm all for people being self-taught and learning programming on their own... But the downside of that prevents individuals from learning how things work at a lower level. I've never written a line of Obj-C or Swift in my life, but all you have to tell me is "struct = value based, class = referenced based" and I…
Do you have any books or exercises to recommend to help further my understanding of low-level computing? I'll be taking too and compilers in the fall, but I'd like to keep digging on my own.
Re: Should I use a Swift struct or a class?
#54or: how I stopped worrying and accepted making programs that are hard to reason about
If you want to contribute, write why you disagree instead of attacking the author as a person.
Re: Should I use a Swift struct or a class?
#55Re: Should I use a Swift struct or a class?
#56Earlier quoted context omitted.
Variables can be mutated in Lisp. That's all this is.
Variables are not values.