<html><body><div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Jan 24, 2025 at 11:20:02 AM, Nikolay Nikolov via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> wrote:<br></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" type="cite">
As you can see, it's more complicated and more error prone. You can simplify it a little bit with goto, but it will never be better, compared to try...finally<br><br>
</blockquote>
</div>
<br>
<div dir="ltr">ok, I’ve never used exceptions in FPC except to mean actual exceptions as in the program is corrupted so quit and exit.</div><div dir="ltr"><br></div><div dir="ltr">I’ve seen other people put these all over their code though. I guess the idea is that they’re trying to recover from exceptions and so they need to wrap literally every single function that could fail anywhere with try…finally. I don’t have any examples but I think I’ve seen this (feel free to post any if people could think of some from real projects).</div><div dir="ltr"><br></div><div dir="ltr">Feels to me like manual memory management and exceptions don’t mix well. I use exceptions in C# and Swift and they don’t require all this boiler plate to prevent memory leaks.</div><div dir="ltr">
<br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Regards,</div> Ryan Joseph</div></div><br>
</div></body></html>