{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoin/secp256k1/issues/218","labels_url":"https://api.github.com/repos/bitcoin/secp256k1/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/secp256k1/issues/218/comments","events_url":"https://api.github.com/repos/bitcoin/secp256k1/issues/218/events","html_url":"https://github.com/bitcoin/secp256k1/pull/218","id":57901235,"number":218,"title":"Eliminate use of multiple-return from secp256k1.c.","user":{"login":"gmaxwell","id":858454,"avatar_url":"https://avatars.githubusercontent.com/u/858454?v=3","gravatar_id":"","url":"https://api.github.com/users/gmaxwell","html_url":"https://github.com/gmaxwell","followers_url":"https://api.github.com/users/gmaxwell/followers","following_url":"https://api.github.com/users/gmaxwell/following{/other_user}","gists_url":"https://api.github.com/users/gmaxwell/gists{/gist_id}","starred_url":"https://api.github.com/users/gmaxwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmaxwell/subscriptions","organizations_url":"https://api.github.com/users/gmaxwell/orgs","repos_url":"https://api.github.com/users/gmaxwell/repos","events_url":"https://api.github.com/users/gmaxwell/events{/privacy}","received_events_url":"https://api.github.com/users/gmaxwell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-17T09:28:19Z","updated_at":"2015-02-17T09:47:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bitcoin/secp256k1/pulls/218","html_url":"https://github.com/bitcoin/secp256k1/pull/218","diff_url":"https://github.com/bitcoin/secp256k1/pull/218.diff","patch_url":"https://github.com/bitcoin/secp256k1/pull/218.patch"},"body":"Goto, multiple returns, continue, and/or multiple breaks in a\r\n loop are often used to build complex or non-local control\r\n flow in software.\r\n\r\n(They're all basically the same thing, and anyone axiomatically\r\n opposing goto and not the rest is probably cargo-culting from\r\n the title of Dijkstra's essay without thinking hard about it.)\r\n\r\nPersonally, I think the current use of these constructs in the\r\n code base is fine: no where are we using them to create control-\r\n flow that couldn't easily be described in plain English, which\r\n is hard to read or reason about, or which looks like a trap for\r\n future developers.\r\n\r\nSome, however, prefer a more rules based approach to software\r\n quality.  In particular, MISRA forbids all of these constructs,\r\n and for good experience based reasons.  Rule based criteria\r\n (as opposed to good judgement) also has the benefit of being\r\n machine checkable and surviving individual developers.\r\n\r\n(To be fair-- MISRA also has a process for accommodating code that\r\n breaks the rules for good reason).\r\n\r\nI think that in general we should also try to satisfy the rules-\r\n based measures of software quality, except where there is an\r\n objective reason not do: a measurable performance difference,\r\n logic that turns to spaghetti, etc.\r\n\r\nChanging out all the multiple returns in secp256k1.c appears to\r\n be basically neutral:  Some parts become slightly less clear,\r\n some parts slightly more.\r\n"},"comment":{"url":"https://api.github.com/repos/bitcoin/secp256k1/issues/comments/74641669","html_url":"https://github.com/bitcoin/secp256k1/pull/218#issuecomment-74641669","issue_url":"https://api.github.com/repos/bitcoin/secp256k1/issues/218","id":74641669,"user":{"login":"gmaxwell","id":858454,"avatar_url":"https://avatars.githubusercontent.com/u/858454?v=3","gravatar_id":"","url":"https://api.github.com/users/gmaxwell","html_url":"https://github.com/gmaxwell","followers_url":"https://api.github.com/users/gmaxwell/followers","following_url":"https://api.github.com/users/gmaxwell/following{/other_user}","gists_url":"https://api.github.com/users/gmaxwell/gists{/gist_id}","starred_url":"https://api.github.com/users/gmaxwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmaxwell/subscriptions","organizations_url":"https://api.github.com/users/gmaxwell/orgs","repos_url":"https://api.github.com/users/gmaxwell/repos","events_url":"https://api.github.com/users/gmaxwell/events{/privacy}","received_events_url":"https://api.github.com/users/gmaxwell/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T09:47:43Z","updated_at":"2015-02-17T09:47:43Z","body":"@paveljanik  They are elsewhere.  This is \"For discussion\" commits. I'm not going to waste my time this patch not on-top of the other changes just to make github happy."}}