Saturday, August 3, 2019

Linktarrhea

Does anyone remember "Sniglets"? new made up words describing common shared experiences? here's one I'm just making up now:
Linktarrhea: when you paste a URL or link into a document or email and it becomes or remains a link but then you can't write anything after the link without it becoming part of the underlined content, no matter how stupid it looks.
So silly that it's 2019 and I'm still fighting with this issue-- any program should know that it's exceedingly rare (and bad design) for a link text to include paragraphs, so pressing return and inserting a line break should clearly end the damn link.

I think of that little six-step dance I do if I experience Linktarrhea and want to get past it: hit undo to remove the characters I just typed and eventually the URL I pasted, type a few throw away letters, move the cursor back to where I wanted the link, paste it again, move the cursor to after the throw-aways and start typing the word I actually wanted to type, then go back and erase the throw-away letters. Cha-cha-cha.

WYSIWYG? More like WYSIBS.

Friday, August 2, 2019

wave your hands in the air! wave 'em like you just do care!

Kottke announced Soli touchless interactions are coming to Pixel 4 and reposted this video from a few years ago:


Seeing the video made me a bit less skeptical about the concept - I think that doing it poorly would be REALLY annoying, but if they made it very definite about when you're in gesture mode... maybe it could work.

Still I think of that Douglas Adams line:
A loud clatter of gunk music flooded through the Heart of Gold cabin as Zaphod searched the sub-etha radio wavebands for news of himself. The machine was rather difficult to operate. For years radios had been operated by means of pressing buttons and turning dials; then as the technology became more sophisticated the controls were made touch-sensitive - you merely had to brush the panels with your fingers; now all you had to do was wave your hand in the general direction of the components and hope. It saved a lot of muscular expenditure of course, but meant that you had to sit infuriatingly still if you wanted to keep listening to the same programme.
For the late 70s, he was thinking years ahead!!

hooks

This page on React hooks is also a pretty good reminder/review of the whole redux/dispatch/reducer thing. Sometimes I get rusty on that when I don't work there in a while.

Thursday, August 1, 2019

note to self: less noisy CGI param checking in PHP

Insert usual sorry-not-sorry-for-using-php... there's that old Larry Wall adage how programs that wish to communicate well should "be strict in what they emit, and liberal in what they accept". One place where PHP lags Perl in this is checking for hash values when the key is missing - I find my server logs getting full of "PHP Notice:  Undefined index" when looking in $_GET or $_POST but I have fine default behaviors ready if those values aren't there.

I guess
function getval($key, $default = ''){
    return isset($_GET[$key]) ? $_GET[$key] : $default;    
}
function postval($key, $default = ''){
    return isset($_POST[$key]) ? $_POST[$key] : $default;    
}
function requestval($key, $default = ''){
    return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;    
}
Does about as good a job as anything at checking first, in a safe way. (array_key_exists would have worked as well, I suppose...)

Random aside, and thinking of that Larry Wall quote- I remember way back when, like in the 90s, thinking it was annoying to have to check POSTs differently from GET, since CGI was a nice abstraction over either, and while the internals of how that data is passed might be very different, from the scriptwriters point of view they were kind of the same.

Now, I guess I get it. People get an intuition for what should be GET and what should be POST, so PHP's generic REQUEST (which includes cookies) is kind of an afterthought. It just feels less chaotic to understand what's channel stuff is coming in from.

Wednesday, July 31, 2019

keyboards and power users

