Xah's Programing Blog

On programing, languages, functional programing, Unicode, keyboard, hacker culture, ….

Want to master JavaScript in a month? Commit. Buy Xah JavaScript Tutorial. You also get Xah HTML Tutorial and Xah CSS Tutorial.

i'm doing more and more JavaScript. Visit my Xah's Web Dev Blog for goodies. Click subscribe web dev blog.xml.

updated on the JavaScript + svg. Computer Languages Character Distribution

See also: Xah SVG Tutorial

Idiocy of Keyboard Layouts: QWERTZ, AZERTY, Alt Graph (minor update)

atom feed broken relative link, base url. No, hackers are broken.

in atom feed (aka webfeed, rss), by spec one can have a base url where other url are relative to, ⁖

<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://ergoemacs.org/emacs/">

this is required by spec.

but it's quite annoying that most webfeed/rss clients are broken about it. i regularly got complaints about my feed links being broken. My guess is that many saw the broken links and simply stopped subscribing.

(many clients, simply don't support the atom feed to this day. This include Emacs GNUS at least last year.) (Atom feed format is far superior than rss created by the scmbg Dave Winer. see 〔Atom vs. RSS By Christopher Wellons. @ http://nullprogram.com/blog/2013/09/23/〕)

many moons ago, when Google Reader was around, in the beginning, it was also broken, but later on they fixed it. Same for yahoo.

recently, Christopher Wellons's https://github.com/skeeto/elfeed/issues/37 also had this problem.

No, the hacker idiots are broken. The hackers, the industry coders, the agile fk, the extreme programing fk, the google io fk, the linux fk, and the RFC fffffffffkk, n one thousand frameworks fk.

see the section “Webfeed Reader Bug on Relative Link” at Atom Webfeed Basics

see also Complexity & Tedium of Software Engineering

comment at https://plus.google.com/+XahLee/posts/5JrhNjhtXRT

How to unadd a file?

# unadd a file
git reset myFileName
# unadd all added files in current dir
git reset .

is programing math?

How to Stop Xfce from Loading Last Session

marketing is the primary government of lang popularity. If JavaScript was named LispScript with nested parens, it'd have failed.

LispyScript. A javascript With Lispy Syntax And Macros! http://lispyscript.com/

just wtf is closure❓

One of the things i'm most annoyed with hacker types is closure. The hacker types, always clamor about closure, how powerful it is.

but, functionally, mathematically, closure is equivalent to using global variables. But the hacker types, don't get it.

Mathematica Expression Forms

mathematica7 expression forms 2014-07-11
Mathematica expression forms. Top: InputForm. Middle: StandardForm. Bottom: FullForm.

note: the indentation is automatic. There's no Tab character anywhere.

The FullForm at bottom, is isomorphic to lisp's sexp. In lisp, you have (f a b c). In Wolfram Lang, it's f[a,b,c].

comment at https://plus.google.com/+XahLee/posts/apFFHAZtksB

JavaScript functional programing flexible coding style problem

one problem with functional programing in JavaScript and Wolfram Language is that, when there are a team of coders, the code becomes incomprehensible.

because, the function can be chained, function return functions, and the chaining function or method syntax is too convenient. So, everyone has a different coding style (here, the style refer to the semantic construct, not formatting). So, code become hard to understand.

lisp doesn't have this problem because the parenthesis prevents people chaining functions arbitrarily.

this is when python shines. First of all, it has a crippled lambda, so you can't have arbitrary functions inline or chain them. You have to define it by itself. Then, the language syntax prevents you from writing one-liners.

java, also works here. Because, the lang is so inflexible that you have to write everything out, each line can only do very little.

though, as a language designer, what can you say about this? what can you do?

isn't it ironic that if you create a language so powerful & flexible that it backfire? Something must be wrong with this logic? how to resolve this paradox?

in my way of thinking, whenever result of mathematical analysis conflict with human intuition or practice, it is human that needs to adopt. (⁖ relativity, flat earth, concept of size, dimension, time. Habit. superstition. religion, etc.) but we must be very careful.

so here, if we verify by science truly that powerful language with flexible syntax indeed create a problem due to multitudes of incompatible programing style, then, the issue is about how to create or enforce a style. Because, math tells us that ensuring a unified style is a problem by itself.

many language designers, cut corners. They think, O that's too flexible and create a multi-style problem, therefore my language will not have this syntax. That is confounding of issues. It will solve the problem near-term, not long-term. It's like the qwerty layout for typewritters. When typists types too fast and the key jams, the problem was solved by changing the layout so typists can't type fast.

comment at https://plus.google.com/+XahLee/posts/jdhaR786KDg

Linux: Control Sound Level with Command Line (on its own page)

Java Tutorial: The “extend” Keyword (minor update)

The Sounds of Obsolete Technologies 1990 〜 2000 (repost)

(xd.draw_vertical_grids(0,φwidth,0,φheight, lang_chars.length + 1)).map(function (x) {φsvg_element.appendChild(x);});

am starting to code javascript like Mathematica. Sweet!

and this is a major problem that lisp can't do, due to the nested paren. see Programing Language: LISP Syntax Problem of Piping Functions

this is a syntax induced semantic problem. similar happens to python, see Why Python's Lambda is Broken and Can't be Fixed

Concerning the Cut Off of the Flow of the Code

so, i have this nice code:

// …

            var xlink = getRandomPath();

            // 338 pages. 1/338 = 0.002958
            if ( xlink.search(/hrefgram2/) !== -1 ) {
                if ( Math.random() < 0.0029 * 0.0029 ) {
                    return xlink;
                } else { return getRandomPath(); }
            }

            // 203 pages. 1/203 = 0.004926
            if ( xlink.search(/monkey_king\//) !== -1 ) {
                if ( Math.random() < 0.0049 * 0.0049 ) {
                    return xlink;
                } else { return getRandomPath(); }
            }

            return xlink;

jslint is telling me:

Unnecessary 'else' after disruption.

after looking up, it means he says that my else is redundant, that i should do

if (…) {
            return xlink;
        }
        return getRandomPath();

Redundant his ah.

didn't my mom say, if you can't say things nice, shuddayap?

actually, after thinking about it, i think the jslink style is better. My thought flow goes like this:

comment at https://plus.google.com/u/0/+XahLee/posts/F7CpXB3w3ES

Programing Language: Function Dependency

Hackers and the Foobar Phrase

JavaScript variable hosting, should you move variables declaration to top?

so, recently i've been thinkin about JavaScript's name hoisting. 〔☛ JavaScript: Variable & Function Declaration Order: Name Hoisting

am thinking, what a bizaro behavior. Was it accidental or by design? I think it must be design, because it can't happen by accident. But who would design a loon like that?

then, it just dawn'd on me now, there's precedence: lisp!

(let (x y z)
 ; ...
)

so, thinking about it, it's really alright. A bit odd, but alright.

i think i'll adopt to actually do move all my var declarations to top.

see this for context: JavaScript Name Hoisting and One-Liner Functional Style

comment at https://plus.google.com/+XahLee/posts/A4QLPLNi2QB

Programing Language: Fundamental Problems of Lisp

What'S the Airspeed of Unladen Swallow?

python unladen swallow wolfram alpha 3

Programer Humor: Wolfram Alpha Ad: Python Unladen Swallow

How Many Keystrokes Programers Type a Day?

most programing languages are garbage, when compared to Wolfram Language (aka Mathematica)

on power, practical useness, flexibility, and simplicity. Counting fancy ones like Haskell.

this is Mathematica: http://blog.wolfram.com/2012/07/20/on-the-importance-of-being-edgy-electrostatic-and-magnetostatic-problems-with-sharp-edges/

and, look at the use of math symbols.

Syntax Coloring in Editors

i can't decide which is the worst hack.

Windows Programing: AutoHotkey Syntax Problems

or, unix perl sh�t. Example: Unix Pipe as Functional Language

or Second Life, the Worst Hack in Universe

or web dev with JavaScript html css dom. Example: JavaScript: Array vs NodeList vs HTMLCollection

in comparison, i think my complaints about perl, python, are penuts.

of the above, i think the winner is either Second Life or JavaScript web dev. Second Life probably worse.

comment at https://plus.google.com/+XahLee/posts/Y4YKYApbMM4

Git: Save Working Tree in a Temp Storage: git stash

Computer Language: Predicate Function, Terminology, and Naming Convention

Language Syntax: Brackets vs Begin/End vs Indentation for Nesting (updated)

Keyboard: What's the Difference Between Alt Graph Key, Compose Key, Dead Key?

Unicode: Greek Alphabet α β γ δ ε ζ η

Unicode: Math Symbols ∑ ∞ ∫ π ∈ ℝ² (updated)

Linux Command to Download YouTube Video (updated. Thank to Christopher Wellons)

Keyboard Enter/Return Key Symbol — a Survey (updated)

Short Survey of Keyboard Shortcut Notations (minor update)

updates

What are OOP's Jargons & Complexities (OOP as Functional Programing) (old article. Updated dead links.)

Math Font, Unicode, Gothic Letters, Double Struck, ℤ ℚ ℝ ℂ ℍ ℜ ℑ ⅇ ⅈ (updated)

The Moronicities of Typography: Hyphen, Dash, Quotation Marks, Apostrophe (minor update)

Scala, Lift Web Framework

Lift (web framework)

Lift is a free web application framework that is designed for the Scala programming language. It was originally created by David Pollak who was dissatisfied with certain aspects of the Ruby on Rails framework.[4] Lift was launched as an open source project on February 26, 2007 under the Apache 2.0 license. A commercially popular web platform often cited as being developed using Lift is Foursquare.[5]

Beginning Scala by David Pollak amazon

Why You Need a Jog-Wheel? (updated)

How to Get Your Github ID

this is how you get your github id: https://api.github.com/users/xahlee

see also: Git: Setting Up Git on GitHub.

A value proposition is a promise of value to be delivered and acknowledged and a belief from the customer that value will be appealed and experienced.

Value proposition

Unicode in Ruby, Perl, Python, JavaScript, Java, Emacs Lisp, Mathematica (minor update)

new crotchet: all function parameter names should start with φ. Sigil for Function Parameter Names

Linux: Bash Manual in Chapters, Using Emacs for Info (updated)

Past Articles by Date