As a software developer of 15 years, I love writing declarative stuff, but imperative is almost always objectively better if working on a larger codebase, especially when doing so with multiple people. I remember in high school having my brain explode when I was told during math that I should not feel like there was limited space, and that I could always just grab a new piece of paper; more lines isn't inherently worse. Showing your steps and having everything be self-explanatory is more important 9/10 times.
Mannn! It's like a breathe of fresh air. How can I learn more on declarative php? What are the best practices I should follow? I'm reading Adam Wathan's "Refactoring to Collections" book and trying to implement achieved knowledge in my code. But furthermore, what else books I can read?
Nice. It's quite strange for me in Laravel, that almost everything is accessible from static methods. I'm so used to load everything as DI (symfony). It's for me more visible and more self explaining then (that we can browse direct source from the constructor).
A better way to classify something as declarative, is identifiyng if it's side effect free, because it describes a computation, and this computation can be executed without considering the context or order (in other words being composable), because it relies only in itself. Using this definition, the wrapping PDO example isn't declarative, because it causes a side effect, the declarative solution in this case is using something like an IO monad from Haskell, that let's you compose the computations and lazy execute the side effects. Besides this disclaimer, this example continues to bring an good abstraction. the video implies that the fluent interface pattern is equivalent to declarative programming, but as explained previously, if it causes a side effect, the use o fluent interface isn't declarative. That said the laravel helpers example is declarative in both of the examples, because the "imperative example" don't cause any side effect in his execution and all the function calls could be composed in one unique computation before the execution.
No, FP is a paradigm inside the group of declarative programming paradigms like procedural programming is a paradigm inside the group of imperative programming paradigms
As a software developer of 15 years, I love writing declarative stuff, but imperative is almost always objectively better if working on a larger codebase, especially when doing so with multiple people. I remember in high school having my brain explode when I was told during math that I should not feel like there was limited space, and that I could always just grab a new piece of paper; more lines isn't inherently worse. Showing your steps and having everything be self-explanatory is more important 9/10 times.
You're a really good teacher. Very clear, great pace and to the point. Keep up the great work!
Very informative. Thank you
Amazing!
Thank you! Cheers!
Please do more videos like this
Nice video. Subbed. Video idea: show writing some helper functions to make custom code more declarative.
Inspiring!
Mannn! It's like a breathe of fresh air.
How can I learn more on declarative php? What are the best practices I should follow?
I'm reading Adam Wathan's "Refactoring to Collections" book and trying to implement achieved knowledge in my code. But furthermore, what else books I can read?
Good stuff!
Nice. It's quite strange for me in Laravel, that almost everything is accessible from static methods. I'm so used to load everything as DI (symfony). It's for me more visible and more self explaining then (that we can browse direct source from the constructor).
A better way to classify something as declarative, is identifiyng if it's side effect free, because it describes a computation, and this computation can be executed without considering the context or order (in other words being composable), because it relies only in itself.
Using this definition, the wrapping PDO example isn't declarative, because it causes a side effect, the declarative solution in this case is using something like an IO monad from Haskell, that let's you compose the computations and lazy execute the side effects. Besides this disclaimer, this example continues to bring an good abstraction.
the video implies that the fluent interface pattern is equivalent to declarative programming, but as explained previously, if it causes a side effect, the use o fluent interface isn't declarative. That said the laravel helpers example is declarative in both of the examples, because the "imperative example" don't cause any side effect in his execution and all the function calls could be composed in one unique computation before the execution.
So, use what php or a framework/library provides, or use a value object with the right behaviors and chain them together?
I've never seen someone use `print` instead of `echo` before!
Basically it's just creating abstractions to make the code more readable, right?
what is ide name
Looks pretty much like VS Code
show how to build a site from scratch with php
PHP 🤢
"Look mom, I'm on the PHP hate train!"
Dude, its 2022. PHP is still viable.
Very interesting indeed!
Simply explained really like your videos 🎉
Functional programming is also called declarative programming. I am right?
No, FP is a paradigm inside the group of declarative programming paradigms like procedural programming is a paradigm inside the group of imperative programming paradigms
@@lucasayabe Ah, so many paradigms. Thanks for your clarification.