Live data from Hacker News

ARM chips have an instruction with JavaScript in the name

stackoverflow.com

281–290 of 312 posts

Re: ARM chips have an instruction with JavaScript in the name

#281

Earlier quoted context omitted.

Its not that it isn't capable, its that it has more gocha's than most other languages of it size (and no, just because the gocha is well defined doesn't mean that it doesn't trip programmers up). Its also despite a couple decades of hard work by some very good compiler/JIT engineers at a considerable disadvantage perf wise to a lot of other languages. Third its most common runtime environment, is a poorly thought out…

Regarding gotchas, it's bearable. I only have a couple on my short list: == vs === and xs.includes(x) vs x in xs, and only the latter is not reducible to a trivial rule of thumb. TS is helpful in this regard, possibly there are more in plain JS. Regarding performance, modern JS is plenty fast, but it's not in the 'terrible' category. It's memory usage, perhaps ;) https://benchmarksgame-team.pages.debian.net/benchmark…

MFC was a mess, In the 90's. I dabbled with MFC multiple times, mostly to support other peoples applications and it was overwhelmingly bad. For C++ I mostly just used the native win16/32 APIs because it turned out to be less kludgy for small GUI's associated with various services I was writting. OTOH, I did a _LOT_ of development with vb, and later delphi for the frontend of those services. Both of which were significantly better GUI development tools than visual studio at that point.

I've since moved on to other development areas, but have done a bit of both JS (on and off from about 2005->2015), and a bit of QT here and there too. The latter seems to have gotten better in the past few releases AFAIK. C# is at least ok too.

So in the case of MFC and early QT its not surprising that you prefer react+JS as neither of those were exactly the pinnacle of UI development in the late 1990's early 2000s.

What you describe in a later posting about MFC was never really a problem with the VCL, pretty much no one dealt with repaint messages unless you were writing a custom component. I remember showing a number of MFC programmers BC++ builder (which is also still a thing) when they were singing the MFC tune. They tended to get really quite after that.

PS/edit: Crazy, I just went and looked at the latest visual studio documentation and MFC is still an option, and at first glance seems basically the same as it was 25 years ago. Although the section on creating win32 applications is in front in the manual. I guess i'm not surprised that MFC is still a thing, but I am surprised that it doesn't have a giant depreciation warning. I frankly can't imagine creating a new MFC application in 2020.

Re: ARM chips have an instruction with JavaScript in the name

#282

Earlier quoted context omitted.

> Not every day or even once in an average week, unless you're doing something wrong. Do you have to understand it or not? There is a ton of information on the web (viewed 191k times) [1], [2], etc. Acting like it is intuitive is disingenuous. No, that's you who don't understand. I've shown particular code that is error prone in JS but is ok in other languages. That is the issue. It is not solved. Every novice gets i…

> that's you who don't understand Because your comments are incomprehensible. > I've shown particular code that is error prone in JS but is ok in other languages. It's not OK in Java. It's not OK in C. It's not OK in C++. Because you can't even do that in any of those languages. > still you claim "you don't need this" Look at the languages I listed above. Think about the program you're trying to write. Do you think i…

I've mentioned prominent example, there is underlying problem

    class Foo {}
    typeof Foo 
    //"function"
    Foo instanceof Function 
    //true
Is there underscore here? How about

    typeof Object
    //"function"
    typeof Function
    //"function"
    Object instanceof Function
    Object instanceof Object
    Function instanceof Function
    Function instanceof Object
How many underscores there? And looks like you don't know about

    Object.getPrototypeOf
    Object.setPrototypeOf
    Reflect.getPrototypeOf
    Reflect.setPrototypeOf
without underscore and you blame I don't know this land.

You've got burned by Java and C++, bad for you. There are other languages — Python and Ruby (last example). JS [[Prototype]] is equivalent of class hierarchy. You shown many times that you can't comprehend, normal reaction should be investigate and understand first, not your case. It shows you in a bad light.

