>>7993808
funny - speaking about a new grammar construct for our language/societal framework, and we can't quite "articulate" what it is.
I feel ya. Rather, I feel the overwhelming lack of basic education among our ranks. No blame/no faults - I know i was the freak born obsessed with words and grammar and languages AND a programmer, so I had an odd leg up when coming to understanding this.
Let me see how this works for explanation, tell me if makes sense.. ?
computers understand binary machine language.
binary means "2", but binary is only made up of 1s and 0s.
now, in programming, you got these conditions and comparison operators. you make a comparison, and depending on its state (true/false) perform an action ( or stop performing an action, you choose - INTENT )
will try to crash course on comparison/conditions
in lax languages (like common english & PHP), typehinting isn't required, and you can mix types, but it leaves the code(context) ambiguous.
here's why: in lax languages, any variable can have any value. a number, a letter, a word, a math equation, an array, an object. its a placeholder for an unknown value.
language PARSERS go through your code either at runtime or compile, and parses the statements you have written, essentially its a task list. performs operations in an order specified by the programmer, or in a procedural manner ( one right after the other ) When you write something like
$money = 0;
(if ($money)) { print $money; }
the conditional if() will return false because 0 = false in lax interpretation.
however, you can write something like this
if (!is_null($money)) { print $money; }
and the parser will evaluate "0 is 0, 0 is a value and not null, so lets print the money"
! is a condition inverter, is_null returns a true if the value is null, if you want a true for "is not null" then you can write !is_null OR if (is_null($money) === false) { … }
so the parser parses the 'intention' of the coder: if condition is met, perform action
What happens though, if your statements are poorly written? Computer misinterprets intention, and its "not working as intended"…
can be quite the PITA when you're dealing with multiple programmers on same team.
So in stricter languages, you have to explicitly define that a variable is a Boolean and once that happens it will ONLY accept true/false values ( NOT 0/1). If the variable isn't explicitly defined at the beginning of the code, it errors out and will not compile. So, in this environment, your parser will detect immediately whether not you're following semantics (language construct) and if not, you get told to fuck off immediately. do not pass go, do not collect $200.
So what :David-Wynn:Miller did was develop a new parsing style that was mathematically reinforced to prevent any ambiguous interpretations - from computers AND the people. ←- the people can no longer argue opinions/feelings based on "well we're arguing this was the context". the context (typehinting) is defined explicitly in the "code" (legal statements) and therefore cannot be muddled with human's fallible nature.
hopfully i made sense to you