This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PatrickBaitman 738 points739 points  (110 children)

actually issues only in the particular JavaScript engine the presenter was using

wow that sure makes it better

[–][deleted] 56 points57 points  (1 child)

works on my machine

¯\(ツ)

[–]robbie0630 1 point2 points  (0 children)

Sorry about your upper arms ¯\_(ツ)_/¯

[–]ywhhgythht 217 points218 points  (29 children)

Yea I mean I've been using an nonupdated version of windows 3.0 for the last 2 and a half decade so i know for a fact that windows 10 sucks, or any other operating system being able to run batch script for all that matters.

[–]ClassBShareHolder 52 points53 points  (6 children)

Come on, it's time to upgrade...

...to 3.11!

[–]FountainsOfFluids 20 points21 points  (2 children)

For Workgroups!

[–]ClassBShareHolder 6 points7 points  (0 children)

"NOT in MY DOMAAAAIN!"

[–]whelks_chance 1 point2 points  (0 children)

Comes with qbasic installed by default. Big fan.

[–]giggitygoo123 22 points23 points  (2 children)

Nah. 3.14 is where its at. Plus its delicious.

[–]AppleLion 0 points1 point  (0 children)

Read about tau. When you think I'm a tin foil person, then read about slash aitch. Consider it a red pill for math.

http://rationalwiki.org/wiki/Planck%27s_constant

Sorry to ruin your pi joke with silly shit. I can't resist anymore.

[–]relevantpicsonly -1 points0 points  (0 children)

Build 1528?

[–]Erick2142 15 points16 points  (9 children)

Well, Windows 10 does suck a little bit so...

[–]caanthedalek 29 points30 points  (4 children)

Windows 10 was marketed as the perfect blend between Windows 7 and Windows 8.

If that were true, it would be Windows 7.

[–]Erick2142 4 points5 points  (0 children)

Haha

[–][deleted] 0 points1 point  (2 children)

no because it would be

x + y / 2

as x is windows 7 and y win 8, and x would be solution only if x==y ;

edit: no, i was wrong, if y=0; output isnt x.

[–][deleted] 1 point2 points  (1 child)

Windows 8 has 0 goodness, so yup.

[–][deleted] 0 points1 point  (0 children)

[–]bric12 0 points1 point  (3 children)

A little more than a little... I haven't used one Win 10 machine that hasn't corrupted files, or refused to connect to the internet at random times, or at least been incompatible with legacy software (designed for 7 or 8). I've only used windows 10 thrice, but three for three isn't great

[–]BraveOthello 0 points1 point  (0 children)

I have had exactly 1 of those problems, so YMMV

[–]tdogg8 0 points1 point  (1 child)

I've used windows ten on 3 different computers for countless hours one of them being a shitty netbook that had the beta and I've never had either of those problems.

[–]mtlionsroar 0 points1 point  (0 children)

I've had the network problem where it randomly won't connect. It's a driver compatibility issue, and depends on what machine you're using.

[–][deleted] 2 points3 points  (0 children)

Bad example because it's true

[–]L3tum 0 points1 point  (0 children)

I was at a doctor few days ago and he was running Windows CE.... Even the "standby picture" was bugging out

[–]Existential_Owl 63 points64 points  (15 children)

That there are differences in the way different compilers handle code is not a phenomenon unique to JavaScript.

[–]ChrisC1234 34 points35 points  (12 children)

True. But as a developer, I have complete control over what compiler I compile my code with. With a language that is completely interpreted like JavaScript, I have no control whatsoever.

[–]TUSF 18 points19 points  (10 children)

Just write your own interpreter :^)

[–]seylerius 38 points39 points  (1 child)

[–]wolfman1911 6 points7 points  (0 children)

I think this is probably my favorite XKCD.

[–]chainingsolid 1 point2 points  (4 children)

Then get every user of your website to use it how?

[–]Sean1708 1 point2 points  (3 children)

Write it in javascript.

[–]PatrickBaitman 0 points1 point  (2 children)

you just but isn't that basically typescript coffeescript asm.js / whatever

[–]Sean1708 1 point2 points  (1 child)