Last week I wrote on my blog and facebook:
For years I've been digging using a laptop on my workdesk with additional monitors hanging out above it - I like how so much remains constant whether I'm on at the desk or on the go, and most external keyboards don't make it easy to put a trackpad as close at hand, or rather close at thumb, as a laptop.
However I seem to be in a minority at work, and most of my peers use some kind of external keyboard, either with the laptop closed or perched above as another external monitor.
Back in the day, developers used desktops, and so this was a moot issue, but I feel like external keyboards are more popular among developers now than they were 5 years ago or so. (I might be wrong on this.) And I wonder if it's just the heat issue - laptops, especially these thin ones, run hot, and it's not always the most pleasant thing to have on your fingertips.
Heh, at least for now, developers using external keyboards even with their Macbooks means the famous MacPro touchbar is even more useless, unless Apple makes a special keyboard  that has it. (I got a new laptop with it and have to take care not to accidentally brush its virtual esc key... Douglas Adams warned us about this!)
A talented FB friend of mine, Seneca Menard wrote in the comments
I can't stand laptop keyboards for many reasons: 
1-the keys are not deep thus it's very easy to hit multiple keys on accident plus you get less tactile and audio feedback when you're successfully hitting the keys, which lead to further errors.
2-the laptops usually don't have a numpad, a good set of keys for ins, del, pgup, pgdn, etc and even the arrow keys often get a terrible position and size and so you get user errors when using them without looking.  All of those keys are precious to a hardcore PC user like me that has thousands of hotkeys and so they have to all physically exist, and have a specific position and size. :p
3-the "function" key is horrendous. I almost never use those yet they're then responsible for moving around all the vital modifier keys like alt and Ctrl and whatnot. So my production speed gets destroyed because all the keys I'm dependent on were destroyed (in my subconscious memory of where which keys are) by a key I'll never use! Ughhhhhh.
4-most keyboard designers don't put enough importance into the position and size of high priority keys like enter and backspace. And so these keys that you press more often than any other keys on the keyboard end up getting mis-clicked by the user and thus slow the user down
5-every new laptop gets a different keyboard so you're always going to not be up to full typing speed because the keys are moving around every time you buy a new PC which is quite often
6-most keyboards have poor F-key layouts. I like my keyboard because there's a space between every 4 keys and so I can easily feel my way around them without looking or quickly jump to a key visually without reading the labels.  As if their size and spacing wasn't important enough to me, when I heard the new MacBooks now don't have any physical f keys at all it blew my mind!  Do these people not even use computers for work when they're making design decisions like that?!?!  :(
7-Then there's extra random stuff like how I like a calculator button or a play pause button (and these exist as standalone buttons so they easy to find without ever looking), or how some keyboards have palm rests, or how I like that my keyboard is not built into a flat laptop surface and is instead raised off of my desk so I can easily get my hands into proper typing positions without looking at the keyboard by feeling for the bottom left front corner of the keyboard and then my fingers all fall into place.  Or how some users like having split keyboards for wrist ergonomics, etc etc etc.
I go crazy whenever I'm slowed down by the input device(s) I'm using so that's why I use an ancient keyboard and *only* that keyboard.  It's over 20 years old and still working great and I have a couple of others as backup if it ever did die.
So hopefully that explains why a number of us don't use laptop keyboards.  :)
It was fascinating reading this mini-rant. It sounds like folk like Seneca are really working needing a flowstate, and so being comfortable with the hardware is critical. 

I can only somewhat empathize, being a little more superficial in my interactions - but I know how painful it is when there's overall system lag when using any computer - eventually it builds up and manifests as a kind of physical tension.

smilie when you say that, pard'ner

On my company's blog, Shayan wrote about Text and Emoji analysis on CarGurus text and chat.

Saturday, July 27, 2019

hot hands hot hands

For years I've been digging using a laptop on my workdesk with additional monitors hanging out above it - I like how so much remains constant whether I'm on at the desk or on the go, and most external keyboards don't make it easy to put a trackpad as close at hand, or rather close at thumb, as a laptop.

But I seem to be in a minority, and most of my peers use some kind of external keyboard, either with the laptop closed or perched above as another external monitor.

Back in the day, developers used desktops, and so this was a moot issue, but I feel like external keyboards are more popular among developers now than they were 5 years ago or so. (I might be wrong on this.) And I wonder if it's just the heat issue - laptops, especially these thin ones, run hot, and it's not always the most pleasant thing.

Heh, at least for now, that means the famous MacPro touchbar is even more useless for developers, unless Apple makes a special keyboard with it included. I got a new laptop and have to take care not to accidentally brush its virtual esc key... Douglas Adams warned us about this:
A loud clatter of gunk music flooded through the Heart of Gold cabin as Zaphod searched the sub-etha radio wavebands for news of himself. The machine was rather difficult to operate. For years radios had been operated by means of pressing buttons and turning dials; then as the technology became more sophisticated the controls were made touch-sensitive - you merely had to brush the panels with your fingers; now all you had to do was wave your hand in the general direction of the components and hope. It saved a lot of muscular expenditure of course, but meant that you had to sit infuriatingly still if you wanted to keep listening to the same programme.
 Considering he wrote that in the late 70s, he was amazingly prescient - about these touchbars, and about all these gesture interfaces...