Dear list,<div><br></div><div>I have a simple best practices question:</div><div>Is it better to write:<br></div><div><br></div><div><div>skip ([_H | _T] = Arg, Bin) -></div><div> skip_count (length (Arg) + 1, Bin);</div>
<div>skip (<<Arg/binary>>, Bin) -></div><div> skip_count (size (Arg), Bin).</div><div><br></div><div>or</div><div><br></div><div><div>skip (Arg, Bin) when is_list (Arg) -></div><div> skip_count (length (Arg) + 1, Bin);</div>
<div>skip (Arg, Bin) when is_binary (Arg) -></div><div> skip_count (size (Arg), Bin).</div><div><br></div><div>I would be in favor or the second case, but I wonder if the use of guards in this case is a very good idea.</div>
<div><br></div><div><br></div><div>Best,</div><div>Cam</div><div><br></div></div></div>