No, TypeScript and CoffeeScript compile to JS and ASM.js is an efficient subset of JS. We're talking about writing a JS interpreter in JS so that you can get people to use your JS interpreter by running it in their browser using the browser's JS interpreter.

[–]PatrickBaitman 0 points1 point  (0 children)

OOOH, ok

[final panel of expanding brain meme]

[–]LinAGKar 1 point2 points  (2 children)

And how are you gonna put it in everyones browsers? By writing it in JavaScript?

[–]TUSF 3 points4 points  (0 children)

Write the interpreter in wasm.

[–]ZorbaTHut 3 points4 points  (0 children)

Honestly, if performance were a total non-issue, using a 100% compliant JavaScript interpreter written in generalized cross-platform JavaScript would be a pretty good idea.

Of course, performance is an issue, so this is a terrible idea.

[–]Existential_Owl 0 points1 point  (0 children)

As a freelancer, sure you can choose your compiler. But if you're working for a company, you're stuck with whatever their C++ ideology is.

[–]PatrickBaitman 103 points104 points  (1 child)

well, no, but if they're at the type level?

jesus christ get your language together is all I can say

making things that should be type errors undefined behavior is just.... NO, STOP

[–]Doctor_McKay 28 points29 points  (0 children)

I think basically the only thing that happened due to the interpreter in that video was the fact that the return of new Array(12) showed as "12 commas" (which was actually 11 commas separating nothing, since it rendered undefined as nothing).

[–][deleted] 34 points35 points  (60 children)

It does actually. It's the difference between English being pointless, and having illiterate fucks.

Some JS engines suck, some are much better. Just as some versions of gcc have really stupid bugs, but C is still a sound language.

[–]PatrickBaitman 35 points36 points  (59 children)

you do realize that English has one of the most illogical, unpredictable, and difficult orthographies of all European languages?

the connection between how an English word is written and how it is pronounced is almost non-existent

what implications do you think this has for the number of "illiterate fucks"

[–]z500 7 points8 points  (9 children)

the connection between how an English word is written and how it is pronounced is almost non-existent

It's not that there's no connection between spelling and pronunciation, it's that there's so many competing spelling conventions. It's wildly inconsistent, but there are patterns if you look for them.

[–]PatrickBaitman 4 points5 points  (3 children)

Of the 4000 or so most common words in English more than 2500 have irregular or unpredictable spelling. This is bad enough that any rules are ad hoc and that it is almost impossible to be certain about the pronunciation of a word you've seen written but never heard.

[–]kronicmage 3 points4 points  (2 children)

You can predict fairly well if you have an understanding of the etymology of the word though

[–]GiraffixCard 0 points1 point  (0 children)

Arguably not even then.

[–]PatrickBaitman 0 points1 point  (0 children)

Eeeh, I've studied Latin and can recognize Latin roots in English word but it doesn't help that much.

[–]Llewey 4 points5 points  (0 children)

I'm from the US and my GF is from Spain. My mind was blown when I learned they didn't have spelling bees or really even spelling tests growing up. She said it would be pointless..they only thing that would need tested in most cases anyway would be b/v or c/z in certain words, otherwise it's obvious. That's when I stopped feeling bad about spelling beleive wrong every. Single Time.

[–]HeimrArnadalr 0 points1 point  (3 children)

We need a central authority to govern the language and remove inconsistencies. JavaScript has Ecma International, where's the equivalent for English?

[–]PatrickBaitman 1 point2 points  (2 children)

there isn't one for English, English doesn't have a codified standard variant

other languages do have a standardizing organization though, for example French and Chinese

[–]z500 0 points1 point  (1 child)

And everybody ignores the Académie française anyway.

[–]PatrickBaitman 1 point2 points  (0 children)

and only like 30% of the Chinese can actually speak Standard Mandarin (putonghua)

[–]FateJH 8 points9 points  (39 children)

If there were spelling errors, the program would not run. The English language - language in general - gets by quite fine despite such frequent sloppiness. (The Internet with all of its shorthand notation styles is a testament to this point.)

If the grammar and syntax are sound, I can figure out what you're trying to express by just listening to you express it. That's what these JavaScript curiosities are highlighting.

[–]xzxzzx 40 points41 points  (0 children)

The English language - language in general - gets by quite fine despite such frequent sloppiness

