[Info-vax] BASIC (and Horizon)
Lawrence D'Oliveiro
ldo at nz.invalid
Wed Jan 31 18:18:12 EST 2024
On Wed, 31 Jan 2024 17:13:26 -0500, Arne Vajhøj wrote:
> On 1/31/2024 4:24 PM, Lawrence D'Oliveiro wrote:
>
>> On Wed, 31 Jan 2024 10:20:35 -0500, Arne Vajhøj wrote:
>>
>>> For the not VB.NET knowledgable:
>>>
>>> Using o1 As New X("A")
>>> ...
>>> End Using
>>>
>>> calls o1.Dispose() when the block is exited no matter how it is exited -
>>> normal or exception does not matter Dispose is always called.
>>
>> Python has “context managers” which are a generalization of this. It also
>> has “try/finally” blocks, which are good for one-off cases.
>
> C# was born with using (2002), Python got with in 2.5 (2006)
> and Java got try with resource in 1.7 (2011).
>
> MS got a good idea and the rest copied it.
That is also true of async/await. But note that Python is the only one
of the three that tries to use reference-counting as an alternative to
garbage collection.
And now it looks like C# might be shuffling off into those retirement
pastures
<https://www.theregister.com/2024/01/31/microsoft_seeks_rust_developers/>.
More information about the Info-vax
mailing list