The article does not explain how it gets the {}, which is used to get the Object constructor string. Other than that it's very clear.
A Javascript journey with only six characters
41–50 of 123 posts
Re: A Javascript journey with only six characters
#42The article does not explain how it gets the {}, which is used to get the Object constructor string. Other than that it's very clear.
It does, see the "fill" step: «So now we have acquired the following extra characters: c,o,v,(,),{,[,],}, .».
Re: A Javascript journey with only six characters
#43Re: A Javascript journey with only six characters
#44Earlier quoted context omitted.
For what it's worth, Brendan Eich is a joke for technical reasons as well, like creating JavaScript.
That's un-called for.
http://a.abcnews.com/images/Social_Climber/GTY_brendon_eich_...
No other reason.
I just can't support the immoral glutton lifestyle.
Re: A Javascript journey with only six characters
#45Re: A Javascript journey with only six characters
#46This is an extreme demonstration of the validity of a delightfully snarky blog post by Robert Harper on how dynamic typing is actually static typing using a unitype: https://existentialtype.wordpress.com/2011/03/19/dynamic-lan... A string is a Boolean is a number is a function, and braindead conversions can happen without anyone noticing. How does one keep their sanity using a language like that?
These properties are separate issues. A language is either statically typed or dynamically typed, and it is also either strongly typed or weakly typed.
In a statically typed language, types are attached to variables. In a dynamically typed language, types are attached to values. Do note that many languages don't fit 100% into either category. (Note that the blog post you linked to calls types attached to values classes, but that distinction often isn't made so clearly.)
A weakly typed language performs implicit type conversions as it deems necessary, while a strongly typed language does no implicit type conversions. Most languages don't fit 100% into either category. Usually languages that are considered to be strongly typed still allow you to add integers to floating point numbers, for example.
It is possible for a dynamically typed language to be so strongly typed that it won't do any implicit type conversion, ever. Such a language would not allow you to, say, add an integer and a floating point number without explicitly converting one to the other.
It is also possible for a statically typed language to be so weakly typed that it implicitly converts types everywhere. Such a language might do the exact same things the OP uses, like converting a function to a string of its source code when adding it to a string.
Re: A Javascript journey with only six characters
#47It's too bad that people were willing to ostracize Brendan Eich for not being a cookie-cutter silly-valley progressive. Oculus is facing that now. It's the new mccarthyism.
Re: A Javascript journey with only six characters
#48This doesn't make me want to use JS. The power of JS is in two things, it's in every major browser and it doesn't completely suck. JS syntax kind of sucks. The power in JS is that it's dynamic and lets you send functions around, but defining functions is much uglier than defining a lambda in Ruby: -> {anything goes here} or ->(a,b,c) {anything goes here} The problem with Ruby is that you then have to .() the lambda v…
ES6 lets you define functions like a => a * 2 Or (a, b, c) => a * b ^ c
JS:
let f = (a,b,c) => a * b ^ c;
f(2,3,4);
vs. Ruby: f = ->(a,b,c) { a * b ^ c }
f.(2,3,4)
Ruby's shorter and clearer. But, when you use the Ruby lambda more than once in the code, you lose the brevity advantage, because of the "extra" dot. But, in Ruby I use methods more than lambdas, which would be: def f(a,b,c) { a * b ^ c }
f(2,3,4)