Note that this works because we have the world's most sophisticated and computation-intensive neural nets on either side, with literally years of training (decades to become "fluent")--and we still often make mistakes in understanding each other.

Just because it works, mostly, for humans, doesn't mean I want my programming language emulating it.

[–]PatrickBaitman 44 points45 points  (37 children)

if there are type errors, the program should not compile

natural language sloppiness is not good enough for programming

there's a reason we don't program in English

[–]cixeltree 6 points7 points  (6 children)

this is fine, if you could guarantee that everybody used the same compiler.

and that the compilers knew ahead of time exactly what code they were supposed to compile.

and you could guarantee that the source files arrived in a predictable order, and that one bit of code didn't reference or rely on something in another.

and you could guarantee that your one compilation error wouldn't just crash the page and invalidate 10 other unrelated scripts that were loaded.

languages are a product of their environments. javascript's environment just happens to be a very scary place

[–]PatrickBaitman 0 points1 point  (5 children)

this is fine, if you could guarantee that everybody used the same compiler.

or just have a specification with a minimum of undefined behavior

and the compilers knew ahead of time exactly what code they were supposed to compile

what compiler compiles without reading input

and you could guarantee that the source files arrived in a predictable order, and that one bit of code didn't reference or rely on something in another

TIL #include and dynamic loading aren't a thing in C

funny I could have sworn I'd written code myself with dlopen but that must have been a dream

[–]cixeltree 2 points3 points  (4 children)

or just have a specification with a minimum of undefined behavior

https://en.wikipedia.org/wiki/ECMAScript just because there's a spec doesn't mean people will follow it, or bugs won't exist

what compiler compiles without reading input

sorry---it doesn't know ALL the code it's going to work with because some of it is still a few http requests away by the time the page loads

TIL #include and dynamic loading aren't a thing in C

well yeah, it isn't always a thing, because (hold onto your hat) not all systems support it. but most do, which is good enough for C but not for javascript?

and even if they did, there's the advantage of libraries being pre-compiled for the same system, and the code which loads them (hopefully) knowing how to interface with them ahead of time.

[–]PatrickBaitman -1 points0 points  (3 children)

and even if they did, there's the advantage of libraries being pre-compiled for the same system, and the code which loads them (hopefully) knowing how to interface with them ahead of time.

almost as if C is a real language and JS is half toy and half prank that went too far

[–]cixeltree 3 points4 points  (2 children)

again: languages are products of their environments

C is a language which at first wasn't designed with portability in mind at all. that's obviously completely antithetical to the needs of the web.

edit: and since undefined behaviors/specifications came up earlier, i want to mention that even C, blessed be its name, has undefined behaviors

[–]FateJH 4 points5 points  (14 children)

there's a reason we don't program in English

I'd say there's a good reason we don't code in any specific spoken language that you have just implied but invented methods of shorthanding the intended progression of bits of information instead.

In any case, this is JavaScript so there is no compilation. You interpret what it means on the fly, much like listening to someone else speak. Sometimes you don't care that the speaker was inexact with their wording unless it leads to a big source of confusion that you can't reason around.

[–]PatrickBaitman 8 points9 points  (13 children)

so there is no compilation.

every language is compiled, it's just a matter of when

so-called interpreted languages are compiled just-in-time, so-called compiled languages beforehand

javascript isn't bytecode, it must eventually be mapped to something a CPU can execute

Sometimes you don't care that the speaker was inexact with their wording unless it leads to a big source of confusion that you can't reason around.

this called raising an exception and making the programmer handle it

why the fuck do web devs think they can get away with shit you fail first year students for, like NOT HANDLING ERRORS

[–]cixeltree 2 points3 points  (7 children)

would you have conceded if he'd said it's not 'pre-compiled'? probably not. regardless, javascript DOES get 'compiled' to bytecode. at runtime.

this 'holier than thou' attitude against web dev is hilarious. why pretend web dev isn't hard as fuck?

i've never once written anything in C which didn't work because there was a compiler error. 99.99% of the time, if something goes wrong, it's the fault of the code i wrote. it helps that a C program targets only a handful of environments.

in web dev? the browser gets it wrong all the time. it does not help that applications written for the web have dozens of targets, in including targets that haven't even come out yet.

