web design: another white on gray

web design gray on white 2013-06-11
another fine gray on white.

Web Design: Say No to Grey Text on White Background


unix man page getting obsolete?

these days, man page is getting the slack. Instead, the embedded inline doc --help option is emphasized. Often, the info from --help is more complete than man page. Many programs don't even bother to write a man page, but the linux distributor such as Debian, writes one for them, pro forma.

For example, i wanted to know what's the --minimal option do in xfce4-display-settings. So, i man xfce4-display-settings. The output doesn't mention it.

XFCE4-DISPLAY-SETTINGS(1)                 User Commands                 XFCE4-DISPLAY-SETTINGS(1)

       xfce4-display-settings - Display settings for Xfce

              xfce4-display-settings [OPTION...]

   Help Options:
       -?, --help
              Show help options

              Show all help options

              Show GTK+ Options

   Application Options:
       -v, --version
              Version information

              X display to use

       Copyright © 2004-2008
               The Xfce development team. All rights reserved.

       Please report bugs to <http://bugzilla.xfce.org/>.

xfce4-display-settings 4.6.0 (Xfce 4.6.0)   March 2009                  XFCE4-DISPLAY-SETTINGS(1)

but if i do --help, there it is:

◆ xfce4-display-settings --help
  xfce4-display-settings [OPTION...]

Help Options:
  -h, --help                    Show help options
  --help-all                    Show all help options
  --help-gtk                    Show GTK+ Options

Application Options:
  -s, --socket-id=SOCKET ID     Settings manager socket
  -v, --version                 Version information
  -m, --minimal                 Minimal interface to set up an external output
  --display=DISPLAY             X display to use

Lots other programs are like that, especially newer ones, and in particular those scripts from Ruby community written in Ruby.

this is in fact a good thing, because it lets doc in sync with the software. With man page, it's a separate program, and it's prone to be version discrepancy.

What About GNU info doc?

note that, Richard Stallman's GNU project, wanted us all to use his info doc format instead.

the info doc format is truly superior to man. Info is essentially a text-based hyperlink system, hyperlink as in today's HTML, yet it precedes HTML by a decade. The info doc supports chapters, navigation, cross-reference, search, and is easy to use.

however, there's a major problem: the verbosity of the content. Due to the writing style, info doc, like emacs's manual, are extremely verbose. For example, in the GNU Emacs Manual, it has several chapters telling user what copy paste means, what text editor means, what text selection means.

also, info is full of FSF propaganda.

info doc, like GNU's double-dash syntax diff --brief, are never embraced by unix users. And today, with incredible growth of open source software, by Google, by git, ruby, …, GNU and Info is falling into obsecurity.

Perm URL with updates: http://xahlee.info/linux/linux_manpage_getting_obsolete.html

Unix Shell Syntax, 2000 〜 2013

as of 2013, the unix shell tool syntax have gone thru more evolution.

note, in 1990s, the GNU introduced the double-dash syntax. ⁖ diff --brief, in hope to make it readable. Unfortunately, it didn't really catch on. Most commands today do offer the double-dash variant, but only for some options. The double-dash option does not necessarily mean there's a corresponding single-dash one, and vice versa. What happened instead is just a new syntax variation.

during 2000s, a new syntax form became popular, one that has a “action” keyword immediately following the command name. Here are some prominent examples:

  • apt-get install --simulate -y ‹name›
  • git add -m"…" ‹fpath›
  • iptables --table filter --append INPUT --jump DROP

One good example of the confuse ball in one command can be seen in Linux's “ps” command. See man ps.

read more at: Unix Pipe as Functional Language


the effect of keyboard hardware on your keyboarding habit

