Writing less code with higher-order functions
One of the main tasks every programmer should master is dealing with data. Our apps receive data from a source, be it a web service or some local database, and then we transform that data into user interfaces where we can collect more information and then send it back to the source. There is even an acronym for this—Create, Read, Update, and Delete (CRUD).
Throughout your life as a programmer, you will spend a lot of your time writing data manipulation code. It doesn’t matter if you are working with 3D graphics or training machine learning models—dealing with data will consume a good part of your life as a developer.
In Dart, higher-order functions are functions that take one or more functions as their arguments, or return a function. These provide a powerful tool to manipulate data because they allow you to write reusable and modular code that can be easily adapted to different scenarios. Higher-order functions...