soegaard2
2021-10-21 15:07:12

I had to look up Knockoutjs. Looks fine to me. The “problem” with JavaScript is too many options…


badkins
2021-10-21 15:14:10

I’m a fairly light javascript user, and jQuery has worked nicely for most of my needs thus far. I mainly want something to smooth out the rough edges between browsers and provide some utility functions as opposed to a heavy framework. I should probably look into React, but I haven’t been motivated to do that :)


massung
2021-10-21 16:34:08

> The “problem” with JavaScript is too many options… Obligatory: https://www.destroyallsoftware.com/talks/wat


seanbunderwood
2021-10-21 16:56:23

I recently started learning web dev for real, and, after bouncing off several frameworks, I ended up settling on vanilla JavaScript. Its syntax is a bit more cluttered than jQuery, but it saves a dependency and there’s not much that jQuery has and vanilla JS doesn’t nowadays.

I think I will be happy with that indefinitely? I see what problems the frameworks solve, but the price is an awful learning experience. With vanilla JS I can tackle new concepts one at a time, and use them as I learn them.

With React & friends, it often seems like it’s hard to know how to do anything unless you know how to do everything. And I’m just not a fan of self-gatekeeping technology.


zaneshelby945
2021-10-21 17:26:31

@zaneshelby945 has joined the channel


massung
2021-10-21 17:42:59

@seanbunderwood - did you try Svelte? I ask because at my last job we used Vue.js for a somewhat hefty and interactive site. It was really nice when things were small, but got out of hand pretty quickly. I came across svelte later on and thought (too good to be true) it seemed like a potential silver bullet for a lot of the issues we had w/ Vue. I never got a chance to try it, but a new project is starting up and if we were to give it a go over the devil we know, now would be the time.


badkins
2021-10-21 17:55:17

A friend recommended Alpine.js to me as a simpler alternative to Vue/React. It does seem like vanilla JS has caught up to a lot of jQuery.


gmauer
2021-10-21 18:21:11

that’s only a problem (quotes meaning you’re being sardonic, acknowleged) if you see javascript as a single community. Which it is not. You can’t compare “javascript” or even “node” to racket. You can barely even compare it to java, it is just so much larger and there’s actually dozens, hundreds of communities there. We just have crappy language to talk about it. It’s like saying that “programming” has too many options. Yes, it does - that’s kinda on purpose :wink:


gmauer
2021-10-21 18:28:33

vanilla is a reasonable path but nah, you don’t need a whole ecosystem for react, you can get away with sticking to the core library. The big deal with react is that it has two really really nifty concepts in it - the virtualdom, and the context api. Both are very different from what you see in the rest of js (well, not quite true, there are some other vdom implementations such as vue) and are really interesting in their own right.

However, React comes with a major downside which is the need to depend on a build system. This is technically not necessary since the only thing you really need it for the truly bad idea that is jsx, and jsx is - again technically - optional. Unfortunately, roughly 99.9% of documentation you’ll find is using jsx. You can learn how it works (its a very simple layer) and just do the mental mapping to regular functions every time, but that’s hardly a good experience.

And given that the entire point of javascript to begin with was to be simple and not require a build system well….build systems in js tend to be complicated demons


gmauer
2021-10-21 18:29:37

If you’re interested in doing this stuff for knowledge and understanding rather than actual work, I’d recommend looking at something like preact which can be much simpler but very similar interfaces and concepts to react, or even just using the VirtualDOM library directly and building your own component structures around that


gmauer
2021-10-21 18:30:08

personally thats how I learned react - I took a virtualdom library and built my own bad version of React that drove a hackathon website. After that the transition was relatively easy


badkins
2021-10-21 18:41:24

I just replaced jQuery with Alpine on my covid stats page, and it was super easy. Not much functionality - just hiding/showing elements and dynamically changing the text of the button doing the hiding/showing. I think Alpine, plus maybe a few libraries such as axios for ajax, may do all I need for a while.


gmauer
2021-10-21 18:45:28

I for the life of me can’t figure out why people love axios - like really, what does it provide that you can’t do with fetch and a simple function wrapper?


badkins
2021-10-21 18:47:38

Back when browser incompatibility issues were greater than they probably are now, I started using jQuery a lot (maybe 2007, 2008?), and just continued to use it out of inertia. My recent reading seems to indicate I probably need it less. An article mentioned axios as an alternative to jQuery ajax stuff. I haven’t looked into vanilla js seriously, so I probably have some research to do.


gmauer
2021-10-21 18:48:26

gmauer
2021-10-21 18:49:01

For what its worth, this site is optimistic. There is definitely some stuff from jq that’s really hard to replace, but generally speaking - yes


badkins
2021-10-21 19:06:53

Thanks. I just ordered Flanagan’s 7th ed. js book - time to refresh my js skills a bit :)


gmauer
2021-10-21 19:09:16

I always recommend Reginald Brathwaithe’s Javascript Allonge 6 too.

It’s basically a book on taking FP seriously in javascript


gmauer
2021-10-21 19:10:04

probably not such a heavy lift for someone doing racket already, but lots of people find it absolutely brain-melting in a good way


badkins
2021-10-21 19:38:52

My main motivation for the Flanagan book was to get an up-to-date reference. Allongé looks interesting, but 2013 seems a bit old.


badkins
2021-10-21 19:39:25

I’m really hoping ES6 fixed some of the bad/awful stuff in Crockford’s “good parts” book - we’ll see :)


gmauer
2021-10-21 19:40:38

allonge six is more recent than 2013. The six is for es6 syntax


seanbunderwood
2021-10-21 19:40:47

No. Even trying to understand what makes Svelte interesting seems to require a lot of expertise in the space.


gmauer
2021-10-21 19:40:51

its up on leanpub so you can browse it for free


gmauer
2021-10-21 19:41:33

but yeah, es6 fixes….some of the bad parts


gmauer
2021-10-21 19:42:03

not if you expect such small and totally unimportant bits like “how to load modules” to be fixed. That’s still stupid in fifty different ways


seanbunderwood
2021-10-21 19:43:31

To some extent, I’m resistant to even looking at frameworks anymore. I’m happy with vanilla JS, I personally don’t even like SPAs all that much, and that seems to be the focus of most frameworks nowadays, and to some extent I feel like the idea that the first step in getting started on Web development is to pick a framework is kind of the whole problem in a nutshell.


seanbunderwood
2021-10-21 19:47:03

For me, the big problem with all the React hype was that it took me far too long to realize that virtualdom solves a problem I don’t have.


seanbunderwood
2021-10-21 19:48:00

So, for me, the major downside of React is that it seems to be 100% dead weight.


gmauer
2021-10-21 19:48:57

oh yeah, if we’re talking about problems people actually have then yeah, jquery ui widget factory should have been enough for nearly everyone but they never bothered to write up very good documentation…


seanbunderwood
2021-10-21 19:51:17

I don’t even need that. I really am just fine with vanilla HTML/CSS/JS.


gmauer
2021-10-21 20:08:15

yeah, it was just a nice structure for doing components


ben.knoble
2021-10-21 21:28:30

Vanilla js practically has modules and classes now, too, right?


rokitna
2021-10-21 21:52:25

I think a lot of things are SPAs that don’t need to be, so I have a certain lack of enthusiasm for them. I think the little pieces of functionality that do benefit from being SPAs also benefit from SPA frameworks, though. And once any part of a site/app is an SPA, I suppose it’s probably tempting to dump the whole thing into one SPA just so it doesn’t have to be refactored later. :weary: