Oh, hello there.
Here's the thing – it is quite challenging to write lengthy articles about complicated topics on a blog frequently,
but I still want to follow one of the best, or even the best way to learn things – by writing some kind of blog or journal with reflections on the learning process.
By the way, this is how US pilots train from cadets to professional fighter pilots in just 12 months – writing reflections in a journal on a daily basis is a mandatory requirement for them.
Thus, I will try to write at least something here regularly, even if it won't be much or may sound simple – it's better than nothing 🙂
Here's the thing – it is quite challenging to write lengthy articles about complicated topics on a blog frequently,
but I still want to follow one of the best, or even the best way to learn things – by writing some kind of blog or journal with reflections on the learning process.
By the way, this is how US pilots train from cadets to professional fighter pilots in just 12 months – writing reflections in a journal on a daily basis is a mandatory requirement for them.
Thus, I will try to write at least something here regularly, even if it won't be much or may sound simple – it's better than nothing 🙂
🔥3
Иван Закутний про pinned «Oh, hello there. Here's the thing – it is quite challenging to write lengthy articles about complicated topics on a blog frequently, but I still want to follow one of the best, or even the best way to learn things – by writing some kind of blog or journal…»
So, basically, now I'm studying a theoretical course about the fundamental concepts of Functional Programming.
In a few next days, I'll be sharing this knowledge with you.
First things first, and the first thing today is 'First-Class Citizen.' T
his is a characteristic of objects.
This concept applies to functions (yes, functions are indeed objects).
But what the heck are First-Class Citizen functions?
This means that such a function can:
- Be assigned to a variable
- Be passed as an argument to some other function
- Be returned as a return value from another function
- Be stored in data structures, such as a list, array, etc.
Freaking awesome, isn't it?🤨
First-Class Citizen functions can be very handy in capable hands.
Just imagine how beautiful and reusable, yet completely incomprehensible and ugly your code could become with them (If hands are not capable)🤣
A pretty simple example of such a function:
In a few next days, I'll be sharing this knowledge with you.
First things first, and the first thing today is 'First-Class Citizen.' T
his is a characteristic of objects.
This concept applies to functions (yes, functions are indeed objects).
But what the heck are First-Class Citizen functions?
This means that such a function can:
- Be assigned to a variable
- Be passed as an argument to some other function
- Be returned as a return value from another function
- Be stored in data structures, such as a list, array, etc.
Freaking awesome, isn't it?
First-Class Citizen functions can be very handy in capable hands.
Just imagine how beautiful and reusable, yet completely incomprehensible and ugly your code could become with them (If hands are not capable)
A pretty simple example of such a function:
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
Type hints here are pretty strict here. Keep in mind that in the real world, such functions will probably be more generic.
Of course, we can create more sophisticated things like map, reduce, filter functions, and beloved closures, but we won't cover them today.
Here's another example:
Of course, we can create more sophisticated things like map, reduce, filter functions, and beloved closures, but we won't cover them today.
Here's another example: