Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

why arent you using GNOME already?

Name: Anonymous 2013-02-11 16:55

Name: Anonymous 2013-02-11 16:59

sawfish

Name: Anonymous 2013-02-11 17:31

I'm not using it because Javashit is becoming the default language for GNOME apps.

Name: Anonymous 2013-02-11 17:32

>tfw newfags will literally pine over python as ``the good old days'' like in that one article where top web devs said they missed the 2007 web

Name: Anonymous 2013-02-11 17:34

>>4
Fuck off back to /g/, cocksucking meme-spewing shitstain.

Name: Anonymous 2013-02-11 17:36

The Achilles Heel of JavaScript is its inconsistent behavior across implementations. It is virtually impossible to use it to do anything robust on the client side.

JavaScript is weakly typed, and the automatic coercions that it does can produce surprising results. "2" + "3" is "23" (+, when applied to two strings, performs concatenation); "2" * "3" is 6. (Multiplication not defined for strings; so the language tries converting them to numerals, succeeds, and multiplies those). This can be surprising.

Rather annoying gotcha in array constructor. new Array() produces empty array; new Array(2,3) produces array with 2 and 3 as its elements. new Array(5) does not produce array with 5 as its single element; instead, it returns a 5-element array!

Whereas most languages have one universal singular value (null/nil/Void/whatever); JavaScript has three - "false", "null" and "undefined". That leads to confusing and irregular semantics.

No integral types - the only numeric type supported is an IEEE754 double-precision float. For a scripting language, this limitation is probably less obnoxious than it would be elsewhere.

Language has LexicalScoping, but with an interesting twist. Unlike JavaScripts brethen C/C++/Java/C#/etc, where variables introduced in an anonymous block within a function are only valid within that block; in JavaScript such variables are valid for the entire function.

Every script is executed in a single global namespace that is accessible in browsers with the window object.

Automatic type conversion between strings and numbers, combined with '+' overloaded to mean concatenation and addition. This creates very counterintuitive effects if you accidentally convert a number to a string:


 var i = 1;
 // some code
 i = i + ""; // oops!
 // some more code
 i + 1;  // evaluates to the String '11'
 i - 1;  // evaluates to the Number 0

The automatic type conversion of the + function also leads to the intuitive effect that += 1 is different then the ++ operator:

 var j = "1";
 j++; // j becomes 2
 
 var k = "1";
 k += 1; // k becomes "11"


'' == '0' //false
0 == '' //true
0 == '0' //true
false == 'false' //false
false == '0' //true
false == undefined //false
false == null //false
null == undefined //true
typeof NaN //number
NaN == NaN //false

var a = [123];
var b = 123;
a == b; //true
a[0] == b[0]; //false

var a = [0];
a == a;  //true
a == !a; //true

" \t\r\n" == 0 // true
Math.min() < Math.max(); // false
",,," == Array((null,'cool',false,NaN,4)); // true

new Array([],null,undefined,null) == ",,,"; // true

var foo = [0];
foo == foo  // true
foo == !foo // true

function toInt(number) {return number && + number | 0 || 0;}
toInt("1");  // 1
toInt("1.2");  // 1
toInt("-1.2");  // -1
toInt(1.2);  // 1
toInt(0);  // 0
toInt("0");  // 0
toInt(Number.NaN);  // 0
toInt(1/0);  // 0


[] + [] //
[] + {} // [object Object]
{} + [] // 0
{} + {} // NaN
"S" - 1 // NaN


$ js --version
JavaScript-C 1.7.0 2007-10-03
usage: js [-PswWxCi] [-b branchlimit] [-c stackchunksize] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile] [scriptarg...]
$ js
js> 0 == ''
true
js> false == 'false'
false
js> false == '0'
true
js> false == undefined
false
js> " \t\r\n" == 0
true
js> Math.min() < Math.max()
false
js> ",,," == Array((null,'cool',false,NaN,4))
true
js> var foo = [0]
js> foo == foo
true
js> foo == !foo
true
js> function toInt(number) {return number && + number | 0 || 0;}
js> toInt("1")
1
js> toInt("1.2")
1
js> toInt("-1.2")
-1
js> toInt(1/0)
0
js>

Name: Anonymous 2013-02-11 17:39

>>4
Nobody likes FIOC here.

Back to the oven, ``בבקשה''.

Name: Anonymous 2013-02-11 19:29

>>6

nerd

Name: Anonymous 2013-02-11 19:31

>>7
Assalasalami, raghead!

Name: Anonymous 2013-02-11 22:04

Pretty interesting, >>9

Name: Anonymous 2013-02-12 0:09

The Achilles Heel of JavaScript is its inconsistent behavior across implementations. It is virtually impossible to use it to do anything robust on the client side.
This was true years ago, but isn't anymore. Any semi-modern browser has a consistent and well-tested core language and DOM APIs for dealing with HTML/XML documents, event handling, etc.

