Flutterby™! : References are like jumps

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

References are like jumps

2024-05-16 16:31:43.970022+02 by Dan Lyke 2 comments

I have been thinking a lot about things like "Do I need to learn Rust?", and ... I'm beginning to think maybe I don't?

References are like jumps:

Unfortunately, most people seem to have taken the wrong lesson from Rust. They see all of this business with lifetimes and ownership as a dirty mess that Rust has had to adopt because it wanted to avoid garbage collection. But this is completely backwards! Rust adopted rules around shared mutable state and this enabled it to avoid garbage collection. These rules are a good idea regardless.

I'm thinking about how I religiously avoided goto until Tom Duff pointed out how silly my code looked with all of those nested error checks. Maybe they're not a good idea regardless, and the reason we're not all using functional languages today is that trying to build programs that way just doesn't work very well?

I dunno, I'm kind of in a contrarian mood this morning...

[ related topics: Weblogs Software Engineering Work, productivity and environment Boats Machinery ]

comments in ascending chronological order (reverse):

#Comment Re: References are like jumps made: 2024-05-16 20:32:08.19773+02 by: markd

I was loaned to a team (big Mac C++ app using trendy design patterns in the mid 90s), and was given the task to integrate the library for decompressing the old compressed file format. It was a pure-C API, and led to very clean code using goto-based cleanup.

The tech lead of the project was a Purist who was known to rewrite anybody's code at any time, and decided goto was A Bad Thing and rewrote it without my knowledge.

Then I got bug reports from QA: "this doesn't work". Turns out the rewrite (double the lines of code, fancy C++ exception handling, etc), Just Didn't Work. I gleefully reverted the rewrite back to the working version.

#Comment Re: References are like jumps made: 2024-05-16 20:33:32.701765+02 by: markd

In the three editions of Advanced Mac OS X Programming[Wiki], I intentionally used goto-based error handling when I could just to tweak and annoy folks. "But goto is bad!" "fair enough. Rewrite this to not use goto, and if it's better I'll use it". And it never was better.

Add your own comment:

(If anyone ever actually uses Webmention/indie-action to post here, please email me)




Format with:

(You should probably use "Text" mode: URLs will be mostly recognized and linked, _underscore quoted_ text is looked up in a glossary, _underscore quoted_ (http://xyz.pdq) becomes a link, without the link in the parenthesis it becomes a <cite> tag. All <cite>ed text will point to the Flutterby knowledge base. Two enters (ie: a blank line) gets you a new paragraph, special treatment for paragraphs that are manually indented or start with "#" (as in "#include" or "#!/usr/bin/perl"), "/* " or ">" (as in a quoted message) or look like lists, or within a paragraph you can use a number of HTML tags:

p, img, br, hr, a, sub, sup, tt, i, b, h1, h2, h3, h4, h5, h6, cite, em, strong, code, samp, kbd, pre, blockquote, address, ol, dl, ul, dt, dd, li, dir, menu, table, tr, td, th

Comment policy

We will not edit your comments. However, we may delete your comments, or cause them to be hidden behind another link, if we feel they detract from the conversation. Commercial plugs are fine, if they are relevant to the conversation, and if you don't try to pretend to be a consumer. Annoying endorsements will be deleted if you're lucky, if you're not a whole bunch of people smarter and more articulate than you will ridicule you, and we will leave such ridicule in place.


Flutterby™ is a trademark claimed by

Dan Lyke
for the web publications at www.flutterby.com and www.flutterby.net.