4 ms·
I agree with the points here. I came from backend development, writing mostly in C++ and Python for most of my career. I've always found modern JavaScript fram
by mtlynch 6y ago
I agree with the points here.
I came from backend development, writing mostly in C++ and Python for most of my career. I've always found modern JavaScript frameworks so difficult to reason about because it feels like I'm always working through nine layers of abstraction.
Last year, I read Julia Evans's article "A little bit of plain Javascript can do a lot," and it inspired me to try to push regular JS as far as it would go in my next project. It's now 8 months later, I have thousands of users, and I'm still using plain JavaScript.[1] No babel/webpack or anything. I do use Flask to aggregate source files together, but I purposely avoid any cleverness there. Overall, I find the code much easier to debug than any of my other web apps.
One nice advantage of using only vanilla JS is that it's easier to find contributors. If you're a React project, then only React developers can contribute. But if you're a vanilla JS project, you're not bound to developers of any particular religion. Vue, React, Angular, Svelte developers can all work in a vanilla JS codebase.
[0] https://jvns.ca/blog/2020/06/19/a-little-bit-of-plain-javascript-can-do-a-lot/ https://jvns.ca/blog/2020/06/19/a-little-bit-of-plain-javasc...
[1] https://github.com/mtlynch/tinypilot https://github.com/mtlynch/tinypilot
- timdaub 6y agoHey mtlynch! Glad you like the post! Your blog inspired me to get better at writing and to take blogging more seriously. So I guess I want to say thanks! Keep up the amazing work!
- mtlynch 6y agoOh wow, thank you! It's so nice to hear that my blog had that kind of impact.
- mrfusion 6y agoDon’t you lose the value of cross browser compatibility?
- mtlynch 6y agoNo, I haven't encountered that yet. All of the JavaScript APIs I use seem to work consistently across browsers. But I should mention that I ignore support for legacy browsers. I assume users have a version of Chrome, Firefox, Edge, or Safari from the last year or two.
- mrfusion 6y agoSo you put up a message if they don’t have a recent browser? I did a lot of JavaScript ten years ago. I guess browser compatibility has improved since then.
- mtlynch 6y agoNope, no message. Nobody has ever told me that they've failed to use my app due to browser issues, so I just haven't ever put mitigations in place for users who try. It's possible that users with old browsers have tried to use my app, found that it didn't work in their legacy browser, and then just moved on without telling me. It's also worth mentioning that my app is for server administration, so my users are more technically-savvy than average and tend to be the kind of people who see the need to use the latest browser versions.
- obviouslynotme 6y agoI remember when my buddy was trying to get me to use the JS framework of the day. I was just floored with how much JS was required for very simple things. I couldn't help but think to myself, "This whole thing could be a couple dozen lines in a JS file." I am sure that some people really need these massive frameworks with build chains and universal rendering. I am just not one of them. I use JS for small logic here and there, mostly form validation and a bit of dynamic content. Most web software I know fits this description. I don't know why, but web developers are obsessed with making their jobs seem more complex than it really is. It's like everyone is scared that if someone realizes they just used HTML, JS, CSS, and a small set of scripts that people would find out they weren't real programmers.
- pjmlp 6y agoOn my own projects I always do it old style, Java/.NET SSR, pure JavaScript using the features all browser I care about support of the box. No SPA, no babel, no tsconfig with endless configuration options. On enterprise projects where I am just yet another cog, I let the FE team play with whatever stacks they feel like.