There is no way to allocate objects of reference types on stack because references can easily outlive objects, leaving you with dangling references.
And as I understand ByVal in VB.NET is redundant since it's the default option. It's just a leftover from VB6 where the default was ByRef. Crazy language.
Re:Should I use a Swift struct or a class?
by MichaelGG on Saturday July 04, 2015 @05:09PM
(#9831630)
> There is no way to allocate objects of reference types on stack because references can easily outlive objects,
That's simply due to a lack of analysis. In many cases it's easy to show the object is short lived. Yet there's no way to annotate this and AFAIK, the JIT doesn't even try to figure this out.
But wow, this post... I've no idea how he came to the conclusion structs=functional. He just sorta dives into it? If you aren't sure on something, why not read up a bit more? Guess C is a really functional language since it's got structs everywhere.