zigdon / xkcd-Bucket

Bucket is the channel bot for #xkcd
http://wiki.xkcd.com/irc/Bucket
121 stars 31 forks source link

Matching and replace syntax is too arcane (rfc) #48

Open barometz opened 9 years ago

barometz commented 9 years ago

After mentioning #47 (on literal[*]) on IRC, a discussion started on Bucket's match/replace syntax. This is another example of things that are fairly obvious to many programmers but entirely weird to most people who aren't.

What

< barometz> Bucket: blorgh is foo
< Bucket> Okay, barometz.
< barometz> Bucket: blorgh is bar
< Bucket> Okay, barometz.
< barometz> Bucket: blorgh ~= /foo/
< Bucket> blorgh is foo
< barometz> Bucket: blorgh =~ /foo/
< Bucket> blorgh is foo
< barometz> Bucket: blorgh ~= s/foo/baz/
< Bucket> Okay, barometz, factoid updated.

The s/stuff/newstuff/ thing seems fairly ubiquitous across IRC (at least in my circles) to rectify what someone said, but on the whole people seem to have trouble remembering how any of this works. I'm not advocating to make Bucket "intuitive" or anything like that, but using keywords that are easier for people to remember might be helpful. Even candide, the C compiling bot over at freenode/##c, has more readable support for this sort of thing.

Alternatives

Any alternative will be more verbose and might be harder to parse and escape for. If we're going for plain English, Bucket: replace "foo" with "baz" in "blorgh" might do the trick.

zigdon commented 9 years ago

Yeah - parsing that might be tricky. If we do, supporting 'replace foo with bar there' might be nice too - edit on the last returned factoid. And I'd certainly make that in addition to the existing syntax.

On Sun Dec 21 2014 at 1:52:28 AM Dominic van Berkel < notifications@github.com> wrote:

After mentioning #47 https://github.com/zigdon/xkcd-Bucket/issues/47 (on literal[*]) on IRC, a discussion started on Bucket's match/replace syntax. This is another example of things that are fairly obvious to many programmers but entirely weird to most people who aren't. What

< barometz> Bucket: blorgh is foo < Bucket> Okay, barometz. < barometz> Bucket: blorgh is bar < Bucket> Okay, barometz. < barometz> Bucket: blorgh ~= /foo/ < Bucket> blorgh is foo < barometz> Bucket: blorgh =~ /foo/ < Bucket> blorgh is foo < barometz> Bucket: blorgh ~= s/foo/baz/ < Bucket> Okay, barometz, factoid updated.

The s/stuff/newstuff/ thing seems fairly ubiquitous across IRC (at least in my circles) to rectify what someone said, but on the whole people seem to have trouble remembering how any of this works. I'm not advocating to make Bucket "intuitive" or anything like that, but using keywords that are easier for people to remember might be helpful. Even candide, the C compiling bot over at freenode/##c, has more readable support http://www.iso-9899.info/wiki/Candide#replace for this sort of thing. Alternatives

Any alternative will be more verbose and might be harder to parse and escape for. If we're going for plain English, Bucket: replace "foo" with "baz" in "blorgh" might do the trick.

— Reply to this email directly or view it on GitHub https://github.com/zigdon/xkcd-Bucket/issues/48.