As a compilation target from a better language, I suppose it's mostly acceptable. But on its own? Never again.
As a compilation target from a better language, I suppose it's mostly acceptable. But on its own? Never again.
My current main work laptop (a pre-TouchBar generation MBP) can only barely run a "heavy" JS-application like Slack and something like IntelliJ at the same time.
Migrating Slack into an IRC client reduces the CPU & memory footprint of _sending, receiving and displaying text_ by over 90%.
Something went seriously wrong somewhere and we're only going deeper into the hole.
Is this hyperbole? I run both of these with IntelliJ memory settings maxed out on a MPB no problem. Granted, I have 16GB of memory, so understandably YMMV.
No. Just checked and this is an 8GB machine, running Slack with ~9 simultaneous networks (unfortunately lots of open source projects are moving to half-deserted Slack networks instead of IRC channels) can easily use more than half of that.
With JavaScript, the problem isn't so much the language (though there are many ways to use and misuse it) as its ubiquity and ease of entry. Because it's so popular it attracts many novice programmers who write terrible code (but that's how we all start). If we're going to have any good, experienced engineers in future then we need those novices now.
If C++, Haskell, Ruby, or Scala were as popular as JavaScript - particularly if one of them were the standard for client-side web programming - there'd be just as much terrible code written in those languages; it would just be differently terrible.
I work with other peoples Haskell code daily; and some of this code has been written by domain experts. Nevertheless, Haskell mostly forces them into line. Our competitors use Python because it is superficially "easy", I can only imagine what horrors they must be dealing with.
Imagine being a clothing designer and told to make something. The output could be anything from Beyonce's grammy dress to a famous deceased CEO who wore black turtlenecks all the time. That extreme diversity of style is both the greatest strength and the greatest weakness of allowing a wide allowable spectrum of style. On the other hand a men's business suit tailor is much more restricted in that everything kinda looks the same which makes things both very easy to muddle thru and very difficult to stand out at the same time.
Maybe beginners do struggle with Haskell but, if you want my two cents, the reason nobody really bothered with it back when I was at university - except for assignments where we had to use it - was because there was no call for it out in the world (this is going back 17 years). Most people built their projects in C, C++, or Java because those were what you needed to get a job. I'd also observe that the same people that struggled with Haskell also struggled with C, C++, and Java [1].
Again, based on the assignments where people did write Haskell I'd have to suggest that it absolutely is (or was) possible to write terrible code in Haskell. Certainly it's possible to write broken, fragile, or barely functional code that's hard to understand.
[1] This is of course anecdotal evidence based on a small sample size - maybe 40 people on the course.
Despite thinking JavaScript itself has some really great qualities; I generally don't think Electron is a great solution for desktop applications. Executables are too large and slow compared to a good old fashioned native application.
Like Typescript definition files. Producing them on a massive libraries is near impossible for a single individual to undertake. I've seen some people try to process them from docstrings, but the result was really kludgey.
Furthermore, Typescript recently made it much easier to work with libraries that have no typings at all. If you don't mind implicit anys, things might just work. If you are strict about no implicit anys then the minimum boiler plate to define a module with any type has dropped to a bare minimum:
declare module 'module-name'
If I have a complaint in that space, it's that sharing typings is a lot more complex than I think it should be. DefinitelyTyped is a single megarepo where most typings originate and has developed a culture of trying to get typings perfect. Unfortunately, perfect is the enemy of the good, and "good enough" typings for lesser used libraries often languish in PR obscurity, at least in my experience.Beyond DefinitelyTyped, libraries can embed their own typings in their npm packages, which is great, but not every library author is thrilled to "own" Typescript typings. (All in all, I still feel like I have better luck contributing typings directly to library authors than DT, though.) Beyond that there are tools like Typings to grab typing files from arbitrary GitHub repos, for instance, but there's not much of a good way to advertise types that way because most people will only check NPM now.
Sorry, this seems to have turned into more of an off topic rant than I at first intended.