DEV Community

Discussion on: JavaScript and manipulating the DOM

Collapse
 
nektro profile image
Meghan (she/her)

UX, submitting a raw POST request every time you clicked 💖 would be incredibly annoying and reset the scroll bar back to the top, among other things

Thread Thread
 
tux0r profile image
tux0r

It's not annoying, it's natural. There already is a better solution if you absolutely want that: write actual desktop applications...!

Thread Thread
 
nektro profile image
Meghan (she/her)

the browser is a desktop application. think of your web browser similar to a game launcher. bringing my code to you in a secure environment and with automatic updates.

Thread Thread
 
nicostar26 profile image
Nicole Saunders 💻🌹

Makes a lot of sense. That would almost be like a video game completely reloading every time the player makes a move.

Thread Thread
 
tux0r profile image
tux0r

The browser is a desktop application.

The browser is not an operating system.

But please humor me: how is a web browser, a glorified document viewer that only understands one scripting language which does not even have strong typing, a "secure environment"?

Thread Thread
 
tux0r profile image
tux0r

There are reasons why video games are usually running natively.

Thread Thread
 
nektro profile image
Meghan (she/her)

"secure environment" was referring to site isolation, requiring https for many APIs, not being able to access the user's local machine, etc.

"The browser is not an operating system" but it can be. and will be in the coming future. if not now. the web has evolved.

"glorified document viewer" the web has evolved. a lot. we've done a lot in the past 30 years. with the vast majority of that change in the past 5 or so actually.

"one scripting language" it's the language of the Web, and many many things compile to JavaScript. with more things every day (the most widely used high level programming language on the planet)

"does not even have strong typing" natively. yet. but many of the compile-to-JS languages do.

"reasons why video games are usually running natively" lack of certain networking protocols (recently added as WebSocket and WebRTC) and memory constraints (most browsers crash a page if it passes 1GB in a tab, but that could easily be changed or given as a permission to the user)

Thread Thread
 
tux0r profile image
tux0r

"secure environment" was referring to site isolation, requiring https for many APIs, not being able to access the user's local machine, etc.

Still notably less secure than your operating system's exploit mitigation techniques.

"The browser is not an operating system" but it can be.

It cannot, since it needs a kernel at the very least.

"glorified document viewer" the web has evolved. a lot.

That might sound pessimistic, but I'm willing to call it devolved instead. People abuse the web. A lot.

"one scripting language" it's the language of the Web

Just because something is the only choice, it is not a good choice.

"does not even have strong typing" natively. yet.

I see no sign of that ever changing.

but many of the compile-to-JS languages do.

Which is irrelevant as the browser will still only see the broken result.

most browsers crash a page if it passes 1GB in a tab

And you don't see a problem with "applications" requiring more than 1 GB of RAM? Because I do.

Thread Thread
 
nektro profile image
Meghan (she/her)

I think the user should have more control over what the browser allows pages to do but I do think that at the end of the day, if your computer can do it, the web should be able to do it too. and no i don't see a problem with pages using more that 1GB of RAM since many games use more than 1GB and i'd love for them to come to the web. the Web has more work to do to in regards to functionality and user control but if you think that web should only be used to pass files around then there isn't much I could say to convince you we're on a good road. however, I believe that the web is the best platform for application deployment ever made even though it wasn't originally made for that 30 years ago (and can still be used for open directories). many of the services we take for granted nowadays simply couldn't exist on the web back then because internet infrastructure did not have the bandwith to support the web as an application distribution platform. but that's changed since and the browsers are catching up.

Thread Thread
 
tux0r profile image
tux0r

if your computer can do it, the web should be able to do it too

If you buy a computer for nothing else but using the web, that might be fine. But I don't.

Thread Thread
 
nicostar26 profile image
Nicole Saunders 💻🌹

I think most people like the convenience of not having to install a desktop app for every single thing they use their computers for. The space alone on that would get kind of crazy. I use my computer for a lot and a lot of the time I have a web app open.

Thread Thread
 
tux0r profile image
tux0r • Edited

That's the good thing: Most things people need come preinstalled with their computers, even e-mail clients. What else? Office software? A one-time installation.

The space alone on that would get kind of crazy.

A funny claim, given that web-based software (running on a headless web browser), like Visual Studio Code and Slack, makes the largest downloads today. Good desktop software is notably smaller, faster and more secure than its web equivalents.

Bring one counter-example please.

Thread Thread
 
nicostar26 profile image
Nicole Saunders 💻🌹

People do a lot more on their computers than just microsoft office and default email. Sometimes it's just easier to open one desktop app (the browser) and do a lot from there. The average user doesn't really care much about technical specs, they just want convenience.

Out of curiosity, why are you anti web app?

Thread Thread
 
tux0r profile image
tux0r

The average user doesn't really care much about technical specs, they just want convenience.

Desktop applications are convenient.

why are you anti web app?

I even dislike the term "web app". The web is not an application platform, the browser is an application. You cannot run a web browser without installing a local piece of software - so why do you think every other piece of software needs to run inside it?

"Web applications" are:

  • much more insecure than desktop applications because a web browser is a huge security risk itself (check cvedetails.com) and malvertising (thus, JavaScript) is a giant danger
  • much slower than desktop applications because interpreted code running in a sandbox running in a virtual machine running on a web browser... you get the point
  • much more resource-hungry than desktop applications because interpreted code running in a sandbox running in a virtual machine running on a web browser... you get the point
  • much less flexible than desktop applications because you're bound to one dynamic language, one description language and one style language

Honestly, "web applications" are a thing for consumers. My mother would love them. Once you care what actually happens to your computer, you should be afraid of them.

Your mileage may (and obviously does) vary.

Thread Thread
 
nicostar26 profile image
Nicole Saunders 💻🌹

How do you quote in the comments? :)

Thread Thread
 
tux0r profile image
tux0r

By using Markdown. I'm pretty sure that someone wrote a web app for that if you wish ...

Thread Thread
 
nicostar26 profile image
Nicole Saunders 💻🌹

Ok I didn't invent web apps, no need to get upset with me... but thanks for the link.

Thread Thread
 
tux0r profile image
tux0r

You would notice if I was upset ... :-)

However, 1:30 AM here. Good night. ;-)

Thread Thread
 
nicostar26 profile image
Nicole Saunders 💻🌹

However, 1:30 AM here. Good night. ;-)

Good night. lol, had to.

 
nektro profile image
Meghan (she/her)

Well we could standardize a file format for making desktop applications using HTML, CSS, and JS so that you'd just run the file with the browser of your choice, but then at that point you're making an open source jar file (which could be a good idea if done right)

Thread Thread
 
nektro profile image
Meghan (she/her)

those programs are big because they're packaging the whole headless browser with them which is unnecessary.

Thread Thread
 
tux0r profile image
tux0r • Edited

And still slow and insecure, even without it...