4 ms·
A weak point, though, is JavaScript — quite possibly the worst popular computer language in history. I honestly think I'd rather starve than write another line
by wtbob 10y ago
A weak point, though, is JavaScript — quite possibly the worst popular computer language in history. I honestly think I'd rather starve than write another line of JavaScript again. Even reading JavaScript diffs from other guys on my team is a horrible, terrible experience. It's just a sad, awful, miserable, verbose, broken language.
As a compilation target from a better language, I suppose it's mostly acceptable. But on its own? Never again.
- problems 10y agoThe problem with it as a compilation target in my experience is that interacting with other libraries becomes challenging - the JS ecosystem is now huge, but if you want to use many of those libraries from a wrapping language, it's possible but might present many challenges. 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.
- WorldMaker 10y agoI think writing Typescript definitions for a massive library is usually pretty straight forward and I've got a few that I haven't minded writing/helping maintain. "Good enough" typings can be very quick and easy to build and "Perfect" typings take time sometimes but nowhere near "impossible". 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.
- tazjin 10y agoIt's not just that the language is bad, it's also that the ecosystem encourages bloat and terrible implementations with layers of fixes glued on top of each other. 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.
- matmo 10y ago>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. 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.
- tazjin 10y ago> Is this hyperbole? 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.
- matmo 10y agoOk yeah, I suppose I haven't really pushed Slack to that limit either. Only using a team or two myself.
- dfox 10y agoI would say that problem is not in the language but only in the surrounding ecosystem.
- bartread 10y ago"Worst popular computer language in history." That's a bit strong, isn't it? It certainly has its faults, but so did VB6 (and other BASIC variants, for that matter). PHP gets widely slagged off as well. Does it deserve it? Possibly, to some extent, but people still manage to successfully build useful software with it. 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.
- willtim 10y agoI disagree. Languages like Haskell are much less tolerant of terrible code, which is a large part of the reason why beginners struggle with it. 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.
- VLM 10y agoThere's a continuum of restriction of style. The Python guys say the same thing about Perl. "We can handle our diversity, but the Perl guys are completely out of control so I don't know how anyone can handle that." 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.
- 10y ago
- bigtunacan 10y agoEvery programming language has it's warts. JavaScript is in a unique position in terms of the level of backwards compatibility it is required to maintain. It integrates some powerful features with it's lisp-y functional style and closures. It's implementation of prototypal inheritence isn't the greatest I've seen, but it's by far the most successful prototype based language and that is something I personally wouldn't mind seeing become more mainstream. 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.
- deleted 10y ago[deleted]