A visual guide to why DECLARATIVE code is better

preview_player
Показать описание

The programming opinion that I am most zealous about is that declarative code is better than imperative code, at least in the context of orchestrating data flows in front end applications.

Explaining why in code can be difficult because the most important aspects get lost to less important details like syntax and lines of code differences. This video focuses on explaining the benefit of declarative code in a visual and more abstract way.

0:00 Imperative vs Declarative
2:00 Visualising the difference
5:33 Complex visualisation

#angular #declarative #imperative

Рекомендации по теме
Комментарии
Автор

A simple code to understand it better would be great.

gcancino
Автор

Love this video as a visual learner, please make more videos like this! It really helps visual learner like me to understand and learn so much better.

itzmeys
Автор

Hi Joshua, you do not know how much I've been struggling to understand what are both of them, this video really resolved my confusion. I thank you with respect and love from the bottom of my heart❤

vivmaniaa
Автор

I think easiest explanation is… have you ever worked with a large excel workbook? Yes? Typically there’s a main tab with variable values defined. Update those variables and then the rest of the workbook is updated accordingly everywhere else. It’s the same thing with frontend code.

wahoobeans
Автор

Kudos to your grate efforts for Angular community....

jaypatel-dtbw
Автор

That's a cool representation of those concepts. People are so afraid of curry/pipe functions they just never attempt to use it, maybe your next diagrams could explain this process the functions go through.

shaylevinzon
Автор

totally on your side when it comes to declarative vs imperative code.
looking back at the past I would even say that an imperative approach is much more prone to errors than a declarative one. In my current project, I have had the experience that a more declarative approach just forces the developer more to think about error states ahead of time in comparison to an imperative implementation which overall resulted in a more robust implementation

jeffnikelson
Автор

Although I am completely on your side in this matter, the explanation is very abstract, understandable mostly to those who already use it. I don't understand how this video will encourage a user of the imperative approach to try to apply the declarative approach without some code example.

iligol
Автор

Awesome vid and explanation. It drives me nuts seeing the type of code that you describe as imperative, for exactly the reasons you describe. I think there is a lack of resources showing/teaching people alternatives.

brnto
Автор

what are the difference between reactivity and declarative?

MrDrogoyonk
Автор

I think the title should add "in front-end designs" at the end for clarity.

caleblo
Автор

Fighting the fight in a large enterprise app. the real pain I find is when the 2 approaches meet 🤢. For example a non serializable class going into an ngrx store, and things being mutated sometimes despite being in a store. the app was originally written in angular 2, so it's easy to see how it's happened. but now it's my job to unf**k it 😅.

I could still see value in imperative to knock out an admin portal quickly for example. but once you go reactive/declarative you never go back.

adamlawrence
Автор

For such bold remarks, presenting with boxes is quite biased

motbus
Автор

this is what i have to read in the actual project im working 😭 is a big codebase and the client do not want to give us the total codebase to be able to implement new modules that they pay us to do 🙃

zero
Автор

Maybe people tend to do imperative code, because declarative code forces you to consider most of the links in your code upfront.

Imperative at first glance makes you feel like there's less links, so while you're writing it feels easier but the reality is you will have to do the work of linking your code over and over again when you read it.

TayambaMwanza
Автор

animations are out of this world, can anyone tell me wt kind of tool or software was used?

KatJay-iy
visit shbcf.ru