Xah Programing Blog Archive 2016-04


Unicode Math Symbols ∑ ∫ π² ∞

starting a dedicated keyboard blog. See

Subscribe Xah keyboard Blogkeyboard_blog.xml

Subscribe there. I'll not duplicate keyboard stuff here. Thanks.

a dedicated keyboard blog allows me to freely post any keyboard related stuff quickly without dithering.

had a clarity, about designing my JavaScript svg library.

JavaScript Language Design: Dot Notation be Namespace or Object System

sigil for my φvariable ξnames

fret about whether i should continue using funky sigil for my variable names. As in:

xd.drawCircle = function (φcontainer, φcenter, φr, φstyle) {
    let ξcir = document.createElementNS("http://www.w3.org/2000/svg", "circle");
    ξcir.setAttribute("cx", φcenter[0]);
    ξcir.setAttribute("cy", φcenter[1]);
    ξcir.setAttribute("r", φr);

    if (φstyle !== undefined) { ( ξcir.setAttribute("style", φstyle)); };

    if ( φcontainer === undefined ) {
        return ξcir;
    } else {
        return φcontainer.appendChild (ξcir);

the problem, is people. Other people.

you see, it's like the many english spelling reform. It is sound and good, except, the masses, idiots, will not have it, and is doom'd to failure.

the reason i want to do it is here: Sigil for Function Parameter Names and Programing Style: Variable Naming: English Words Considered Harmful.

but i thought about it more due to the my dilemma of continuing the practice, in JavaScript or any lang other than emacs lisp. I took a walk, talking to myself, for 30 min. Here's some more insights.

the essential good of it, is that it embeds semantic info into syntax. That is, you can tell if a variable is a function parameter, or local variable, or not global, just by its name.

This is in general called sigil. (most popularized by perl, followed by ruby.)

there are other examples of widely accepted practice of embedding semantic info in syntax. For example, in Java and python, class names starts with capital letters. This is a strong convention, everyone follows. It is important, because, classes, variable, methods, have very different semantics. Being able to tell by a glance saves you time or error.

also read, if you are inclined:

but i think am going to stop this geek char sigil practice. My emacs lisp code base are full of it, it's hopeless. For lisp, i probably should push on my way, as lisp is weird already and lisp people are weird. But for my JavaScript code, which there isn't much, am thinking of stopping this φsigil ξthing, while the night is young!

the problem, is that whenever it is exposed and seen by other people, it's a problem. You'll need to do explanations, and you'll win yourself a weirdo badge. And, other consequences. For example, the jslint won't accept names that start with Unicode char.

unless, i keep my code to myself only. Imagine, i, am the greatest coder, couldn't care less what other coder do or say. I just churning out my own code that rules the world. Well, it hasn't happened yet.

Google Plus https://plus.google.com/+XahLee/posts/Ei5eKe8T49i

Ontology of Postfix Notation, Method Chaining, and Unix Pipe

24hours Watch, 00 Start at Top or Bottom?

new language, Kotlin, from JetBrains. Runs on Java Virtual Machine. Similar to Java, but designed to improve java.

Proliferation of Computing Languages

The Complexity of Java Access Specifiers (oldbie, new home)

Clojure's Ring, Compojure, hiccup, perfect doc!

Clojure's Ring, Compojure, hiccup's docs are SUPERB! all by the same guy. Clear, concrete, + example! a rarity in industry.

by the way, the code are written by the same guy too. The guy is James Reeves, aka @weavejester. github at https://github.com/weavejester

see also Clojure: Essential Libs for Web App

HTTP Protocol Tutorial (new)

Python: GET Webpage Content

Perl: GET Web Page Content (on its own page)