Here's a example. From 2005 to 2008, i was using the classic Microsoft Natural Keyboard. In about 2009, i switched to the new model Microsoft Natural 4000. The new keyboard is great, and i think it's a improvement, however, ON THAT KEYBOARD i developed a habit to press the {1, 2} keys by twisting my wrist to the left and press it with my middle finger (instead of using pinky and not turning wrist. (because, somehow on this new model, it's harder to press the 1 with pinky)). Then, i developed RSI symptoms. RSI cause is very difficult to track down, but eventually, after panicking for weeks, i eventually tracked it down to this wrist movement. For the full story, see: Programer Hand Health: vi Esc Key Syndrome.

Here's another personal example: Keyboarding: Effect of Mechanical Key Switches on You.

see also Bad Advices from Programers about Typing & Keyboard (RSI)

JavaScript Book by David Flanagan, and the Man-made Complexity in Computer Language

Perm URL with updates: http://xahlee.info/comp/js_book_man_made_complexity.html

Am very impressed with this book. VERY.

JavaScript Definitive Guide by David Flanagan
JavaScript Definitive Guide (6th ed.) By David Flanagan. @ amazon

Normally, if you've been programing for a few years, you can quickly start to program in a new lang. You just learn the basics, types, loops, list/array, function/objects, module, then you can practically code anything you want, albeit in a non-optimal way. But, you'll have a lot questions, especially with complex languages. Questions like scope, evaluation model, and the language's overall “model”. What happens if you do xyz. Understanding these makes you a true expert in that lang. To understand a lang well, is to be able to have a sense of a mathematical model of the language.

(and almost all modern langs are quite complex, including Java, Python, Ruby. Now, JavaScript is easy to use, but it turns out it's quite complex too actually, the hairy details of its prototype inheritance. Very few languages have simple models (Mathematica, Lisp, do)) (a language with a simple model, would be one that its syntax and semantics can be specified in just a handful of rules. (see: Formal language.) 〔☛ Math Notations, Computer Languages, and the “Form” in Formalism〕)

David Flanagan drills down on the real tech detail of JavaScript language.

I've only read parts of the chapters on JavaScript Objects, and the book is really good.

I noticed that he also wrote one on Ruby: 〔The Ruby Programming Language By David Flanagan. @ www.amazon.com…〕. Am looking forward to read this.

Actually, he wrote several others, on Java, on X11, since at least 1996.

The Cost of Complex Language

Most popular languages are exceedingly complex. The problem is that, you spend years to master them, but, new language comes out and replaces it, and the time you spend learning that language doesn't contribute your understanding to computer science or math in any way. What you learned is sometimes called “artificial complexity”, “man-made complexity”, unlike certain complexity in math or comp sci, that are inherent, unavoidable. Perl, C, C++, and unix tech (Shell, Apache) are good examples of man-made complexity. Lisp, in general, are the polar opposite.


Interface Design: How JavaScript Breaks UI, and the Evolution of User Interface

so many “modern” pure JavaScript based websites f�cks up the page so that basic universal browser operations broke. For example:

• Control+click or middle click on a link to open in new tab, or 【Ctrl+n】 to open new page, will not always work.

Perpetrator include Google's Google Plus, Twitter.

When a key that works only sometimes, it's annoying, but also dangerous, because after a few times of non-working, you stop using that key. Instead, user goes for the sure way of using the more cumbersome mouse.

• When a page contains Video (Flash) such as YouTube, almost always your keys such as ⇟ Page ▽, don't work anymore, because the “focus” is on Flash or some particular JavaScript scripted element, so key input got stolen. You need to click somewhere outside the video first.

From user's perspective, it's plainly annoying. However, the thing is, these fancy sites don't care, for good reasons, because, vast majority of people, probably 90%, don't even know about basic keys. Control+Click would be considered advanced.

so, how do we take this? should this be considered the inevitable progress of UI, or is it simply crassness of the corporations?

dollar sign in JavaScript

lots JavaScript libs use dollar sign “$” as the name of their primary function.

It seems, it started with the prototype lib, then others picked it up, in particular jQuery.

here's a quote from stackoverflow

As far as I can see, it's not recommended to use because the ECMAScript specification states that:

The dollar sign ($) and the underscore (_) are permitted anywhere in an identifier. The dollar sign is intended for use only in mechanically generated code.

Update: The above refers to ECMA-262 3.0. However, this is no longer the latest edition. Currently, 5.1 is the latest edition. In ECMA-262 5.1 the above text is changed to:

The dollar sign ($) and the underscore (_) are permitted anywhere in an IdentifierName.

That is, it seems that they dropped the "restriction" or whatever you want to call it.

So, is this the case where practice forced a chance in spec?

javascript books

JavaScript Books

  • 〈JavaScript Definitive Guide〉 amazon
  • 〈Professional JavaScript for Web Developers〉 amazon
  • 〈JavaScript: The Good Parts〉 amazon
  • 〈JavaScript Web Applications〉 amazon

git tip: fast way to revert to last commit

when you just pulled from remote, and realized it didn't work, you can quickly revert.

# revert before last commit
git checkout HEAD@{1}

Linux: How to Upgrade Xfce

to find your current version, type xfce4-about --version

to upgrade:

# upgrade xfce
sudo add-apt-repository ppa:xubuntu-dev/xfce-4.10
sudo apt-get update
sudo apt-get dist-upgrade
# delete cache
rm -rf ~/.cache/ ~/.compiz

# restart
sudo shutdown -r 0