#agreed but now I know what to search for

1 messages · Page 1 of 1 (latest)

mortal umbra
#

Object in memory is just an area of memory.
Anything can be written in there.

#

A type defines how that area is created, and how to interpret the data in it

#

If the data can't be interpreted by a type, its not valid for that type. It can be physically smaller, or contain wrong data, that cant be interpreted correctly.

#

When you have a type system, it puts constraints on what can be written into that area, and its size

#

And polymorphism in c# Apple is Fruit and so on, allows the type system to interpret same area of memory in different ways

unreal geyser
#

okay..

mortal umbra
#

Fruit has certain layout, some floats, strings

#

Apple will have same layout, PLUS some more

#

because the Apple can be safely reduced to Fruit, and read as a Fruit, it is a fruit

unreal geyser
#

fair

#

I think this already helps me understand/remember it.

#

these things can be felt in the brain. xd instead of confusion, there's a locker for this now.

mortal umbra
#

no matter how languages try to keep you away from computer fundamentals, they are the key to understand everything

#

c# abstracts away memory management so you dont have to think about it, as a result statements like "memory allocation is more of a c++ thing. I think"