Live data from Hacker News

Why I chose Electron.js for my side business

getloaf.io

121–127 of 127 posts

Re: Why I chose Electron.js for my side business

#121
post #115
post #112

Earlier quoted context omitted.

Ripcord itself demonstrates why Slack is written in Electron. Is there a mobile app? Nope! Dead on arrival. In 2020, Slack or Teams or anything similar is literally useless without a mobile app. Feature matrix says animated emojis will arrive "never." lol! I remember the days of native chat clients like Skype and AIM. I remember how Linux and Mac platforms were basically half-clients compared to Windows. It sucked. E…

> Electron applications like Slack and Spotify work everywhere, exactly the same. Yes, because they're just web pages. Then why not just use the browser to display them?

Nobody’s stopping you from using the web version of Slack or Spotify.

That said I can think of some pretty good reasons.

- Users don’t understand it as well or are less comfortable with it.

- Users’ general preference for logical separation

- Mobile safari doesn’t support browser notifications.

- You won’t get browser notifications if you close the tab by accident

- You lose OS integration, like replying via OS notifications in Slack or using OS Music controls with Spotify

On top of all that a browser tab uses plenty of RAM as well so I don’t really see the upside of using the browser for these apps, either.

Re: Why I chose Electron.js for my side business

#122
post #52

Earlier quoted context omitted.

I used to disagree with this view, since I was "raised" in school to think that raw performance is the only worthy attribute of a computer program, regardless of purpose. Then, when I started working on real products instead of homework I learned how wrong that way of thinking was. Of course it does not apply to everything, some apps do need every last clock cycle of speed, but so far none of mine had.

How about Electron-based chat apps like Slack and Teams? We know it's possible to implement this kind of functionality in For comparison, the Playstation 3 has 256MB of system RAM, and manages to run GTA V. [0] See the Ripcord application, discussed https://news.ycombinator.com/item?id=23163960

You'll be lucky if you get Teams to work in a 300mb. I regularly see it hitting 1GB. The fact is though that even if it was implemented as a native up it relies so much on web views for its addons which would probably not give much benefit cause it would need to run tens of webviews as a native up to have the same functionality.

Re: Why I chose Electron.js for my side business

#123

Earlier quoted context omitted.

Perhaps you should try a hello world GTK JS app instead of speculating about how it surely will confirm your biases. It would've taken you less time type "hello world gtk javascript" into a search engine and copy and paste the snippet into a file than writing out that bad faith argument. > Keep in mind that with Electron/nw.js I download the toolkit binary and then simply declare an arbitrary webpage or js file fille…

> there it is, in a dozen SLOC https://developer.gnome.org/gnome-devel-demos/stable/hello-w... The actual file is 42 lines there, which includes a shebang and a bunch of calls to GTK stuff. And that is my point-- it's 42 lines too long to matter whether or not we travel back in time to beat back the "JS-hating GTK developers." Because as it turns out, most devs are not looking for a way to use GTK from their favorite…

It's clear what your point is. There was no need to explain. You want to put your thumb on the scale and confirm your biases.

> The actual file is 42 lines there

Okay? If you encounter an argument "There exists an X", proving it wrong is not as trivial as pointing out "I can show there (also) exists a Y".

I wrote what I wrote for a reason. Write such a hello world program in a mainstream idiomatic style that most closely resembles the way a JS programmer would write, and a GTK hello world app is (shocker!)... 12 SLOC, as mentioned:

  $ ls -l ./scratch/hello.js # written yesterday
  -rwxrwxr-x 1 asmithee asmithee 402 Nov 20 13:54 ./scratch/hello.js

  $ cloc ./scratch/hello.js | \
  >   grep -ie javascript | \
  >   sed "s/ \( \+[0-9]\+\)\{3,3\}/ /g"
  Javascript              12

  $ cat ./scratch/hello.js
  const Gtk = imports.gi.Gtk;

  let mainWindow = null;
  let app = new Gtk.Application();

  app.connect("startup", function buildUI() {
    const text = "Hello, World";
    mainWindow = new Gtk.ApplicationWindow({
      application: app, title: text
    });
    mainWindow.add(new Gtk.Label({ label: text }));
  });

  app.connect("activate", () => { mainWindow.show_all() });
  app.run(ARGV);
