4 ms·
> My code will have fewer defects Well, I agree it will have fewer memory bugs. But fewer issues altogether… you're just bragging now. Your application will h
by bombolo 4y ago
> My code will have fewer defects
Well, I agree it will have fewer memory bugs. But fewer issues altogether… you're just bragging now.
Your application will have awful keyboard navigation, will not support normal well established shortcuts, will contain vulnerable js that you will never bother to replace…
- Klonoar 4y ago>Your application will have awful keyboard navigation, will not support normal well established shortcuts, will contain vulnerable js that you will never bother to replace… ...what? These are all things that any developer - C++, JS based or otherwise - needs to implement and/or be mindful of. This has nothing to do with the language/runtime/platform and everything to do with the team implementing it and their level of attention to the platforms themselves. Hell I cannot tell you the number of QT-based applications I've opened on macOS that violate established shortcuts. This isn't an Electron-only problem. ;P You rag on them for "bragging" but your entire comment is basically one big attempt at kicking down on another development platform.
- hajile 4y agoPut a JS dev and a C++ dev of equal experience against each other and the JS dev will have fewer bugs. At the most basic, the JS dev would have all the same logic bugs as the C++ dev, but subtracting the memory bugs from the JS bug count would itself be enough to prove my point. There are many other reasons though. JS has only two number types (double and BigInt). As such, we can also essentially get rid of overflow errors that C++ does nothing to prevent. JS has an event loop baked into the core, so another class of C++ bugs go away. That same event loop bakes in its own thread pool to safely manage IO eliminating another class of bugs. Web workers (system processes) limit data sharing to slower, but more safe methods and eliminate yet another class of bugs. I'd note that these are some of the biggest possible sources of the hardest to find bugs and eliminates essentially all of the security nightmares found in C++ code. Adding to this, JS code is more dense which tends to correlate with lower bug counts (until you reach super-high density like APL at which point you get maintenance issues). JS first-class functions with automatic closures adds a very powerful tool that is all-pervasive in real-world JS code, but isn't even present in C++ code (yes, closures exist, but in an extremely limited and manual way). Since ES2015, JS has powerful features like destructuring that make all the little data manipulations (so common in UI code) much easier and less prone to subtle bugs. If bugs do happen, JS makes it much easier to continue gracefully without everything crashing to the ground. None of this should be surprising. C++ is an amazing language in its low-level area of expertise where all the features that can create more bugs are necessary and lead to amazing performance. It also shouldn't be surprising that a very high-level language tailor-made for UI would be better at creating and maintaining a UI with fewer bugs. As to keyboard navigation, that is entirely up to the devs to implement (whether C++ or JS). That said, web standards take A11y very seriously. Electron has `globalShortcut` and easy handling of shortcuts is baked right into the system if devs care to use it. https://www.electronjs.org/docs/latest/tutorial/keyboard-shortcuts https://www.electronjs.org/docs/latest/tutorial/keyboard-sho... https://www.electronjs.org/docs/latest/api/global-shortcut https://www.electronjs.org/docs/latest/api/global-shortcut
- bombolo 4y ago> Put a JS dev and a C++ dev of equal experience against each other and the JS dev will have fewer bugs. At the most basic, the JS dev would have all the same logic bugs as the C++ dev, but subtracting the memory bugs from the JS bug count would itself be enough to prove my point. On the other hand the C++ developer can use boost and Qt libraries to have a wide range of well tested, well implemented components that implement a wide range of things, without having to sift in npm for hundreds of low quality abandoned modules. So IN TOTAL, your point is far from proven. > As to keyboard navigation, that is entirely up to the devs to implement No. Toolkits for example implement decent tabbing. The qt designer offers a GUI to decide the tab order. And assigning shortcuts is even easier. If you go and use kdelibs you get support to completely customize every single shortcut from the control panel, or from your own application. Oh by the way with Qt you also get support to find in which directory to save settings, data, and so on. Which is not so trivial because all the defaults can be overridden by specific env vars. You can either use C++ and a toolkit that does all this stuff, or JS and reimplement everything every time. Now you're arguing that reimplementing every time is faster. It's an opinion but I don't think it's as obvious as you think it is.