JavaScript is Good, Actually
101–110 of 369 posts
Re: JavaScript is Good, Actually
#102Earlier quoted context omitted.
> A programming language where almost everything is mutable is not good. That's a weird criticism. Object-oriented programmers are premised on mutation. As for JavaScript itself, mutations can be avoided. 'const' to prevent reassignment, using Object.freeze, or just applying functional programming principles and keeping functions pure.
> Object-oriented programmers are premised on mutation I'm a Java OOP developer, and I make everything I can immutable. It's a design decision adopted by most of my colleagues.
Re: JavaScript is Good, Actually
#103Earlier quoted context omitted.
Are you aware of ES6 Proxy? I may be mistaken, but almost every example of an issue that you have with the language seems to be resolvable using Proxy objects. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Yes, and “handler.enumerate” deprecation is stated in this mdn link. I thoroughly checked every described [un]feature in my recent research. There is some space for error ofc, but I’m aware of most obvious things. Again, simple get/set of existing or known keys is easy, but try to proxy an arbitrary object, array or class instance and see how it falls apart. This is almost a rule in JS: every feature is somewhat ment…
Here the code of the model implementation: https://github.com/zandaqo/compago/blob/master/src/model.js
Re: JavaScript is Good, Actually
#104Earlier quoted context omitted.
> You can also write Swift code and use another transpiler to get JavaScript code from it and you would say that JS is great. I haven't read the article yet, but what you're saying is something completely different, in my opinion. If you write Swift you're writing a completely different language, with all the hassles usually introduced when transpiling. TypeScript, however, is just Javascript with some of the assumpt…
In the end, you have to transpile your code to JavaScript. Whether you are writing TypeScript or Swift code. But I agree, Typescript has more similarities with JS than Swift does.
Reducing all that to "but it has to be transpiled to Javascript" is a simplification that doesn't help in highlighting potential concerns associated with transpilation, in my opinion.
Re: JavaScript is Good, Actually
#105As a long time JS dev I don't claim expertise in other languages, but every time I go back to check out new features in C++ or Java they feel more and more like JavaScript with types than "C with classes".
Actually C++ these days is moving more towards strong typing and immutability - imho the exact opposite of JavaScript...
Re: JavaScript is Good, Actually
#106Switching back to Java after having spent a long time in JavaScript land with modern standards made me realize how great JavaScript had become. The biggest reason for JavaScripts greatness to me is JSON. I couldn't understand how Java developers put up with such bulky ways to deal with data. After some time in Java land I've come back to appreciating its strengths again though. Code completion is nice. I'm kind of ho…
Re: JavaScript is Good, Actually
#107Earlier quoted context omitted.
There are a lot of valid criticisms against JavaScript. This is a fact. It's not a great language (clearly demonstrated by the discussion about it being good or not) but it's not terrible. I doubt anyone calls JS terrible on its own merits. There is a lot of hate against the runtime (edit: I mean the browser, not JS VMs or interpreters). The runtime enforces JS and the runtime itself is enforced everywhere. There is…
> It's not a great language (clearly demonstrated by the discussion about it being good or not) but it's not terrible I'm wondering what would be an example of a great language? Because we know that there are only two kinds of languages: the ones people complain about and the ones nobody uses
Re: JavaScript is Good, Actually
#108Earlier quoted context omitted.
> A programming language where almost everything is mutable is not good. That's a weird criticism. Object-oriented programmers are premised on mutation. As for JavaScript itself, mutations can be avoided. 'const' to prevent reassignment, using Object.freeze, or just applying functional programming principles and keeping functions pure.
1) Many languages won't allow you to redefine a type. 2) Mutate the prototype of a "frozen" object and you would indirectly affect it through its prototype chain... or mutate an nested property inside a "frozen" object. Most of JS standard library and most popular frameworks and libraries have fully mutable definitions. That sucks and is BAD design decision.
This counterargument is not a good one. Just because other languages do things a certain way doesn't mean it's the right way in every situation. C++ has multiple inheritances and template metaprogramming, but that's C++.
> Most of JS standard library and most popular frameworks and libraries have fully mutable definitions. That sucks and is BAD design decision.
It's subjective whether this is a bad design decision. For the standard library, this enables polyfills. As for the popular libraries / frameworks, they have the option of freezing the prototype. They don't do this because they make the fair assumption that the client is not mutating the library state. It's the programmer's fault for breaking the interface contract and mutating the implementation. At any rate, this would be a criticism of the ecosystem, rather than language. If the criticism is about untrusted third party code, it's not an apples-to-apples comparison between JavaScript and other languages that are operating in different environments.
Re: JavaScript is Good, Actually
#109Earlier quoted context omitted.
Does "world-class software developer" even mean anything other than a big ego?
It could mean that they see themselves as competing in a global marketplace. That they don't rely on geography and are quite happy to be ranked against the best of them. Not necessarily ranked highly but content to compete based on productivity and quality of work alone. Probably not what they meant though :)
Re: JavaScript is Good, Actually
#110Earlier quoted context omitted.
What are great languages in your opinion?
If we’re talking about “dynamic CRUD over socket abstracted to death”-style tasks, and not considering minor preferences like syntax, then python, lua, most of lisp/schemes, perl. All of these allow enough meta-anything to do: ./file.src: func api_foo() for x in objs x.a = fetch(x.b) ui.btnok.enabled = yes commit() And have foo exported as api, and when called, all clients/servers, databases synced, validations passe…
I also find that python has reserved a whole bunch of keywords that I can't use as function names, making APIs hard to create with appropriate names. You also have to pollute your code with self everywhere.
It is also really slow, has no where near the number of libraries on github as javascript, is not a client-side language, doesn't have anything like babel, which can allow you to do a lot more than reflection/introspection (but not the same things exactly), etc.