Re: setjmp/lonjmp (was: vinum warning)
--Ah9ph+G2cWRpKogL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Thursday, 3 February 2005 at 16:23:38 -0800, Matthew Dillon wrote:
>
>>> I'm going to nit on this.
>>>
>>> Using longjmp is evil. Period.
>>
>> Is that the only justification you have for your opinion?
>
> The problem, Greg, is that when you use something like that in a
> large project you basically remove a large number of programmers
> from the set of programmers able to work, maintain, and extend
> your code.
That's a secondary issue. Not that I disagree, but my question was
related to the construct only. What you say below is interesting, but
not what I was talking about.
> Your code is especially difficult to maintain. I'm not saying
> its bad, just that it's especially difficult for people other
> then yourself to wrap their hands around and actually work with
> because of the lack of in-code documentation, weird code
> constructions that nobody else uses, weird indentation that
> doesn't seem to work with anyone else's editor, the extremely
> deeply nested statements you have, lack of compartmentalization
> of major function sets, and other things. I've tried to do
> cleanups of your vinum code before and, believe me, it is a
> frustrating experience!
Sorry to hear about it. Yes, I agree, I don't exactly adhere to
style(9). That's because I consider style(9) to be outdated. But
it's clear that it doesn't make my code any easier to read for those
people who are used to style(9).
> Now, so you don't feel bad, Kirk's code comes in a close second.
Heh. I don't feel bad :-) But thanks, anyway.
> It's probably a generational thing. One of the reasons why I am
> allowing people to do major cleanups of our code base is
> precisely to try to make the code more maintainable and more
> comfortable for more recent generations of programmers.
Paradoxically (as I said above), I think the current code style is
older. To get back to the topic, I think that setjmp/longjmp is a
more modern construct. Admittedly it's (marginally) more difficult to
understand setjmp/longjmp than it is to understand a chain of function
returns, and there's additional potential to break something, but I
don't see either of these as serious, and I do see the advantages as
significant, particularly in the untidy area of checking return codes
at every step. You obviously don't, and I was asking about your
reasons.
Greg
--
When replying to this message, please copy the original recipients.
For more information, see http://www.lemis.com/questions.html
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
--Ah9ph+G2cWRpKogL
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)
iD8DBQFCEokcIubykFB6QiMRAtWkAJ9/oOblmDtg1gmO9d89NgdH2mLs/ACeKH0/
WA7G09gzCWFV9zWKntjnoYI=
=epCL
-----END PGP SIGNATURE-----
--Ah9ph+G2cWRpKogL--
討論串 (同標題文章)
完整討論串 (本文為第 11 之 11 篇):