5 ms·
Every time I take a stab at a web gui app, I’m daunted. The toolkits, the apparently billions of dependencies, the vastly complicated build processes. I tried
by whartung 2y ago
Every time I take a stab at a web gui app, I’m daunted.
The toolkits, the apparently billions of dependencies, the vastly complicated build processes.
I tried again recently. HTML file and a separate JS file. Some SVG elements with a click handler.
I had mouse in and mouse out logic, and that worked great. But for some reason the click handler did not.
I tried it in Safari, Chrome, and Firefox. It worked in Firefox. It did not work in Safari, it did not work in Chrome.
Turns out in Safari, my Ad Blocker was hijacking my click handler. Chrome, still not sure what’s happening there.
But I projected what happened in Safari out to the wild. “Can’t get your app to work.” Except instead of a 50 line experiment, it’s a gazillion lines of God knows what 87 levels removed from whatever code I actually wrote.
Cross browser Hell. It’s supposed to be a sandbox only to find out the cat got there first.
And I give up. Again. It’s not my livelihood. It’s a hobby. I encountered these quickly enough to thwart me before I’ve actually invested any real time. Like starting out on a vacation and you have a flat tire and the drain plug pops out before you get out of town. Maybe there’s a cosmic message here.
And I feel stupid. Obviously folks manage, but I keep getting knocked down and kicked.
The idea of pain free distribution via a PWA is really alluring. I’d like it to work. But it seems every time I get back up, the lights go out again and the corners of the cabinets seek my head.
But then I think back to my rock climbing days, a friend used to climb in shorts. And I asked didn’t it hurt when he used his knees? He answered “it’s not supposed to hurt?”
Is it supposed to hurt?
- adastra22 2y agoDevelopers like you and I are a dying breed. We remember writing applications for operating systems that had straightforward APIs, and OS developers that worked hard to ensure any app which used those APIs would not break. Most "full-stack" developers I know that write web apps have literally never written a line of C++ in their life, let alone written a rich text editor using an object oriented desktop GUI API. They don't know it's not supposed to hurt.
- piva00 2y agoBut C++ hurts, a lot. My first foray into C++ was trying to write exactly a GUI app for Win32 back on Windows 98, it hurt, a lot.
- 1234554321a 2y ago“Modern” C++ is completely different to the pre-2000 or even pre-2010 C++.
- waldrews 2y agoFor those of us who were last paid to write C++ in a different millenium, suggestions for a book to catch up?
- adastra22 2y agoYes: https://www.rust-lang.org/learn https://www.rust-lang.org/learn (Less snark: just browse cppreference.com. The standard library is updated to make use of new features, so just check out the changes between C++14, C++17, C++20, etc.)
- ffsm8 2y agoI wish they were a dying breed, but no, you're not. You're just looking at the past with extremely rose tinted glasses. It's way,way easier to implement a UI like in the 90s with hmtl5. You're just trying to make a modern UI with all it's bells in whistles and now complain how complicated it is. The tech ain't any more complicated. The software you're imagining has a waaaay more complicated UI then what you did in the 90s
- coldtea 2y ago>You're just looking at the past with extremely rose tinted glasses Dude, some of us still write 90s style code, even Delphi style stuff (FreePascal and Lazarus), and can still compare it everyday to modern web dev. It was better without any "rose tinted glasses" needed. Same for 00s C#/.NET or even "classic" Visual Basic - dead easy to make even an elaborate UI going. >It's way,way easier to implement a UI like in the 90s with hmtl5. No, it really is not. What you're describing is some simple form, as if 90s UIs were constrained to that. >The tech ain't any more complicated. The software you're imagining has a waaaay more complicated UI then what you did in the 90s Not even close to being right. Most web apps including Electron apps are dead simple and primitive functionality wise compared to the 90s (including not having all the functionality one got for free via integration with the OS), but their codebases and dev platforms are still over-engineered and haphazardly-engineered monstrocities. And then there's the resource consumption.
- ffsm8 2y agoYou're putting words into my mouth I didn't say: The "modern web stack" has an incredibly high ceiling wrt how complicated it can be. It's floor isn't particularly complicated however, and definitely not higher then the equivalent software with the native APIs from the 90s. You had buttons, inputs, text boxes. Pre-2k UI APIs were extremely limited. Did we even have hover in windows 95/98 or MacOS 9.0? The first time I've seen that was more towards 2010 then 2000 - windows XP/Vista and MacOSX, but it's been a long time since then > No, it really is not. What you're describing is some simple form, as if 90s UIs were constrained to that. Please provide an example then. I sure as hell can't think of one and googling didn't provide me with anything but that.
- Robin_Message 2y agoTo be fair, that's one of the reasons why libraries like jQuery and React exist: to smooth over the difference between browsers. Even today, big chunk of React is masking the subtle differences in event handling and other things. And whilst it forces you into a paradigm, I've never had a bug caused by the internals of React that I've had to dig into. But maybe I'm lucky or only do simple stuff? As to it hurting, I guess I'd say, use the protective equipment! Sure, it can be bulky and awkward occasionally, but it works and it's often better than the alternatives.
- tayo42 2y agoI think it just used to be a lot worse. Sure Web ui isn't great, but like in your list of browsers your complaining about you don't even have internet Explorer, let alone multiple versions of it. Docs are better, apis have more features, browsers auto update and nag to do it, libraries and frameworks for what ever coding style you prefer
- lukan 2y ago"Cross browser Hell. It’s supposed to be a sandbox only to find out the cat got there first." Hm, it is really not that bad anymore. Only if you target bleeding edge features, you will usually have issues. But a mouse click handler? I never managed to not have that working. Also I like vanilla JS. Web Apps can be really simple, if you avoid the bloat.
- kaba0 2y agoWhile I also don’t think that a mouse click handler would be problematic, my recent experience is that more complex apps are more and more often broken under firefox, but still work fine under chrome. E.g. miro boards are unusable under firefox, and it’s absolutely shameful of every company that can’t bother testing it on like 2 browsers.
- lukan 2y ago"that can’t bother testing it on like 2 browsers" Current browser market share: Chrome 64%, Safari 20%, Edge 5.3%, Samsung Internet 3.5%, Firefox: 2.2% https://www.similarweb.com/browsers/ https://www.similarweb.com/browsers/ It is hard justifying extra effort for those 2.2% marketshare, unless you count in idealism. And most companies are there for profit.
- kaba0 2y agoEdge and samsung internet are basically the same as chrome, so there are only 3 browsers to check. Especially that most stuff just works fine across the browsers, it’s not like cross-platform across OSs, it really is a bare minimum.
- beretguy 2y agoThere are only 3 browsers these days pretty much: Chrome, Safari, Firefox. It really shouldn’t be hard to test.
- lukan 2y agoHave you ever tested something in mobile browsers?
- nhinck2 2y agoI really can't imagine what you did to make basic functionality so difficult to achieve. Even as someone who prefers making desktop apps, making Web apps should not be comparatively harder.
- MrJohz 2y agoI think I feel a bit like your friend: web development is not supposed to hurt that much, and it usually only happens if you start doing things in obscure ways, or unusual environments, or whatever else. Unfortunately, when you're just starting out, or trying something as a hobby, it's difficult to tell what the "correct" way of doing things is, so beginners often fall into these sorts of traps. I don't think this is any different with web development, GUI programming, machine learning, embedded, or anything else. I did a bit of work with Pandas recently and spent the whole time going "but this is so dumb - why would it work like this?" In reality, it was not dumb, I was just inexperienced with the task and tools I was working with, and was running into problems because of that inexperience. There are some ways to mitigate this, and good learning resources that show you how to get onto the happy path (without bombarding you with too many best practices up front) are worth their weight in gold. But I think it's very easy to forget what it feels like to learn something new, so often when we approach a new area of programming, we notice how difficult it is to learn, and that feels surprising to us - even though it surely took us a long time to get comfortable with the stuff we already know.
- hgyjnbdet 2y agoNot popular on HN, but you should look into Dart/Flutter, especially if it's for a hobby. I too was daunted like you and that's why I chose Dart/Flutter. Though if you're wanting web technologies I'd consider looking into: https://leanwebclub.com/ https://leanwebclub.com/ Nothing to do with them but they're all about franework-less web technologies.
- robocat 2y ago> The toolkits, the apparently billions of dependencies, the vastly complicated build processes... Except instead of a 50 line experiment, it’s a gazillion lines of God knows what 87 levels removed from whatever code I actually wrote. Instead start with pure HTML, SVG, CSS and JavaScript. Use MDN for documentation. Pick one browser to develop on (any one will do). Why? Most importantly you are learning how the low level browser code works, and you are building your own taste about using the core languages. Just like learning machine code helps with your C++ development. You don't need build processes unless you are developing commercially. The frameworks provide opinionated APIs, but they are often too abstract and are providing complex enterprisey features. There is not that much difference between browsers now. And jQuery is bollocks (it was mostly golden for adding code to HTML pages that were served from a back end). If you want to get a webdev job then maybe do some thinking on what framework and tools you want on your resume, and learn that framework/tooling after you have mastered non-framework browser development. But my guess is that webdev is likely not a good fit if you like engineering your software. My experience is now outdated, but I wrote my own framework which morphed over time as we supported other browsers and newer versions of browsers. I started my career on embedded software, so perhaps I am more cynical than most! My framework was far better engineered than most (for the reliability we needed). Other frameworks delivered on other goals that were not aligned with our needs. It is a very frustrating road writing pages for browsers because everything feels arbitrary and you have very little control over the engineering and you are at the mercy of browser quirks: you are often forced to come up with shitty expedient solutions that work if you are dong commercial work, and I very rarely felt clean. There is no beauty to web development: it is dirty work that I would try and do the best I could to achieve the outcomes we needed. Compromising constantly...
- happytoexplain 2y ago>There is no beauty to web development Thanks for this pithy summary. Beauty is the perfect one-word difference between what programming can be and what the web stack is.
- happytoexplain 2y agoIt hurts, but it's not supposed to. The web stack is now pure hell, almost completely devoid of what makes programming software enjoyable in the same way as making furniture or machining a tool, which it used to be and still is in places. The web ecosystem has raced to the bottom with the goal of enabling less and less talented/experienced developers to be productive. That goal is good, but the changes didn't have to be so bad - however, the nature of the web means that it's almost completely nonviable to make large breaking changes to the foundations, which are they kinds of changes that actually improve things and benefit everybody. So instead we build up layers. It's so disappointing considering what it could have been like.
- deleted 2y ago[deleted]
- ryandrake 2y agoI have the same background (25 years of C and C++), and tried the same thing: Let's learn web programming by putting together a 700 line web app that allows you to edit, load, and save some proprietary file format. Sounds like a good learning project. How hard could it be? I'll use this JQuery thing, that looks popular. I guess I need HTML, CSS, and JS, not sure what should go in which file, but I'll learn it as I go. But nothing has as thorough documentation as I'm used to in native / systems programming. It's all rando tutorials and incomplete/outdated web pages. Weeks later, I have something barely working, but it looks ugly as sin because there is no nice, well-documented GUI library like Qt, wxWidgets, and so on. And the ones that are decent would require me to rewrite my whole app around them. I find JQueryUI which is still at the level of banging rocks together to create fire. In fact, the whole process of putting a web app together feels like I'm using stone tools and blunt chisels instead of the C++ workshop full of power tools and well-lit workbenches. I don't know how developers can live with this pain. Good for y'all--I couldn't do it day in and day out.