[3416] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: [barnowl] Make check for non-existant channel more correct (#120)

daemon@ATHENA.MIT.EDU (Jason Gross)
Mon May 20 00:55:41 2013

Date: Sun, 19 May 2013 21:55:37 -0700
From: Jason Gross <notifications@github.com>
Reply-To: barnowl/barnowl <reply+i-11343262-158e81443bd3dfacb3638dc072814711da172b14-4475081@reply.github.com>
To: barnowl/barnowl <barnowl@noreply.github.com>
In-Reply-To: <barnowl/barnowl/pull/120@github.com>



----==_mimepart_5199acc9e7712_3492943dd894373
Date: Sun, 19 May 2013 21:55:37 -0700
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-ID: <5199acc9e9566_3492943dd894417@worker5.rs.github.com.mail>

@andersk said:
> Is the empty string somehow special, as far as invalid channel names ar=
e concerned? I=E2=80=99d think that, say, a space or a newline would be e=
qually problematic. If validation is this function=E2=80=99s job, then it=
 should do it more carefully; otherwise, it should leave validation to so=
mewhere else and just check `defined($channel)`.

No, the empty string is not special.  I believe that I chose the empty st=
ring because I was sticking mostly with previous behavior; the fasle-y va=
lues in perl are the empty string, `'0'`, and `undef`.  `'0'` seems like =
a potentially valid IRC username, and `''` and `undef` do not, though I d=
on't have anything to back this up with.

I'll change the behavior momentarily.


---
Reply to this email directly or view it on GitHub:
https://github.com/barnowl/barnowl/pull/120#issuecomment-18132257=


----==_mimepart_5199acc9e7712_3492943dd894373
Date: Sun, 19 May 2013 21:55:37 -0700
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-ID: <5199acc9ea049_3492943dd89451@worker5.rs.github.com.mail>

<p><a href=3D"https://github.com/andersk" class=3D"user-mention">@andersk=
</a> said:</p>

<blockquote>
<p>Is the empty string somehow special, as far as invalid channel names a=
re concerned? I=E2=80=99d think that, say, a space or a newline would be =
equally problematic. If validation is this function=E2=80=99s job, then i=
t should do it more carefully; otherwise, it should leave validation to s=
omewhere else and just check <code>defined($channel)</code>.</p>
</blockquote>

<p>No, the empty string is not special.  I believe that I chose the empty=
 string because I was sticking mostly with previous behavior; the fasle-y=
 values in perl are the empty string, <code>'0'</code>, and <code>undef</=
code>.  <code>'0'</code> seems like a potentially valid IRC username, and=
 <code>''</code> and <code>undef</code> do not, though I don't have anyth=
ing to back this up with.</p>

<p>I'll change the behavior momentarily.</p>

<p style=3D"font-size:small;-webkit-text-size-adjust:none;color:#666;">&m=
dash;<br>Reply to this email directly or <a href=3D'https://github.com/ba=
rnowl/barnowl/pull/120#issuecomment-18132257'>view it on GitHub</a>.<img =
src=3D'https://github.com/notifications/beacon/JJk3yKd0u6qAmPAmJXdf9-WWpM=
h44NjFH90n0h1k5DtRlnxnHN7j7lrCTQPcA_jp.gif' height=3D'1' width=3D'1'></p>=


----==_mimepart_5199acc9e7712_3492943dd894373--

home help back first fref pref prev next nref lref last post