JavaScript is weakly typed, and the automatic coercions that it does can produce surprising results.
Yes, type coercion can be confusing. So don't do it. Use strict equality (=== and !==), and explicitly convert things to booleans using ! or !! in comparisons to make your intent clear. It's a language flaw, but not a hard one to avoid.

Rather annoying gotcha in array constructor.
Fair point. Fortunately there's a concise syntax for creating array literals that saves you from ever having to touch the Array constructor: [].

Whereas most languages have one universal singular value (null/nil/Void/whatever); JavaScript has three - "false", "null" and "undefined". That leads to confusing and irregular semantics.
false doesn't belong in this category at all. Whoever wrote this is confusing type coercion with nullity. I agree the distinction between null and undefined was a design mistake. They should've used null everywhere. That said, in good code you can treat undefined like a sentinel: if it shows up in your program, you're probably doing something wrong.

No integral types - the only numeric type supported is an IEEE754 double-precision float. For a scripting language, this limitation is probably less obnoxious than it would be elsewhere.
For any situation where this is important, you can use typed arrays. [1]


Works Cited
[1] https://developer.mozilla.org/en-US/docs/JavaScript/Typed_arrays

Name: Anonymous 2013-02-12 0:10

Pretty interesting, >>11

Name: Anonymous 2013-02-12 4:06

>>11
So, for all the issues cited, you just say "Use these workarounds instead"?

Name: Anonymous 2013-02-12 4:17

>>13
That is right, do you think there is an easier way to deal with these issues without changing the language?

Name: Anonymous 2013-02-12 4:22

>>14

Yes. Banish the language from the existence and use a substitute.

Name: Anonymous 2013-02-12 4:23

>>15
Nobody has bothered to publish a new standard. I want to see client-side web scripting in R6RS.

Name: Anonymous 2013-02-12 8:10

I want to see SEXprs become more popular by any means. The past is Lisp, the present is Lisp, the future is Lisp.

Name: Anonymous 2013-02-12 10:05

The only reason I can think of where Javashit is appropriate for a scripting engine is if the implementor of a piece of software wants:
1. to punish its users with a shitty scripting language with the only benefit that it isn't completely balls slow,
2. to pretend their app is a web widget engine, the 120,000th app to do so,
3. to gain the benefits of running Mentifex AiMind.

"CLOUD SCALE"

Name: 18 2013-02-12 10:33

... But then I also don't like FIOC either so you have a tiny little redeeming point >>1.

Name: Anonymous 2013-02-12 10:44

>>16
No. R7RS.

Name: Anonymous 2013-02-12 11:25

>>15
Well, the execution speed of JavaScript engines is now good enough that you can use different languages that compile down to JavaScript.

https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

Name: Anonymous 2013-02-12 11:57

>>21
plus there is no other dynamic language that even remotely approaches v8 in performance and especially absurdly low memory usage for such considering all the jit state it has to keep

is there any surprise it's winning?

Name: Anonymous 2013-02-12 11:59

jashkenas
JEWISH ASHKENAZI

Name: Anonymous 2013-02-12 13:06

>>20
NO U

Name: Anonymous 2013-02-12 13:34

>>23
Yeah. Ashkenaz (and its variation) is a common Jewish surname.

Name: Anonymous 2013-02-12 13:35

Name: Anonymous 2013-02-12 13:38

check 'em

Name: Anonymous 2013-02-12 16:28

>>21
``compile down''

>>22
any brick that gets enough jewish funding can get enough momentum to fly, hymie

Name: Anonymous 2013-02-12 17:30

Well, given the choice between a brick that is widely deployed and flies reasonably well, and a sleek glider that is better designed and faster but available nowhere and used by nobody, guess which one I'll pick for any serious work.

Name: Anonymous 2013-02-12 17:34

>>29
Nobody else uses Javascript on the desktop, because it's one of the worst languages in common use. It's not tried and true in that space, it's just a shitty competitor which was elevated to to official status due to its popularity in another domain.

Name: Anonymous 2013-02-12 17:36

>>29
The glider? Glad to know there are reasonable Gentiles in this world.

Name: >>28 2013-02-12 18:07

By the way, I'm just wondering: have you goys ever craved jewish cock so badly that you found yourself running around outside, howling at the moon for it? Literally ROARING at the top of your lungs, wanting nothing less than a jews's dick head churning against your glottal stop?

Tell me I'm not alone.

Name: Anonymous 2013-02-12 20:25

>>30
That's not quite true. Firefox uses JavaScript for most of its user interface, and (obviously) GNOME Shell and Windows 8. Most desktop apps are just glorified widget-layout engines, anyway, which makes scripting languages convenient. For any truly computation-intensive work you can always call a native library.

it's one of the worst languages in common use

Despite JS's warts, it's concise, portable, performs OK, and is not Java, C#, or C++. That makes it pretty good in my book. YMMV.

elevated to to official status due to its popularity in another domain.

We call that synergy, bro.

Don't change these.
Name: Email:
Entire Thread Thread List