5 ms·
>It made web app development so much easier I aim to develop web UIs using (mostly) progressive enhancement. I adopted several practices and developed some lib
by romaniv 8y ago
>It made web app development so much easier
I aim to develop web UIs using (mostly) progressive enhancement. I adopted several practices and developed some libraries supporting this process. As a result:
1. When I need to create something, I know exactly which data structures to use. This is determined by what is available in modern browsers.
2. I can quickly prototype solutions using plain HTML focusing on logic rather than style.
3. Since my data is by definition contained in HTML, I can easily query it using CSS queries. This makes working with nested data a breeze.
4. I factored code I reuse into generic, self-contained behaviors. Things like "when this form is invalid, this control should be inactive". There is usually very little to none page-specific code.
5. Once a behavior is written and tested, "debugging" usually involves simply making sure the page has the right attributes. I can do this by running a CSS query in console or looking at DOM. No breakpoints, no stepping, no watches.
6. The most important part: I can add one behavior at a time and the result is something that works and makes sense.
7. A lot of UI "logic" I used to have in scripts naturally migrated to CSS.
I like this process way more than fiddling with tons of page-specific "glue" JavaScript. I especially like it when I'm in a crunch, because it pre-defines a lot of the things I would have to "design" on the fly in a traditional development workflow. Also, if I run out of time I have a working (if ugly) app. If I introduce a bug somewhere in UI or run into a compatibility issues, it usually doesn't result in the entire user workflow stopping dead.
- pjmlp 8y agoThis is also my approach, when I am allowed to set the rules. Server side rendering with vanilaJS for the snippets that actually matter.
- NetOpWibby 8y agoYes! Glad to see I’m not crazy.
- scaryclam 8y agoYou sir (or ma'am), are a credit to modern web developers :) I love that you're using PE as a development tool and not just doing it because it's a good way to build robust websites and applications. I may have to try and sell your reasoned approach to some of my colleagues (they're not PE averse, but don't always see it as a great benefit).
- Grumbledour 8y agoThis can't be upvoted enough. Making sure your site works from the ground up will improve the product, the process and the developer. Less, easier to read code, less development time, easier to maintain, more and better understanding of the subject matter. And probably better usability as well, since one took the time to think it through. Sometime you have to cut corners, sure, but if you know what you are doing, the PE way is probably the easier one from the start.
- jacquesm 8y agoThank you!