> includes a shebang

Your thumb is on the scale. No shebang is necessary, and as you pointed out yourself, the equivalent in the Electron world is to 'simply declare an arbitrary webpage or js file filled with arbitrary modern HTML5 to be my "main" page/script'. And speaking of package.json...

> a bunch of calls to GTK stuff

Your thumb is on the scale. Electron developers learn how to deal with "Electron stuff". And, hello? JSX? React? These are things that are used extensively in this space and come with their own complexities and have to be learned. (And neither are even inherently Web things. They're inventions of "framework" people and live entirely in that layer.)

> And that is my point-- it's 42 lines too long

Your thumb is on the scale. There is no equivalent Electron app that is 0 lines long. And let's talk about the untold number of projects whose package.json require many more lines, even for small, trivial, or incomplete programs. That's package.json alone, i.e., before we even get to writing code that actually does anything. Besides that, the community around NodeJS is renowned for bloat and esoteric tooling. As a concrete exercise, take a look at any random repo on GitHub, and you're likely to find the root of the source tree filled a dozen or more auxiliary files. Simplicity is a strength, but it's not one valued very highly by the people who've ended up writing Electron apps and participating in the larger NodeJS community.

In any case, regardless of this stupid (stupid!) attempt at a takedown, you can't ignore that (a) you're responding, as mentioned before, to an argument you're imagining rather than the one anyone is actually making, (b) even if your response were on-target, the argument in it is anachronistic. To be able to "continue" the tendencies they've settled into now in 2020 is an impossible constraint when the entire context of this subthread is how Gnome folks' actions in 2011 could have led to a drastically outcome for how mainstream, cross-platform apps written in JS are developed. To insist that Electron is the best fit for a bunch of developers who are used to and comfortable with writing Electron apps is not insightful, it's just begging the question.

Re: Why I chose Electron.js for my side business

#124
post #107

Earlier quoted context omitted.

The PS5 has 16GB of RAM. So does the Mac I'm using. Slack is taking less than 1% of my Ram. PS3 was released 13 YEARS ago. At the time AIM was the dominant chat client, and it probably took more like 5% of RAM available.

Plenty of people only have 2-4GB of RAM, and Slack eating up 360MB along with a couple other bloated apps and some God-foresaken autoplaying video ad can easily start requiring swapping and slow a computer to a crawl. Sure, people could spend more money to mostly sidestep the issue (supposing they didn't have any workloads which actually benefited from all available RAM), but that doesn't make it a non-issue.

I'm guessing you're not going to run Slack unless you're at a company. And I'm guessing if you have 2-4GB of RAM you are not running a company issued computer. And if for some odd-ass reason you are running on a personal computer with 2-4 GB of RAM and NEED slack, why not just run it in a chrome tab?

Re: Why I chose Electron.js for my side business

#125
post #107

Earlier quoted context omitted.

Plenty of people only have 2-4GB of RAM, and Slack eating up 360MB along with a couple other bloated apps and some God-foresaken autoplaying video ad can easily start requiring swapping and slow a computer to a crawl. Sure, people could spend more money to mostly sidestep the issue (supposing they didn't have any workloads which actually benefited from all available RAM), but that doesn't make it a non-issue.

I'm guessing you're not going to run Slack unless you're at a company. And I'm guessing if you have 2-4GB of RAM you are not running a company issued computer. And if for some odd-ass reason you are running on a personal computer with 2-4 GB of RAM and NEED slack, why not just run it in a chrome tab?

It will use about the same amount of memory when run in a Chrome tab, as that doesn't much differ from the application version (essentially just a bundled Chromium browser). It would save you from running two different Chromium browsers at once, but I don't think the saving is all that significant. (See https://news.ycombinator.com/item?id=25167153 )

Re: Why I chose Electron.js for my side business

#126
post #113

Earlier quoted context omitted.

Yea, completely agree. I think context is very important here. We should not be making the same arguments for a one-person side business and a company with 400MM in revenue. Slack really can't stand on the arguments presented in the article.

Slack didn't exactly start with 400MM of revenue.

Of course not. But do we expect companies to stick to the decisions they made as startups forever?
Post reply on HN