Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because browsers don't support server-side declarative views natively yet. FE development wouldn't even be a thing if web servers could respond with something like

    <script>
      const [count, setCount] = useState(0);
    </script>

    <template id="counter">
      <div>
        <p>You clicked {count} times</p>
        <button onClick={() => setCount(count + 1)}>
          Click me
        </button>
      </div>
    </template>

    <counter></counter>


Would it be possible for browsers to support this? Is it not currently the case due to some constraint? What would be that constraint?


But... This is FE development, you think the backend devs would like to be writing this?

Back when we all did MVC we had FE and BE devs anyways.


Follows my experience.

Context: I'm a Rails full-stack developer, I started developing web apps 12 years ago.

I still consider myself a full-stack developer, even if I'm a BE dev right now, since now we have FE and BE in the company I work for.

12 years ago, there were no FE/BE devs: there were only full-stack devs. We used to struggle maintaining tons of imperative JQuery/Prototype/MooTools/you-name-it JS code built on top of server-side declarative HTML.

It was an hell of development/maintenance. Imperative code was pretty easy to write at the beginning, but after 2000 JS LoC you had half of the view implemented in JavaScript. end-to-end testing tools were almost inexistent, so there was no way to avoid regressions on the messy JS code you wrote. After 10000 JS LoC you were pretty f*ked. This workflow was unsustainable for any web app that aspired to appear "modern".

In a couple of years, FE frameworks (AngularJS was the first among popular ones) started facing this problem. They offered you a declarative way to implement dynamic HTML views.

Moreover, companies killed two birds with one stone: they could totally divide FE and BE, so to hire way more developers as junior developers are better suited to work for FE, and reserve the senior ones, with more experience and better payed, for BE. This is another crucial aspect of BE/FE devs division.

Now, to answer to your question:

> But... This is FE development, you think the backend devs would like to be writing this?

We (BE devs) had done that for years. But now we'll fight hard against going back to full-stack, but only for our advantage: in this way, we can get treated way better and get payed way more.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: