24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions
https://www.bitecode.dev/
Email: contact at bitecode.dev
comment 5y ago · link · parent
But even so, Vuex way better integrated, requires less boilerplate (thanks vue reactivity) than redux, or even zustand, which once you add immer, looks like blobbing all over again.
Honestly, we should do a contest. Take 10 juniors out of school give them a twitter clone to write, 5 in Vue, 5 in React, and come back in a week.
In fact, no need for them to be junior. Let's just take your regular Java dev. Not your 10X HN dev. Just average Joe. See how it goes.
comment 5y ago · link · parent
And now you have to install and manage deps, import them, while your blob is still less readable because you have maps+lambda+&& to understand before even reaching what DOM element you are manipulating.
The premise of React is that composing primitives is better than having a high level tool to do the job: it's supposed to be more generic, more flexible, easier to learn.
In in my experience, it's true only in the case you don't have a well defined problem. But with frontend UI, we do. We know very well the problem to solve. Give me helpers. Give me wrappers. That's the only case where I welcome a DSL.
I don't want to have to think in functions and workflow in my template.
comment 5y ago · link · parent
And in the end, I still have to read 2 JS expressions before even figure out what DOM element I'm actually dealing with. Then I still have to evaluate what the heck is happening in onClick and className.
I still have to parse code in my presentational layer, code that is interleaved with my template indentation so it also makes it hard to understand hierarchy and easy to make mistakes.
Of course, the elephant in the room we are not talking about with react is that all those things compounds. When you have 5 of such blobs in your render functions, issues don't add up, they multiply.
Then you add the store system on top of it, with actions, reducers and all that fun stuff.
comment 5y ago · link · parent
You use a dynamic component:
<component :is="condition ? 'WrappedComponent' : 'UnwrappedComponent"></component>
> That is a general theme, I've found - compared to React, Vue makes the easy things easier, but the hard things harder.While react make the easy things annoying. It took me an afternoon to be productive with vue, several weeks with react.
And all that for what?
Having the privilege to "just use javascript"? Here is "just javascript" in jsx:
{items.map((items) => (
{display && <SomeElement
onClick={e => e.preventDefault() && foo()}
className="`${active ? 'current' : ''}`" />}
))}
Here is the same in vue template: <SomeElement
v-for="item in items"
v-if="display"
@click.prevent="foo()"
:class="{'current': active}" />
Not only the react blob is impossible to scan, but it will be different depending of the dev who coded it, because there is no enforced patterns. You must use brain power to parse every single template line. HTML, that thing that was simple and declarative, now becomes complicated and imperative.And that's not even weird or unusual code. That's regular stuff one writes all the time. Don't get me started on state management or spaghetti hooks.
I have yet to work on a react code base I was more productive than on a vue one. And the gaps get wider if the team is not composed of excellent coders, because react code by junior is a nightmare.
4117.
Petite-Vue, VueJS optimized for progressive enhancement(npmjs.com ↗)
1 points · by BiteCode_dev · 5y ago · discuss
comment 5y ago · link · parent
A 5kb packaged VueJS without component and 2 new directives to make it easy to sprinkle JS on top of server-side served website.
I use Vue often like this, since you always were able to put the template directly in the HTML like in AngularJS 1 with this lib. But petite-vue improves a lot the ergonomics of doing this. It seems also great for prototyping, and feels even more minimalist than svelte (which the new Vue 3 API already compete with).
Now, with coupled with projects like htmx (http://htmx.org) and tailwind (http://tailwind.build), you can create quite a serious reactive website with minimal JS needed. Or create a huge unmaintainable mess, since not DRY mechanism is present by default.
Between this and the fantastic ViteJS (https://vitejs.dev/), Evan You seems really committed to giving the JS ecosystem a boost in usability. I'll stop now, I'm gonna sound like a PR piece. But as a python dev, anything that makes JS more fun is an absolute win.
4119.
Petite-Vue, VueJS optimized for progressive enhancement(npmjs.com ↗)
4 points · by BiteCode_dev · 5y ago · 2 comments
comment 5y ago · link · parent
Fun times. Also, thanks python for making it way easier than it should have been. GPRS modems are not simple beasts.
comment 5y ago · link · parent
Also why all the anti-copilot seems to think their code is great, or even well understood by themself.
I have counterexamples everywhere around me all the time for these 3 points.
comment 5y ago · link · parent
Now I do understand many won't do so. But they already do the same, just slower, with their current method.
comment 5y ago · link · parent
It skips sponsors (even from the youtuber itself), jingles, intro, etc.
It's awesome.
comment 5y ago · link · parent
- even the best spa out there often barely shim the normal browser behavior. Yesterday my back button broke once more, in 2021. Infinite scroll don't let you pinpoint your position. User don't expect being able to copy / paste a link to take them to the content anymore.
- the ecosystem of url handling is fractured. This month I worked on a Django + React app, and my clients asked that it should be able to handle being hosted behind an arbitrary URL prefix if provided in the conf. Here are the things I had to tweak:
* adding the prefix to the proxy pass apache conf (yes, they are still using it);
* adding the prefix the react router conf for which most tutorials were outdated;
* adding the prefix in the js bundler conf as the base, and for the dev proxy;
* adding the prefix in the <base> element in the main template;
* making all urls and ajax calls relative to the <base>;
* making all the react router Link and history.push _absolute_ (took me a while to figure this out);
* serving the index.html as a template file from django, not nginx, to inject all that stuff according to the env var.
* hacking the build script to replace static files URLS with template place holders because the js bundler didn't have a hook for that (thanks sed);
And that's on top of the regular work of making urls in SPA works, which implies sync your backend and frontend URLS for pages and API. Who is going to do all that works? In fact, how many devs have the knowledge to do that? Pre-SPA, there would have been well documented 2 steps to do the same thing. The junior in the team could figure it out.- we had a ton of manure on top of our urls. AMP. Url shorteners. Tracking ID and redirections. Content wall. Captcha. Often several of them at the same time. If one of them break in the chain, goodbye URL.
- low code mean low skill devs, that never heard the mantra "cool url don't change". They don't even know they should care.
- some browsers just hide the URL. The users don't know what an url is anyway.
- apps don't care about deep linking. They could handle url fine, mind you. We have the tech for it. But it's not even on the radar of most devs. You don't address the content, you consume whatever pops up, so why bother ?
Plus, google is so good at finding the content you want out of the barely readable drunken mess of letters you feed it that most people don't type url anymore. People don't care about URL just like people don't care about bees dying, because it's too abstract to worry about.
comment 5y ago · link · parent
For foss ones it could be great though.
I think the best part for me is that how it's going to introduce even more low code devs to the worker pool, which means I will be able to raise my price again. Last time this happens, when designers got to the backend, I got +30% in a year once my clients figured out the difference in output.