Friday, November 7, 2014

zuck's half-answer to "why a second app"



(This is probably just a "things that irks me rant" in a "let's talk about some UX!" shell)

The Verge has an article: Mark Zuckerberg finally explains why he forced you to download the standalone Messenger app.

The need to install Messenger as a separate app (after months and months of ignoring the main FB app's pleas to, with promise of how "fast" it was) irked me mightily. I consider smartphone front page app space valuable - but I am interested enough in getting notified about activity on FB (whether post comments or messenger, the difference isn't all that much to me, really) that I had to carve out two places, since I would miss the notification badge on a secondary page. (Later I came to split the difference: the only app folder I have on my iPhone's first page is now "social media" in general, including Messenger, some dating sites, and some things for work I usually use on the laptop, while FB's main app gets to sit on the page itself.)

Anyway, for me the heart of his explanation was:
We saw that the top messaging apps people were using were their own app. These apps that are fast and just focused on messaging. You're probably messaging people 15 times per day.
 I am messaging people 15 times a day. Or at least 4 or 5. But it's the "But not on FB" that's Zuck's problem, the sentence he leaves out at the end of that. He'd love FB to be as critical for people in the quick messaging sense as it is in FB's traditional niche.

I don't know what FB's IM numbers are, but if the usage by me and my friends is anything to go on, the IM there is secondary. You use it when you aren't looking for a quick response, and you use it because if someone is on FB, they have access to a keyboard, and it's probably more physically convenient to tap out a response. (I know I'm talking like an old guy, where the web is more my native communication form than mobile.)

But FB is the big dog that sees this bone some other dogs are fighting over (Apple's iMessage and WhatsApp in particular) that, despite the delicious bone it has on its own plate, it wants to go and get a piece of that, no matter how many user's toes they step on. They want to own quick communication as well as the longer term "oh yeah that jerk I knew in middle school" longer term stuff.

Anyway.

FB, Tumbler, and Twitter collectively sucked a lot of the air from the independent web of the mid 2000s, because their value proposition of "build a centralized collection of possibly interesting stuff from people you know and/or expect to make or find cool stuff" is strong; it beats having to go from site to site, and hardly anyone bothered with RSS feeds for that (which I tend not to like, because it takes away the UX flavor I find critical in knowing where I saw something...)

the principles of rich web applications

7 Principles of Rich Web Applications is a pretty good read!
  1. Server rendered pages are not optional
  2. Act immediately on user input
  3. React to data changes
  4. Control the data exchange with the server
  5. Don’t break history, enhance it
  6. Push code updates
  7. Predict behavior

Wednesday, October 29, 2014

angular changes

I'm not anti-frameworks any more, but a buddy twittered me Have the Angular Team lost their marbles? outlining some changes coming down the pike, especially in "html plus extra bits" area, stuff like
<input type="text" [value]="newTodoTitle">
 <button (click)="addTodo()">+</button>
I really wonder about making such radical changes in syntax. (On the other hand, looking at Ember.js, I kind of liked that their templating takes the stuff out of the tags, and just uses the handlebars as a "this is out of band" marker, whether it's templating or logical structure.) Still, angular doesn't seem like a great choice if you wanted a stable platform going into the future. But it sure is popular in these parts.

Tuesday, October 28, 2014

who's that on my dang port?


On unix-y systems, 
lsof -i :8080
will show you processes listening to port 8080. You might have to sudo it.

Monday, October 27, 2014

notes to self: java HttpURLConnection weirdness

We have a suite of external tests we run for one of our adservers that happen to be written in Java and I'm writing a new test to ensure a cookie has been properly placed.

The connection code I ended up making was like this:
HttpURLConnection.setFollowRedirects(false);
HttpURLConnection connection = (HttpURLConnection) currentUrl.openConnection();
connection.connect();
What's odd about that is that we are setting whether to follow redirects on a static class field. Also, empirically it has to be done before the openConnection() on currentUrl (an instance of URL). Frankly it kind of feels like programming via side-effect (as my coworker points out this pretty much breaks any sane threading model).

Update: this stackoverflow question about why is "setFollowRedirects()" a static, class-wide method. It turns out there's an instance-specific "setInstanceFollowRedirects()" that you can call after creation... the page suggests that it would have been less confusing and more in line with the convention used elsewhere if  the two were called "setDefaultFollowRedirects()" and "setFollowRedirects()", respectively.

The other weird thing is that while a response might have multiple "set-cookie" lines, some of the convenience functions HttpURLConnection provide assume the field name can be used as a unique key, so that getHeaderField() returns a single String, even if there were multiple lines using. A stack overflow article gave me the following:
    static String[] getAllValuesForHeaderKey(HttpURLConnection con, String header) {
        List<String> values = new ArrayList<String>();
        int idx = (con.getHeaderFieldKey(0) == null) ? 1 : 0;
        while (true) {
            String key = con.getHeaderFieldKey(idx);
            if (key == null)
                break;
            if (header.equalsIgnoreCase(key))
                values.add(con.getHeaderField(idx));
            ++idx;
        }
        return values.toArray(new String[values.size()]);
    }
Which is roughly the same as getHeaderField() but returns an array of Strings instead.


Saturday, October 25, 2014

the fun of placeholder content

So, still a work in progress, but I'm helping my cousin with his portfolio website. He was able to construct a decent idea of the layout he wanted at wix.com but got frustrated when he wasn't able to customize the interaction the way he wanted to.

For simple stuff like this, it's generally easier to build up from scratch than to hack a generated page's complex HTML. It was an interesting challenge to make a system that would be easy for my cousin to customize without mucking with code; I use "data-" tags so that the "table of content" type links know what section to open, and it should be pretty easy work to show him the structures to use.

I didn't have a lot of placeholder content to work with, and I was having trouble getting traction without it, so I generated a bunch of images and thumbnails. I parsed out some colors from w3schools' html color page and http://listofrandomwords.com/ for words (got my editor macro mojo working to push it into code) I then made a image generator in processing for the squares, fullsize and thumbnail.

I took a snapshot of its current state and put it in my devblog archive. But one cool thing is we were able to grab the domain WDJ3.com (his initials) -- always fun to find a relevant 4-letter .com domain!

Friday, October 17, 2014

growing up

I am accepting that (most?) interesting jobs are using frameworks.

I still think that framework use can bring on 80/20 rule Dietzler's Law hells, and almost by definition makes debugging tougher (since what you're looking at in the browser is more and more removed from the code you as a developer actually wrote - a coder is forced to the techniques of holism without the fallback of reductionism) but there are some pluses, and a lot of smart people really embrace these advantages.

But I mean it's so humbling, going from knowing near-everything relevant (DOM and CSS and Javascript) to knowing near-nothing (trusting the framework to do the right stuff but having it provide whole new worlds to learn) and I need to muscle through.



Even though Plain Old JQuery (along with some clunky Server Side Include for rough reusable modules) proved its value for a rich and complex application at Alleyoop, I have to accept that not everyone believes this is a sustainable, scalable pattern - and also I might not have really rich experience with "one page applications", we got much better mileage when we switched to logical functional breaks tied into various html pages.

I have to remind myself of the learning curve I had to master, to get talented at bending jQuery and CSS to my will.  Sometimes I think the big frameworks fanbase has a lot of folks who actually don't dig HTML5/JS/CSS basics as much, so they don't mind the gap between browser and written code. But this is an unfair assumption.

Meanwhile:
What's Wrong With Angular, a retort Defending Angular, and then the original author assembled a piecemeal list of Angular.js alternatives; getting the functionality that people long for "À la Carte", not buying whole houses when you just want the hightech kitchen.