Re: ARM chips have an instruction with JavaScript in the name

#283

Earlier quoted context omitted.

Lol. I've been programming for a decade in many languages including assembly, C#, Rust, Lisp, Prolog, F# and more, focusing on JS in the last 5 years. Virtually no one writes plain JavaScript, most people including me write TypeScript, but Babel with extensions is normally used. Your reply exhibits your ignorance of the JS world.

> Virtually no one writes plain JavaScript Which is because plain Javascript is objectively terrible, as I pointed out.

That's like pointing out that C++ after template transformations are applied is terrible. Yeah, so what? Nobody writes it like that.

Re: ARM chips have an instruction with JavaScript in the name

#284

Earlier quoted context omitted.

> Virtually no one writes plain JavaScript Which is because plain Javascript is objectively terrible, as I pointed out.

That's like pointing out that C++ after template transformations are applied is terrible. Yeah, so what? Nobody writes it like that.

"C++ is C because nobody writes C", you can't be serious.

Re: ARM chips have an instruction with JavaScript in the name

#285

Earlier quoted context omitted.

> that's you who don't understand Because your comments are incomprehensible. > I've shown particular code that is error prone in JS but is ok in other languages. It's not OK in Java. It's not OK in C. It's not OK in C++. Because you can't even do that in any of those languages. > still you claim "you don't need this" Look at the languages I listed above. Think about the program you're trying to write. Do you think i…

I've mentioned prominent example, there is underlying problem class Foo {} typeof Foo //"function" Foo instanceof Function //true Is there underscore here? How about typeof Object //"function" typeof Function //"function" Object instanceof Function Object instanceof Object Function instanceof Function Function instanceof Object How many underscores there? And looks like you don't know about Object.getPrototypeOf Obje…

> there is underlying problem

No, you haven't ever defined _any_ problem, only abstract things that bother you.

There is only one problem that matters: writing a (correct) program. If you can do it without meta-programming, then you should.

If you start meta-programming when you don't have to, then you have already lost. If you are doing this when you shouldn't, and then you experience pain and say, "This system needs to be fixed", then make sure you fix the correct part of the system: yourself.

> JS [[Prototype]] is equivalent of class hierarchy.

Which nobody is futzing around with (because they can't, and they shouldn't futz with it anyway) on the level that you're insisting we do, in the ordinary course of writing programs. (The level where you are seeing "problems".) Once again: keep that stuff in your REPL. If you are editing a regular source file that will be committed to the repo and you are typing out "prototype" or "__proto__" or "setPrototypeOf" more than once or twice every 10k lines, then you're almost definitely doing something wrong.

> You've got burned by Java and C++, bad for you.

No, it's that the world is burning because of thousands of programmers who can't behave responsibly because they pick up a dynamic language and say, "There are no adults around to discipline me, so now is the time to go nuts."

