Live data from Hacker News

JavaScript Conquered the Web, Now It’s Taking Over the Desktop

wired.com

261–270 of 270 posts

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#261
post #215

Earlier quoted context omitted.

FWIW, I almost always use ==. Very rarely, if ever, had any problems- probably I'm used to javascript enough to think in advance of the edge cases and use === when I feel it's necessary.

> I'm used to javascript enough to think in advance I don't consider it a foresight issue. I'm a believer in putting the burden on the caller not the callee. If I expect 0 and you have "0", it's your job to call parseInt(), not my job to branch out some if statements for type checking and coercion. For a few reasons: 1) debugging someone else's code is a lot more time consuming than debugging your own 2) actually fix…

It's my opinion that if I can execute without error, I should execute without error... if that means I `~~input` to make certain I'm working with a whole number, I'll do it. If someone calls me with invalid input, and it's coerced and you get invalid output, so be it.. it didn't crash/error.

That said, the biggest problem I've seen in a lot of projects, bigger than coercion and in languages including, but not limited to JS is not properly handling error cases.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#262
post #88

Earlier quoted context omitted.

See the spotify client, popcorn time, visual studio code. these are javascript. They run great.

Have you checked how much memory they use? I know we have 8-core laptops with 16 gigs of RAM, but, still, it's excessive.

Don't have an 8 core, or 16 gigs of ram. I'm talking about my desktop. I have a 4 core i5 from 2013. Spotify has 173M in res. Visual studio code with 10 files open has 99M in res. I have firefox open with about 125 tabs open, 6 terminal windows, 2 pdf files open, VLC open but not playing, IRC in about 15 channels. Load average is 0.60. Memory load across all CPU's about 10%. 8gigs used out of 12gigs of ram. With firefox using 5.1 gigs.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#263
post #198

Earlier quoted context omitted.

DSLs are actually common in javascript. JQuery, one of the most popular libraries in all of javascript is mostly a DSL for DOM manipulation. Lodash/underscore is mostly a DSL for list manipulation. Admittedly, JS doesn't have operator overloading, but I personally think that's a good thing.

We apparently have a very different definition of DSLs. Both jQuery and Lodash are, to me, libraries with lots of functions. A DSL, to me, would be a change in the underlying language being interpreted. i.e. describe file("foo") do it { should exist } it { should be_owned_by "root" } end vs. _.map(["a"], function(s) {alert(s)})

Except your rspec example isn't a change to the underlying language is it? Also, Check out mocha for the JavaScript equivalent.

Also, when you use only one function of lodash, you can't call it a language, but there are chains and flows for creating powerful pipelines for collection processing.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#264
post #131

Earlier quoted context omitted.

"But Electron is also awful, since a hello world app uses 100mb of RAM." Is it that awful, though? Most computers come with 4-16GB of RAM.

Yes - some of us want to use our multitasking systems for multitasking.

How many tabs do we have opened in our browsers? I rarely have less than a dozen. I think it's fair to say that "browser as a runtime" isn't incompatible with multitasking.

You can say that it would be better to share a common Electron instance, but it's not an argument against the idea of using web technologies for desktop programming.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#265
post #165

Earlier quoted context omitted.

I can't believe this is the top comment. Let's go point by point: 1) JavaScript has its warts and its gotchas like anything else (okay, maybe a few more). So what? Spend 50 hours building anything substantial with JavaScript and you'll get a good handle on them, and you'll be good to go for the next 10,000 hours. Same goes for just about any other language. Focusing on the weird edge cases might make for a nice blog…

You are forgetting that even Eich didn't want to do JS; he wanted to embed Scheme but was overruled by suits at Netscape who wanted to ride the Java hype. That's why the semicolons and curly braces. It really is indefensible on technical grounds.

What state was guile in at the time? Could we have ended up with that instead of javascript?

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#266
post #131
post #64

Earlier quoted context omitted.

> "Full-native development unique on each platform is considered too much effort, when you can get a cross-platform app with Electron" Yes, it's this. Full native development is awful since every platform is completely different, and other cross-platform solutions like Qt are a bit behind the web in terms of modern look and feel and developer base. But Electron is also awful, since a hello world app uses 100mb of RAM…

"But Electron is also awful, since a hello world app uses 100mb of RAM." Is it that awful, though? Most computers come with 4-16GB of RAM.

Yes, if hello worlds uses that much then how much do complicated apps use?

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#267
post #127
post #40

The salient points of the article: - People are stuffing websites into Electron and packaging it as a native application - HTML/CSS/JS is considered 'hackable' because it's widely understood by today's semi-power-user audience Although the article doesn't say it, this seems to imply that: - Full-native development unique on each platform is considered too much effort, when you can get a cross-platform app with Electr…

Part of it is also, custom looking UI, not confined to the platform widgets, is not easy to do on many of the desktop platform libraries. It is incredibly easy to do with HTML/CSS.

10 years ago everyone hated on java because it didn't look native. Now no one wants anything to look native.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#268

Earlier quoted context omitted.

> I'm used to javascript enough to think in advance I don't consider it a foresight issue. I'm a believer in putting the burden on the caller not the callee. If I expect 0 and you have "0", it's your job to call parseInt(), not my job to branch out some if statements for type checking and coercion. For a few reasons: 1) debugging someone else's code is a lot more time consuming than debugging your own 2) actually fix…

It's my opinion that if I can execute without error, I should execute without error... if that means I `~~input` to make certain I'm working with a whole number, I'll do it. If someone calls me with invalid input, and it's coerced and you get invalid output, so be it.. it didn't crash/error. That said, the biggest problem I've seen in a lot of projects, bigger than coercion and in languages including, but not limited…

> so be it.. it didn't crash/error.

That's a HUGE problem. This is an absolutely fucking nightmare. It's arguably the hardest thing to possibly debug, because you're not informed it's a bug. No amount of error handling will solve that, which you've pointed out as "the biggest problem".

> If someone calls me with invalid input, and it's coerced and you get invalid output

But this isn't the problem. The problem is when it gets called with invalid input and somehow gets coerced into a valid but unexpected output. Expected input -> Expected output means you get instant gratification as to whether or not it works. This dramatically reduces the number of error cases which naturally and effortlessly moves toward solving your complaint.

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#269
post #157

Earlier quoted context omitted.

Yeah I find the "hackability" question really interesting. It is incredibly neat that I can hit a few keys in a browser and get an editable live source of what I'm looking at which is, to some extent, declarative and easily mappable from source to output. Yes, this is less true as more sites rely heavily on minified javascript for all of their implementation, or incomprehensible (to me) css that hides or moves things…

ALT -> View -> Developer -> Toggle Developer Tools

Just saw this. That's really cool, I had no idea that was there!

Re: JavaScript Conquered the Web, Now It’s Taking Over the Desktop

#270
post #95

Earlier quoted context omitted.

> Let's just call this experiment a failure The problem with "just calling this experiment a failure"—why that won't work in practice—is that JavaScript is not a failure. It's extremely successful.

And it is extremely successful because it's not a bad language. Sure, there's lots of "wat", but a non-professional programmer is going to say "wat" about every strange error they get from another programming language that js would have just passed silently with a weird result. Then they will replace whatever construct isn't working with one that does, and get on with their life, unlike people who seem to have a lot…

Are there bad languages? Can you give an example of a such language? I'm also wondering why JS changed so much lately if it was a great language already.
Post reply on HN