4 ms·
GUI is plattform independent. Code is plattform dependent. Have a single language to build UIs, target it to multi plattform.
by imvetri 5y ago
GUI is plattform independent. Code is plattform dependent.
Have a single language to build UIs, target it to multi plattform.
- thomascgalvin 5y ago> GUI is plattform independent. It really isn't, at least if you want to meet the expectations of the users of each platform you're targeting. It's easy to say "I want a button that says '[Click Me]'." It's less easy to say what the pixels representing that button look like in a platform-agnostic way. Are the corners rounded? What kind of bevel does it have? What sort of visual indication is there when you mouse over? And then there's stuff like layout. Does your form have the buttons ordered `[OK] [Cancel]` or `[Cancel] [OK]`? Because there are platforms that do both, and if you get it wrong, your user will mis-click because of muscle memory. And what do you do when one platform supports a widget natively that you don't? Or when the APIs for a "common" widget diverge wildly? Windows Explorer and MacOS Finder serve the same general purpose, but they aren't identical, either from the user's perspective, or from the API perspective. Java's Swing probably comes closer to "cross platform GUI" than any other package, but it's far, far from perfect, and it solves a lot of these problems by not trying to mimic the underlying OS. Yes, there are themes that get close, but generally, when you're using a Java desktop program, you know you're using a Java desktop program. A lot of very smart people have tried to create "a single language to build UIs," and "target it to multi platform." It isn't as trivial as you make it seem.