What a great way to teach. I love how you didn't over complicate the code to satisfy an ego. there is so much of that on youtube these days, and this was one of the best tutorials because learned exactly what you were trying to teach instead of having to search for another video to work through what you said. Also the 2 solutions were greatand they were simple and fast to grasp as i didnt have to spend a long time trying to read pause read pause (when something is complex its a pain to study and i think this was a perfect solution) Great video and I'm definately a new subscriber and im looking forward to learning more from you ! 100% a great resource!
Doesn't this just mean that Declarative programming uses pre-built imperative functions that do exactly what you want. For example, if there was no method .where() for arrays, then you wouldn't have been able to do this declaratively. Or if you look under the hood at the .where() method's implementation, it would eventually lead to some imperative code, no? It's not much different than me writing a useful utils module that has useful functions in it that I wrote?
Exactly. I'm not criticizing the lesson because it's still useful, but this implementation of declarative vs imperative is more one of philosophy. Even in using a built-in function he's still telling it how to do it. A truly declarative solution can only be built on top of a lower layer of imperative. It's not magic. Someone still has to write the code that tells the computer what to do. Declarative makes more sense in reference to a toolset where you don't have to write the implementation code yourself: like a Terraform configuration to build infrastructure.
@@naveenbharadwaj5059 No, it's not like that. Declarative means you only tell it WHAT you want and not HOW to do it. This example still tells you HOW to do it. I think of declarative as a config file. You never tell an application HOW to do something in a config file, you only tell it WHAT you want the state to be: like LOGGING=TRUE. When you tell the config LOGGING=TRUE you in no way tell the app how to log. You're simply declaring that you want logging to be on. You're declaring the desired state. Declarative lives above the layer of Imperative much like TCP lives above the layer of IP.
Great explanation!!! I just subscribed to your channel. I am a new dev who will be creating content to help other new develops and love connecting with others. Thank you again for such a clear, simple, and powerful explanation of IP vs DP.
You still have the write the imperative function, which is really the declarative version. The imperative function just adds another layer of abstraction.
what a helpful explanation🙏🙏 as a beginner that is all what I needed ... other channels kept talking about functions and methods that I've never heard of trying to explain what now feels SO clear compared to the things they're talking about thank you so much 🤍🤍🤍
The declarative is telling you the end goal. You go do whatever you want to do, you just have to obtain the target. If changes happen in the meanwhile, adjust yourself accordingly, you only have to get to the end goal by any means necessary. Imperative actually commands you and forces you on what the exact steps should be. It’s not only the end goal that matters, but all of the steps in between are as important. You must do it in exactly that way, and that way only. If it’s detailed enough, it will instruct you beforehand how to respond to each individual problem that will/might arise.
Yea when you get deep into it, the line between imperative and declarative isn’t that clear. It’s tough but hopefully gives you a bit of an understanding
SO would you call imperative a lower level programming, and declarative a higher level as it's abstracted on top and you don't have to specify as much? Someone tell me if I'm kinda on track or not?
So, declarative way just tell what it wants and transfers the responsibility of performing how to library/compiler under the hood, just like "DECLARATIVE " SQL queries gets the job done by triggering "DB engine methods" under the hood??
what is the ide you use ? because i like the fact parentheses group are in different colors, we identifies groups much faster (and without put the mousse on the parentheses)^^
This is the 5th video I've watched on this topic and honestly I still think this is meaningless distinction. Declarative code, like you example, is a short hand why of writing imperative code... but unless someone has already written that declarative function for you, you'd still need to go and write some imperative code and wrap in a function or method... and this is obviously fine but this is just basic good coding practice, no? You encapsulate and abstract away code you need to repeat often. I just don't get why we need this distinction.
I was driving and this video of yours was chosen to be played by the Gods in TH-cam. 3 minutes later, once I finished hearing this, I controlled my urge and slowly pulled my car to safe place to type this comment. This is a horrible way to explain something simple. You are a bad teacher. You might be a great engineer. This video was bad. Sorry.
Imperative - I'll do it myself.
Declarative - please do it for me.
Is that what you're trying to say
This is the most succinct and easy to understand explainer video on declarative programming. Thank you!
Thank you! That means a lot 😊
What a great way to teach. I love how you didn't over complicate the code to satisfy an ego. there is so much of that on youtube these days, and this was one of the best tutorials because learned exactly what you were trying to teach instead of having to search for another video to work through what you said. Also the 2 solutions were greatand they were simple and fast to grasp as i didnt have to spend a long time trying to read pause read pause (when something is complex its a pain to study and i think this was a perfect solution) Great video and I'm definately a new subscriber and im looking forward to learning more from you ! 100% a great resource!
That’s one of the nicest comments I’ve gotten. Thank you so much, that means a lot 😊
can I say
Imperative: is putting actions together to achieve what you want.
and
Declarative: is exactly imperative PLUS giving a name to it
Doesn't this just mean that Declarative programming uses pre-built imperative functions that do exactly what you want.
For example, if there was no method .where() for arrays, then you wouldn't have been able to do this declaratively. Or if you look under the hood at the .where() method's implementation, it would eventually lead to some imperative code, no?
It's not much different than me writing a useful utils module that has useful functions in it that I wrote?
Exactly. I'm not criticizing the lesson because it's still useful, but this implementation of declarative vs imperative is more one of philosophy. Even in using a built-in function he's still telling it how to do it. A truly declarative solution can only be built on top of a lower layer of imperative. It's not magic. Someone still has to write the code that tells the computer what to do. Declarative makes more sense in reference to a toolset where you don't have to write the implementation code yourself: like a Terraform configuration to build infrastructure.
@@patrickmacdonald8126 So declarative is the subset of imperative ?
@@naveenbharadwaj5059 No, it's not like that. Declarative means you only tell it WHAT you want and not HOW to do it. This example still tells you HOW to do it. I think of declarative as a config file. You never tell an application HOW to do something in a config file, you only tell it WHAT you want the state to be: like LOGGING=TRUE. When you tell the config LOGGING=TRUE you in no way tell the app how to log. You're simply declaring that you want logging to be on. You're declaring the desired state. Declarative lives above the layer of Imperative much like TCP lives above the layer of IP.
@@patrickmacdonald8126 thank you 👍🏻
Thank you very much for this PERFECT and yet short explanation.
Really appreciate it :)
Great explanation!!! I just subscribed to your channel. I am a new dev who will be creating content to help other new develops and love connecting with others. Thank you again for such a clear, simple, and powerful explanation of IP vs DP.
You still have the write the imperative function, which is really the declarative version. The imperative function just adds another layer of abstraction.
Dude, it's the other way around. Declarative code is abstracted from imperative code.
Good video! I actually never heard of imperative and Declarative programming, but if it ever shows up in one of my classes, I wont be lost.
Glad I could help 😊
Thanks for real-time example. it helped me to understand the difference.
what a helpful explanation🙏🙏 as a beginner that is all what I needed ... other channels kept talking about functions and methods that I've never heard of trying to explain what now feels SO clear compared to the things they're talking about thank you so much 🤍🤍🤍
The declarative is telling you the end goal. You go do whatever you want to do, you just have to obtain the target. If changes happen in the meanwhile, adjust yourself accordingly, you only have to get to the end goal by any means necessary.
Imperative actually commands you and forces you on what the exact steps should be. It’s not only the end goal that matters, but all of the steps in between are as important. You must do it in exactly that way, and that way only. If it’s detailed enough, it will instruct you beforehand how to respond to each individual problem that will/might arise.
Nice..
@@yp5387 thank you :)
Thank you so much for the sake of simplicity you brought into this explanation.
So basically write very small imperative solutions that exactly do only one specific thing and chain it together when needed in a declarative manner.
Merry christmas 🎄 may your 2021 plan execute well
Thank you 😊
Imperative: do it yourself
Declarative: somebody has done it already, use it imperatively!
Imperative: Focuses on the process
Declarative: Focuses on the result
It's still a bit unclear for me, but this does give me an image on the differences between the two styles. Awesome video!
Yea when you get deep into it, the line between imperative and declarative isn’t that clear. It’s tough but hopefully gives you a bit of an understanding
Declarative: I read docs
Imperative: I don't like docs
Very simple... :)))
Thanks Tadas 🔥
Thanks for watching 😊
Very nice explanation. Congrats!
Oh! Helpful! Thank you!
Thank you for your videos ! very good explaintion
Thank you for watching 😊
Nice video brother. Also, 10K soon 🥳
Thank you Nirbhay ❤️
Love the small video!
Thank you very much, well done job, I like your explanation
as a lua programmer it just looks like imperative is another way to say "I don't know how to use this programming language efficiently"
I really like that your exanples are in Dart.
SO would you call imperative a lower level programming, and declarative a higher level as it's abstracted on top and you don't have to specify as much? Someone tell me if I'm kinda on track or not?
Not necessarily. Although lower level languages are more imperative, correlation does not mean causation.
So, declarative way just tell what it wants and transfers the responsibility of performing how to library/compiler under the hood, just like "DECLARATIVE " SQL queries gets the job done by triggering "DB engine methods" under the hood??
what is the ide you use ? because i like the fact parentheses group are in different colors, we identifies groups much faster (and without put the mousse on the parentheses)^^
It's VSCode, the pathentheses is an extension called Bracket Pair Colorizer or something like that
Kinda clear lol Merry Christmas!
It’s still hard to really grasp where the line starts and ends. But it’s the general gist of it
Nice one!
thankyou, but still confused 😐
Didn't see any state at the end solution
so use built-in function is declarative
First! Yay! And merry Christmas!
Merry Christmas to you too 😊
Local variables in declarative rule 😊
yikes, what a nice video, straight to the point
Nice video!
Is declarative or imperative programming more performant?
Would you prefer Vue or Dart in relation to the performance of a website?
So... the moral of the story is that I am an imperative programmer...
Better than my teacher could ever explain 😂🤦♂️
Haha glad to hear that 😊
@@tadaspetra waiting for next🔥
Thanks, but i wish you had a few more examples.
I wanted to ask about that color scheme of your vscode for a long time. Let me be declarative *What* is the name of that color scheme?
Oh it's pitch black theme, nevermind, found It from your other videos.
Haha yep it’s pitch black 😊
YUH YUH YUH IMPERATIVE AND DECLARATIVE PROGRAMMING YUH!!
Is this Dart?
Yes it is 😊
nice
This is the 5th video I've watched on this topic and honestly I still think this is meaningless distinction.
Declarative code, like you example, is a short hand why of writing imperative code... but unless someone has already written that declarative function for you, you'd still need to go and write some imperative code and wrap in a function or method... and this is obviously fine but this is just basic good coding practice, no? You encapsulate and abstract away code you need to repeat often.
I just don't get why we need this distinction.
I didn’t really understand the difference
okay +1 subsriber.
I was driving and this video of yours was chosen to be played by the Gods in TH-cam.
3 minutes later, once I finished hearing this, I controlled my urge and slowly pulled my car to safe place to type this comment.
This is a horrible way to explain something simple. You are a bad teacher. You might be a great engineer. This video was bad.
Sorry.
Lol! this is hilarious XD