4 ms·
One example is building an application like minesweeper. Would you really want to tackle that with jQuery and templating engine? I'd rather break everything int
by cjohnson318 6y ago
One example is building an application like minesweeper. Would you really want to tackle that with jQuery and templating engine? I'd rather break everything into components, have them talk to each other through a state manger like vuex or redux, and only phone home to my API for important things, like the final game score.
- TekMol 6y agoI would neither need jQuery nor a templating engine to write Minesweeper.
- j-krieger 6y agoIt's great you applied your vanilla JS skills to his totally metaphorical example. I still don't get why it's okay for every other programming language to use the STL or huge dependencies, but doing so with javascript is frowned upon for some people. You wouldn't write a JSON parser yourself in CPP, you'd install something from conan or use the STL or boost for that. Why is it so bad to do the same with js?
- TekMol 6y agoThe browser does supply a huge number of APIs. To set one of the Minesweeper tiles to bomb, you could do: tiles[x][y].className='bomb'; And you are done. The rendering will nicely take place according to what you defined in the CSS.
- Exuma 6y agoWhat are you talking about? You're just talking about simple class manipulation which has nothing to do with actual reactivity, especially 2-way data binding. How would you support that with your "templating engines" you keep mentioning, which to me doesn't mean anything at all, in my understanding of what a templating engine is like handlebars.
- mixmastamyk 6y agoNot the end of the world, but the client will have to download it.
- j-krieger 6y agoSo what. Gzip is a thing. Most apps I build with react don‘t reach the 1MB mark even if they‘re gigantic.
- mixmastamyk 6y agoIt's well known there's a sharp drop off of visitors for every extra hundred milliseconds a site takes to respond.
- 3131s 6y agoI made a minesweeper clone in JS and CSS, it's not as hard as you'd think and just a few hundred lines of code. I still want to attempt a multiplayer minesweeper, which might benefit more from something like Vue. A dashboard is usually for me the primary use case for one of these reactive frameworks.