<p><a href="https://github.com/elextr" class="user-mention">@elextr</a> I find it pertinent to use these macros when they are meant to detect programming errors.  Yes, you can be forcefully defensive and always check no matter the debugging status, but the point these macros can be disabled (although in practice most builders don't disable them anyway) is for one to be able to trade safety for more speed.</p>
<p>So IMO if a builder do want to disable those checks, fine, but they gotta know it's less defensive.  Which could make sense, as these checks are for programming errors, and should not depend on user behavior.</p>
<p>In all cases, I think using a GError for programming error is worse than emitting a warning somewhere, because it's harder to handle the error and it could be ignored and left unnoticed more easily.</p>
<blockquote>
<p>Your documentation for the function doesn't disallow NULL</p>
</blockquote>
<p>It odes, unless you accept <code>NULL</code> to be valid for <em>The project</em>, and as the function is supposed to save it to a file, I wouldn't expect <code>NULL</code> to be a valid one unless explicitly stated otherwise.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/commit/109b8d079a59ba35e8aba5da960fc5b10f03ea7f#commitcomment-23747113">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ_8M-3e9td4gYGbltRI6ItJ5xAG_ks5sZ3CSgaJpZM4O8Uoj">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ41m4EXSJrTWgjKfV1yJEGR5Ng-2ks5sZ3CSgaJpZM4O8Uoj.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany-plugins/commit/109b8d079a59ba35e8aba5da960fc5b10f03ea7f#commitcomment-23747113"></link>
  <meta itemprop="name" content="View Commit"></meta>
</div>
<meta itemprop="description" content="View this Commit on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany-plugins","title":"geany/geany-plugins","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany-plugins"}},"updates":{"snippets":[{"icon":"PERSON","message":"@b4n on 109b8d0: @elextr I find it pertinent to use these macros when they are meant to detect programming errors.  Yes, you can be forcefully defensive and always check no matter the debugging status, but the point these macros can be disabled (although in practice most builders don't disable them anyway) is for one to be able to trade safety for more speed.\r\n\r\nSo IMO if a builder do want to disable those checks, fine, but they gotta know it's less defensive.  Which could make sense, as these checks are for programming errors, and should not depend on user behavior.\r\n\r\nIn all cases, I think using a GError for programming error is worse than emitting a warning somewhere, because it's harder to handle the error and it could be ignored and left unnoticed more easily.\r\n\r\n\u003eYour documentation for the function doesn't disallow NULL\r\n\r\nIt odes, unless you accept `NULL` to be valid for *The project*, and as the function is supposed to save it to a file, I wouldn't expect `NULL` to be a valid one unless explicitly stated otherwise."}],"action":{"name":"View Commit","url":"https://github.com/geany/geany-plugins/commit/109b8d079a59ba35e8aba5da960fc5b10f03ea7f#commitcomment-23747113"}}}</script>