[Bro-Dev] set and vector operators
jsiwek at corelight.com
Thu Apr 26 14:33:44 PDT 2018
On 4/26/18 3:43 PM, Vern Paxson wrote:
>> E.g. say you come back to some code after a few months and see "foo +=
>> 1". Not obvious what 'foo' is anymore.
> I don't think it's reasonable to have the bar be "can you tell what's going
> on in isolation". It should include consideration of associated context,
> variable names, and comments. In fact, even now you don't know whether
> for "foo += 1" foo is an integer, a count, or a double.
Yeah, it was maybe a bit of a stretch -- more just an observation I was
trying to see if we could run with. Also in relation to my recent
experiences with trying to read/debug some C++ code with a lot of
operator usage I found myself wishing some were just a named function
call so I could more easily navigate the code and even just find where
certain operators were defined/declared.
So the point I'm at now is that it would probably be nice not to have
multiple operators for the same thing, though don't have a strong
feeling about it.
More information about the bro-dev