adhocteam / pushup

Pushup is for making modern, page-oriented web apps in Go
https://pushup.adhoc.dev
MIT License
840 stars 30 forks source link

Consider ergonomics of leading ^ as mode switch #42

Open eli-oat opened 1 year ago

eli-oat commented 1 year ago

This is the nittiest of nit picky questions, but I wonder if there is an easier to type character to use in place of ^?

Generally, I have little occasion to type ^. Reaching for it feels weird (I've outed myself as not doing any bitwise operations in C, Ruby or Java, nor concatenating strings in OCaml...)

This is by no means a deal breaking issue, but I was immediately struck by how awkward it felt to type ^ when playing with pushup over lunch.

paulsmith commented 1 year ago

I actually initially started with @ as the transition character. It was fine, but when I realized it needed to be escaped for email addresses, I wondered if there was an alternative.

I changed it to ^ after considering some other options, but not very deeply. My reasoning was, ^ is not commonly used (as you mention, XOR isn't a common thing web developers typically do), and it's in the middle of the keyboard (I was thinking this was a benefit, but I agree with you that it's actually not the easiest to reach for).

But honestly, I picked ^ because it's kind of the "up" symbol :^)

I also thought about $, as an homage to PHP.

Another criteria that might be worth considering is a character that couldn't be accidentally mistaken (either by the parser or the programmer) as a Go lexical token. @, #, $, and ? are all illegal tokens in Go. One of these might be a good candidate. This is actually a vote against ^.

BTW: on the contrary, I don't think this is nit picky at all - this is a very valid question, especially at this stage. I really value this kind of feedback about the ergonomics and fundamental design questions like this.

eli-oat commented 1 year ago

I think that your reasoning for landing on ^ is wicked sound, and I imagine with practice it becomes less awkward to type (I have realized I consistently reach for it with the wrong hand 😆).

I wouldn't discount your liking ^ because of its relevance to the project's name -- I think jQuery, lowdash, underscore, and mustache can attest to the value of having a recognizable key symbol/sigil.

Ergonomically, I do prefer either $ or #, for sure.

? would probably be last on my list of the illegal tokens, and, for the reasons you already mentioned I'd not consider @, unless you included an inbuilt function specifically for emails, since having to always escape them would be cumbersome.

paulsmith commented 1 year ago

Some feedback from non-US audiences is that the ^ is not very accessible on their keyboards, for example:

I’m Finnish. The caret is not always easy to type in my experience on international keyboards.

Oh yes it's pretty hard to type on a German keyboard as well. In most editors you will need two keystrokes.

same in french. it's a dead key on our keyboard, so it's basically two keystrokes instead of one to type it

d33tah commented 1 year ago

Couldn't help but ask: maybe <?go then?

paulsmith commented 1 year ago

@d33tah Unlikely, Pushup radically redesigned - the non-enclosing nature of the transition symbol is pretty core to the current syntax.

I think I am leaning @ at the moment, as it seems more universally accessible across international keyboard layouts, and the email escaping thing could be handled as a special case (or just ignored and left to the Pushup page author).