It was there.
JavaScript is Good, Actually
251–260 of 369 posts
Re: JavaScript is Good, Actually
#252I have been working with elm for 2 years now and shipped 4 projects. I can say a lot of good thing about elm, but the most important one, and something that outweight a lot of thing is maintainability. Each time I had to change something in a shipped app it was painless, stressless (I know I won't add regression) and fast. I won't say JS is bad, but the absence of a compiler makes it much more fragile, especially whe…
Almost everyone writing JavaScript these days uses a compiler like Babel, webpack, browserfy etc..
JavaScript does has two good typecheckers, TypeScript and Flow.
Re: JavaScript is Good, Actually
#253Re: JavaScript is Good, Actually
#254Semantics and configurability is what what makes a language great. JS doesn’t have function environments, i.e. every unlexical lookup goes to global/window and that cannot be redirected. It doesn’t have green threads (at least). There are generators, but one cannot just yield without marking all the functions generators too (async/await in modern terms). Stack traces are lost when generators throw(). JS has no good i…
> Stack traces are lost when generators throw(). V8 (and probably others) now has some special cases for async functions (and generators, I think, but those are much more rare) to show useful stack traces with the lineage of async calls. For example, this code shows the stack trace you'd expect when run in latest Chrome or Node.js. async function c() { throw new Error('Some error'); } async function b() { await c();…
Re: JavaScript is Good, Actually
#255Oh man, I hate these articles as they bring out the trolls. Javascript is a great language because it allows you to develop incredibly fast (scripting language) for a platform that runs everywhere (the web). It used to be far simpler, but IMHO, insecurity because of all of the FUD that this sort of article prescribes, has meant that the language has bloated to incorporate all sorts of syntax improvements and new patt…
>It's not a systems programming language, so all the comparisons against typed, compiled languages are moot. No they are not 'moot'. At least not if you're building applications with 100k+ LOC. For dinky websites and small projects I'm with you. >Introducing transpiling as a mandatory pattern for JS development was a mistake. Again, what are you building? A dinky website, or a large application that you'll have to ma…
You will have to refactor everything and entirely change your toolchain every two years. If you had the misfortune of using some framework, it will no longer be supported by then.
No JS application has that kind of longevity, because the entire ecosystem is extremely volatile.
Re: JavaScript is Good, Actually
#256Code spends most of its time being in production and not in development. During that time in production, developers will leave the team, bugs will show up, major enhancements will be made. So it is important that the codebase is easy to reason about, easy to refactor and easy to debug. If you take a language like Java and an IDE like Eclipse or Intellij IDEA, it is trivial to find from where a particular piece of cod…
That being said, TypeScript is not sound and obviously in a real TypeScript program you'll eventually touch things that are untyped. But still, getting a different set of trade-offs than "statically typed" and "dynamically typed" is useful. It makes me wish there was something like this for Python (no, MyPy and Pyre are not this. They only provide nominal typing, which is definitely not good enough for everyday Python like Django.)
Re: JavaScript is Good, Actually
#257Earlier quoted context omitted.
> It is also really slow 1) In scientific/ML CPython libraries, most critical parts are compiled anyway, and the core language is fast and expressive enough to provide a nice and fast interface to it; so your statement makes little sense without more context 2) Python != CPython
While I use Python for ML myself, I find it weird to say that a language isn't slow because you don't really use it anyway. It's true that Scripts in Python can be fast if 99% of the executed logic is in C anyway but that doesn't mean the language isn't slow. As soon as your Python script needs to do anything not available in a library you'll notice how slow it really is. Python is really neat to quickly experiment p…
Re: JavaScript is Good, Actually
#258Earlier 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…
As a concrete example, here's a library I made that relies on symbols and dynamic inheritance to extend the built-in data types: https://github.com/slikts/symbol-land
Re: JavaScript is Good, Actually
#259Earlier quoted context omitted.
I don't know, getting people to run my Python code currently consists of "make sure you have Python 3, run `pipenv install`, run the code".
And if every Python developer, researcher using Python, etc, did that, it would be much less of a problem. The reality is, many, many don't. It's kind of ironic, really. With the Zen of Python stating "There should be one-- and preferably only one --obvious way to do it" why is it that it's so common for people to not do the thing that makes it reasonably portable? I mean, I currently am working with some code that,…
Re: JavaScript is Good, Actually
#260Code spends most of its time being in production and not in development. During that time in production, developers will leave the team, bugs will show up, major enhancements will be made. So it is important that the codebase is easy to reason about, easy to refactor and easy to debug. If you take a language like Java and an IDE like Eclipse or Intellij IDEA, it is trivial to find from where a particular piece of cod…