News for hackers. Stuff that matters.
Re:22 Years of Delphi and It Still Rocks by wtbob on Wednesday February 15, 2017 @09:14AM (#13652095)
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.

Re:22 Years of Delphi and It Still Rocks by tazjin on Wednesday February 15, 2017 @09:48AM (#13652335)
It'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.

Re:22 Years of Delphi and It Still Rocks by matmo on Wednesday February 15, 2017 @03:52PM (#13655250)
>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.

Re:22 Years of Delphi and It Still Rocks by tazjin on Wednesday February 15, 2017 @05:13PM (#13655854)
> 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.

Re:22 Years of Delphi and It Still Rocks by matmo on Wednesday February 15, 2017 @07:47PM (#13656996)
Ok yeah, I suppose I haven't really pushed Slack to that limit either. Only using a team or two myself.
Re:22 Years of Delphi and It Still Rocks by dfox on Wednesday February 15, 2017 @04:46PM (#13655643)
I would say that problem is not in the language but only in the surrounding ecosystem.
Re:22 Years of Delphi and It Still Rocks by bartread on Wednesday February 15, 2017 @09:53AM (#13652373)
"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.

Re:22 Years of Delphi and It Still Rocks by willtim on Wednesday February 15, 2017 @10:32AM (#13652661)
I 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.

Re:22 Years of Delphi and It Still Rocks by bartread on Wednesday February 15, 2017 @11:22AM (#13653104)
Part of this is that with Haskell it's much more like there's one right way to do things, and that's it. JavaScript is a multi-paradigm language and so in that way it's always possible to get into more of a mess. I could say the same about, for example, C++.

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.

Re:22 Years of Delphi and It Still Rocks by pimeys on Wednesday February 15, 2017 @12:07PM (#13653471)
Funny, because I would hire a person straight from university as a junior developer, if she chose to write all the assignments with Haskell instead of going with C/C++/Java/whateverpopularlanguage. That would be a really good sign.
Re:22 Years of Delphi and It Still Rocks by bartread on Wednesday February 15, 2017 @02:47PM (#13654820)
I think times have changed though. Functional languages just weren't big back then the way they are now. Back in those days Haskell was sloooooooow. There's 17 years of runtime and compiler optimisation, not to mention MUCH faster hardware, that's been developed in between. It's now totally realistic to use the expressive power of functional languages on real-world workloads in a way that it mostly wasn't back in Y2K.
Re:22 Years of Delphi and It Still Rocks by VLM on Wednesday February 15, 2017 @10:50AM (#13652807)
There'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.

Re:22 Years of Delphi and It Still Rocks by willtim on Wednesday February 15, 2017 @11:23AM (#13653112)
I'm not sure I like your clothing analogy, it implies that Haskell deliverables are somehow restricted in functionality, which isn't true. The "style" that Haskell prohibits is hiding side-effects and mutable state behind something that pretends to be a function. If you are honest and upfront about what you are doing, i.e. you fully understand what you are doing, then Haskell has no problem letting you do it.
Re:22 Years of Delphi and It Still Rocks by VLM on Wednesday February 15, 2017 @04:02PM (#13655319)
I actually agree with you and any disagreement we have is solely my fault, as that's mostly what I was trying to write.
Re:22 Years of Delphi and It Still Rocks by bigtunacan on Wednesday February 15, 2017 @09:55AM (#13652380)
Every 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.

Re:22 Years of Delphi and It Still Rocks by problems on Wednesday February 15, 2017 @09:45AM (#13652311)
The 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.

Re:22 Years of Delphi and It Still Rocks by WorldMaker on Thursday February 16, 2017 @11:33AM (#13661213)
I 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.