Is Electron just a meme?

Electrical engineer here. I was assigned to write some software for internal use in the shop. The software will really just be a dashboard for our test guys to input data, should be pretty simple. Nobody in the shop writes software but I do firmware and CODE IS CODE, RIGHT?

I don't have any experience writing Windows software. I was told I have the freedom to use any tool that I want.

I've been considering learning C# and using Visual Studio because I already always use C. I don't know a goddamn thing about object oriented programing though. The other option is using JavaScript and the Electron framework. I've didled around with JavaScript and HTML in the past so it wouldn't be all foreign to me.

I've been watching YouTube videos to figure out the easiest path forward and it seems like it might be to use C#/Visual Studio. The form designer seems like easy mode but I don't know anything about it. It seems like a lot of startups are doing everything in JavaScript now but it just kinda feels wrong. Maybe I've been redpilled by the whole "JavaScript isn't a programming language" thing.

Any suggestions? Is Electron just a meme? Or is it the future?

Attached: 1_aBsgPiEeOE5lLoippRm7BA.png (1200x630, 117K)

Other urls found in this thread:

josephg.com/blog/electron-is-flash-for-the-desktop/
twitter.com/NSFWRedditImage

Writing firmware is not software. "soft" in software implies open to addition of changes. Firmware is really just about getting the firmware to just work.

gui programming is like pulling teeth, so using web shit is basically just a shortcut

if there were better gui development tools around we wouldn't have electron

i like it. do UI in js and html and performance critical stuff in c/c++.
its basically a very quick way to effortlessly write guis. the fact that you can just extend it wit c or any other language is pretty good.

Whatever framework you use, the most important thing is to have the right mindset. Most tutorials having anything to do with GUIs just show you how to hack things together. Luckily, GUI development is very similar to embedded - everything is event-driven. I had many false starts trying to make desktop software, but as soon as I treated it like I would treat buttons and indicators for an embedded project, it made sense.

Never merge GUI functions with function calls. It'll be tempting to implement functionality in your "click" callback for a button or something, but don't do it! Decouple your graphical code from your logic code as much as possible. Same concept as not putting functionality inside interrupts.

The other big thing is that all the different items on a GUI "exist" at the same time. For most libraries, at least. For example, imagine your application had two distinct "pages" - they'd both always exist, but in a different order on the screen. The page that's on top is what the user sees. For simple embedded displays like character LCDs, you approach graphics from the pixel. Draw lines, set certain pixels to true, etc. For desktop software, every graphical element that you use is always present, they're just hidden/visible depending on what you're trying to show.

One last similarity is that graphical programming in general is based on while loops. Typically, it's something like 'get screen events (keyboard,mouse), make items visible/invisible, render screen' forever. Use the screen events in your logic to control which items are visible. As long as you structure it like that, it's pretty easy no matter what language you use. As far as the OOP stuff goes, it's just a lot of repetitive typing and shit. Somewhere, someone decided that all things graphical are just types of widgets, so you have to type shit like widget.baseLayer.control.button.radiobutton() to use a damn radio button. Once you figure out exactly which graphical elements you want, it's easy.

why not have an online dashboard? Aka a webapp? This would allow you to input data ANYWHERE. All you need is a server to handle post requests and you're done (also maybe a backend).

Brainlet here, how do you use C/C++ with electron? I thought you had to use JS only.

Thank you for the detailed response and relating things to embedded. This will help!

It's all the cancer of flash, now on your desktop.
Not even once, OP.

Yeah that would pretty cool but I work in a secure facility with tight security requirements. Everything has to be standalone and nothing gets in our out. I can't even bring my cellphone into the building!

Probably emscripten

Electron really is a meme. It's literally a Chrome browser in a neat package which is totally unnecessary for desktop applications.
Just learn either C# or Visual Basic and create a Win Forms project with .Net Framework 4.7. You'll be able to design your UI and program the logic for everything from within Visual Studio.

Just keep in mind that C# is nothing like C; they aren't related at all.
Even though C# is the better language, personally I'd recommend Visual Basic for somebody new to the .Net platform.

Look, if you just want to make a simple UI in a language with tonsof features and libraries just use Java + Swing or JavaFX
You can even treat JavaFX like an electron app by using the webview to render the UI and have communicate with the java app over websockets. Don't use Electron, it's cancer.

>Java for anything UI related

Attached: 1494099081939.png (1000x869, 1.17M)

you can extend parts of the runtime with cpp. it doesnt get transpiled or anything. its an api sort of thing. it just runs in its on thread next to the electron application and uses the api to communicate with electron.

Dumb Zoomer, Java is used a lot in business internal applications because write once, run anywhere. The entire IDE suite of intelliJ etc is written with Java

this is the right answer. just suck it up and use js and electron, because the alternatives are much much worse.

What about Qt? It's pretty comfy and not (usually) a pain in the ass to deal with, as long as you aren't afraid of C++. There's also PyQt if you prefer Python.

Qt is nice compared to the other GUI offerings, but the unfortunate truth is you can usually make something that looks 10x more polished and is 10x more maintainable in less time with something like Vue + Electron.

I came here to suggest this. The Java Swing library is very easy to use effectively. I recommend following the official tutorial to use Swing and then try adapting what you've learned to what you need to do.

True, you pay for the efficiency (compared to Electron at least) with code complexity and Qt's occasional quirks.

I thought I remember hearing somewhere that Swing is on its way out or semi-deprecated.

Swing is still included in the Java jdk distribution. It is not deprecated, it is feature complete, meaning it won't get any updates. JavaFX was included with the JDK up until JDK 11, since then it has been moved outside it and is now developed separately as an open source library. Neither are deprecated, but making fancy GUIs is probably easier with JavaFX. If you just want to make a simple GUI for internal use then Swing is completely fine.

>Electron is such a disaster people are unironically recommending Swing and JavaFX.

Attached: 7kfIcDF.jpg (1280x720, 83K)

Make a vert.x application
Add JavaFX to it
Have JavaFX render webview
Add the vert.x JS eventbrus bridge

Now you have your own electron that doesn't suck and can also do multithreading effectively and has access to the java ecosystem + you can use webshit for UI.

Discord is made with Electron and it's quite nice and very popular.

electron isn't magic or anything, nodejs native modules still work

it's also bloated as fuck (why does an IRC clone need to run four processes and eat so much ram?) and they still use rust and c++ behind the scenes to do important stuff

Just use electron. It'll work for your purpose, and it's seriously baby-tier development, meaning you'll finish the project quick as fuck.

The anti-electron people are mostly consisted of name-and-shame plebs. I seriously doubt it will be the future, but it's by no mean a bad platform.

If its something that only needs to run on windows, and does simple things like read serial interface data, things id'g go AHK or autoit

if you dont know anything about OOP you are better off with electron

I can't understand why a person who works with firmware and understands that code should be made thight and fit for your hardware, would want to use the fucking bloat of a web browser disguised as a program.
someone delete javascript off this world.

ideally they'd toss the browser shit and come out with something less bloated like sciter or react native

the javashit isn't so bad on its own but then you pull in the entire bloat of chromium because faggots are too useless to do anything away from a browser

desu i think the reason it's so popular though is because companies waste a fortune building their faggy website and want to wrap it up to pretend they have a desktop app too

If you know C why not write directly using winapi? It's not OOP and oretty straightforward.

>You now remember Visual Basic
Post your blog if you pick Electron, OP.
t. An electronics engineer trying to transition

josephg.com/blog/electron-is-flash-for-the-desktop/