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?
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.
Nolan Allen
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
Logan Wood
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.
Angel Richardson
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.
Nathaniel Garcia
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).
Christian Flores
Brainlet here, how do you use C/C++ with electron? I thought you had to use JS only.
Nathaniel King
Thank you for the detailed response and relating things to embedded. This will help!
Ian Walker
It's all the cancer of flash, now on your desktop. Not even once, OP.
Christian Phillips
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!