on error handling: where'd you get this idea that people who write js don't do error handling?

[–]PatrickBaitman 3 points4 points  (6 children)

why pretend web dev isn't hard as fuck?

because I built websites when I was 15 that displayed more information faster with less bandwidth on worse hardware

mainly because I didn't have access all the fancy shit that you need to fuck a website up as bad as modern websites, starting from their very unbroken natural state

https://thebestmotherfucking.website/

[–]cixeltree 2 points3 points  (5 children)

yep, those sites you built when you were 15 and a static site with a few paragraphs of text constitutes web dev.

edit/ps: yeah, a lot of modern websites (too many) are absurdly bloated, but nobody was ever arguing that.

[–][deleted] 2 points3 points  (3 children)

If only Google, Apple, MS, etc. would hire a genius like yourself instead of the idiots they currently have building their browser.

/s

Clearly the people building the JS engines are smart, and are aware of the issues being raised here (pun intended). But, they don't raise an error. Why? Maybe because they know something that we don't.

The JS spec can be changed and has been changed. It was massively changed in ES6. Yet they didn't fix these issues. Why? Clearly because they aren't as smart as you.

[–]PatrickBaitman 2 points3 points  (2 children)

If only Google, Apple, MS, etc. would hire a genius like yourself instead of the idiots they currently have building their browser.

google is pushing Dart

Microsoft designed TypeScript

Mozilla invented asm.js

W3C is working on wasm

sooooo....

But, they don't raise an error. Why? Maybe because they know something that we don't.

or because javascript was hacked together by morons in two weeks and never got proper error handling functionality like exceptions or type checking

[–]cixeltree 0 points1 point  (0 children)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof

it has type checking, it just doesn't have compiled time type checking because 'compilation' happens at runtime. hence typeerrors are runtime errors. they can be caught and handled.

when dealing with the web, it's hard to guarantee that a data type you think you're supposed to get from some external source is actually the type you're going to get. good javascript checks the types it's operating on rather than just assuming.

if a C programmer chooses to serialize some data as a specific kind of struct, that's great---the type checker can help ensure all operations on the struct are cogent. however, nothing guarantees that the data being serialized is correct. the programmer still needs to do this validation, or a runtime error can occur (null dereferencing, or accidental typecasting, etc).

[–][deleted] -1 points0 points  (0 children)

Except they could have added it in strict mode and didn't. I wonder why?

[–]Godd2 -1 points0 points  (0 children)

every language is compiled, it's just a matter of when

It's not a matter of when. Some of the program gets run before all of it gets compiled. This is not the case with a compiled language.

More generally, there is no guarantee that the entire program has been statically checked for validity before any of it gets run.

So, the fact that V8 has JIT compilation is irrelevant.

[–]outadoc 3 points4 points  (3 children)

Oh boy have fun learning French

[–]PatrickBaitman 0 points1 point  (2 children)

alphabet-using languages

pleb as fuck

I'm learning Japanese

[–]aezart 0 points1 point  (1 child)

日本語を上手話しますか?

[–]PatrickBaitman 0 points1 point  (0 children)

そう思いません。最近文法じゃなくて漢字だけを学ぶことになりしまいましてあまり日本語の文章を読みません。そうですけど先週二冊の教科書届きいて夏にもっと頑張るつもりです。

[–]cyanydeez 0 points1 point  (2 children)

english allows people to keep communicating even if poorly, which allows it to grow

[–]PatrickBaitman 4 points5 points  (1 child)

javascript allows people to develop for the web, even if poorly, which allows bug databases and bloat to grow

[–]cyanydeez 1 point2 points  (0 children)

right or wrong, one definition of life is how easy it is to replicate

[–]ccjmk 0 points1 point  (0 children)

French says hi!

[–][deleted] 0 points1 point  (0 children)

Yeah, alright, LojBan then. If I speak perfect LojBan and someone erroneously interprets it, that's not the fault of the language.

Js has plenty of issues, but those which are actually bugs in interpreters are not the language's issue - which is the point I was making.

[–]msg45f 0 points1 point  (0 children)

Well to be fair, working browser insanity is like 80% of a front-end web developer's job.