DEV Community

Discussion on: Code smart, not hard

Collapse
 
zimski profile image
CHADDA Chakib

It's hard to maintain (react + react router + redux ) in the front and an APi in the backend.

For me, coding smart is use the old mvc pattern for the big shape and only react-like for some specialized components where we need a snapy UI

Collapse
 
leob profile image
leob • Edited

Don't think I agree, the traditional web programming model (server side generated pages, no separation between backend and frontend) had a lot of drawbacks (look at the mess that you can easily get when you start to use AJAX, jQuery and so on).

The new "API + SPA" model (which is quickly becoming the norm or default when developing apps) has a much more simple and logical mental model, and a more sound architecture (by separating backend and frontend).

I do agree that with the API/SPA model you sometimes have more "boilerplate", but it's a programming model which 'scales', and which allows you to build more advanced apps/UIs, while keeping things structured and manageable.

Collapse
 
jaakidup profile image
Jaaki

You know something, I’ve been thinking the same thing. After doing a few PWAs and realizing that it is indeed much more complicated, more parts, more potential problems, the old fashioned MVC is looking quite simple.

But it does depend on the situation though.

Collapse
 
zimski profile image
CHADDA Chakib

Yeah !, also the team's size should drive our stack, if we are small team, we should make it simple (simple to code, simple to test, simple to maintain).

A very nice video from Stephenson explaining very well this point youtube.com/watch?v=SWEts0rlezA

I am sorry to @Miklos Bertalan, all my comments are more related to the title of your port than the content ˆ, btw great tips :)

Collapse
 
solkimicreb profile image
Miklos Bertalan

What tools do you use for the MVC pattern? Just plain DOM and JS?

Collapse
 
zimski profile image
CHADDA Chakib

I use rails for the regular parts like loging and forms, react for isolated components when I need real-time or a intensive Ui.

To test everything, I use system test, to test my react components and it's interactions with rails.

I think it's a nice spot, This make me a lot more productive.