3 ms·
I still find it hard to get a php ajax form to work despite tinkering with code for over 10 years. I can;t imagine trying to code an entire app when getting a f
by paulpauper 9y ago
I still find it hard to get a php ajax form to work despite tinkering with code for over 10 years. I can;t imagine trying to code an entire app when getting a form to work takes hours. guess some people learn faster than others
- jgtrosh 9y agoMaybe PHP AJAX forms take a lifetime to master, compared with what people learn nowadays.
- noir_lord 9y agoThings are a lot less painful than they used to be. fetch()/promises/async/await and better browser support. https://developer.mozilla.org/en-US/docs/Web/API/FormData https://developer.mozilla.org/en-US/docs/Web/API/FormData https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API Also promises (coupled with async/await) make things a great deal more pleasant and I'm old enough to remember the old days.
- ben_jones 9y agoHow does javascript async/await solve form handling (presumably pure html) and basic PHP?
- noir_lord 9y agoHe said ajax, the asynchronous part can be handled cleanly with async/await particularly if doing more complex field validation/rules.
- onion2k 9y agoJS syntax is a lot nicer these days but that's always been relatively easy. Where web dev is hard, and will always remain hard, is the concept of writing stateless applications. Building something that might seem easy to you, such as a form with server-side validation, is very different to building a desktop app. When you write desktop apps you don't rebuild the entire UI for every update. You don't have to reload the user's entire state on every call. Those things are weird if you're not used to it. It's perfectly reasonable for a developer to say they find it hard. And, arguably, it could be part of the reason why frameworks like React are so popular - they make writing for the web a little more like writing a desktop app, because components can have persistent state.