(And the irony is that this thread exists because of your complaints about JS and how it burns you, where I started out arguing that JS is fine at the beginning. But now you're the champion for JS?)

Re: ARM chips have an instruction with JavaScript in the name

#286

Earlier quoted context omitted.

I've mentioned prominent example, there is underlying problem class Foo {} typeof Foo //"function" Foo instanceof Function //true Is there underscore here? How about typeof Object //"function" typeof Function //"function" Object instanceof Function Object instanceof Object Function instanceof Function Function instanceof Object How many underscores there? And looks like you don't know about Object.getPrototypeOf Obje…

> there is underlying problem No, you haven't ever defined _any_ problem, only abstract things that bother you. There is only one problem that matters: writing a (correct) program. If you can do it without meta-programming, then you should. If you start meta-programming when you don't have to, then you have already lost. If you are doing this when you shouldn't, and then you experience pain and say, "This system need…

You've shown your position — ignorance. You don't have to repeat yourself. You would not save that "burning world". I am sorry for all junior developers who is in contact with you and who you "discipline". I am quite grown up and estimate such worldviews as "no more than middle, or terrible mistake".

Re: ARM chips have an instruction with JavaScript in the name

#287

Earlier quoted context omitted.

That's like pointing out that C++ after template transformations are applied is terrible. Yeah, so what? Nobody writes it like that.

"C++ is C because nobody writes C", you can't be serious.

That's not what I said.

Re: ARM chips have an instruction with JavaScript in the name

#288
post #216

Earlier quoted context omitted.

And that's your opinion. I find javascript quite enjoyable and easy to use, without producing errors. YMMV.

Sure, until you parachute into a code base where several generations of contractors added features that communicate over a shared global object. This is bad per-se, but becomes worse when your language allows one to add fields on the fly and you end up with this container full of similar fields because eventually nobody knows exactly what’s in the object any more...

I've seen similar abuses with global maps in other languages (essentially the same). This is an architecture fault rather than a language fault.

As you say, that is a problem with any language and project with a revolving door of developers. Perhaps those companies should learn their lesson and hire at least one or two good, permanent senior devs to keep things on track.

Like always, the human factor outweighs almost everything else.

Re: ARM chips have an instruction with JavaScript in the name

#289

Earlier quoted context omitted.

Lol. I've been programming for a decade in many languages including assembly, C#, Rust, Lisp, Prolog, F# and more, focusing on JS in the last 5 years. Virtually no one writes plain JavaScript, most people including me write TypeScript, but Babel with extensions is normally used. Your reply exhibits your ignorance of the JS world.

I occasionally write JavaScript since 2007, experiment a lot last 5 years, red through ES5 specification several times. I've worked as C++, PHP, Python, Ruby developer. Experimented with a few languages. "JS" instead of "TypeScript" brings confusion. TS solves some issues and I've mentioned it, still typeof null //"object" Template literals interpolation helps but if string (not literal string) slips by it is a mess…

C++ has WAY more spec footguns than JS (and that's without counting all the C undefined behaviors which alone outweight all the warts of JS combined). PHP also beats out JS for warts (and outright bad implementation like left-to-right association of ternaries). Ruby has more than it's fair share of weirdness too (try explaining eigenclass interactions to a new ruby dev). Even python has weirdness like loops having an `else` clause that is actually closer to a `finally` clause.

`typeof null === "object"` is a mistake (like with most of the big ones, blame MS for refusing to ratify any spec that actually fixed them).

If you're having issues accidentally replacing `+` with `-` then you have bigger issues (eg, not unit testing). I'd also note that almost all the other languages you list allow you to overload operators which means they could also silently fail as well. In any case, garbage in, garbage out.

Foo being an instance of function is MUCH more honest than it being an instance of a class because the constructor in all languages is actually a function. This is even more true because you are looking at the primitive rather than the function object which contains the primitive.

Re: ARM chips have an instruction with JavaScript in the name

#290

Earlier quoted context omitted.

And that's your opinion. I find javascript quite enjoyable and easy to use, without producing errors. YMMV.

JavaScript has good parts, I write it a lot. But it is ignorant to close eyes on its warts 1 + '2' 1 - '2' Number.MAX_SAFE_INTEGER + 2 and entire WAT series, stems from "don't raise" ethos. JavaScript exposes constructor instead of prototype that messed up a lot, in Ruby terms Object.alias_method :__proto__, :class Object = Object.instance_method(:initialize) Class = Class.instance_method(:initialize) Class.__proto__…

Operator overloading can lead to ambiguities in dynamic languages. Ruby, python, and any number of other languages have it much worse because they can be overloaded any way you want while JS overloads are (currently at least) set in stone by the language.

If you could only choose one number type, would it be floats or ints? Crockford would say decimal, but the rest of use using commodity hardware would choose floats every time. It's not the language implement's fault someone doesn't understand IEEE 854. This max safe integer issue exists in ALL languages that use IEEE 854. In any case, BigInt is already in browsers and will be added to the spec shortly.

Post reply on HN