filmov
tv
CppCon 2015: Michał Dominiak “Applying functional programming in code design'
Показать описание
—
—
At first glance C++ doesn't seem to be a language that lets you do much functional programming, not to mention actually focusing the structure of your application around that. But that is changing, together with the general approach to program in the language. We do care about const-correctness; when writing code meant to run concurrently, we want to avoid locks, so we do our best not to share mutable state (I'm here to argue that uniquely owned mutable state is perfectly fine). With that mindset, we can try to design our applications in a functional way.
This talk will focus not only on things typically associated with functional programming, but also on the following in the context of C++: * Making functions pure (as long as it makes sense). * Using functional data structures. * Designing control flows that don't lead to shared state. * Composability and benefiting from laziness. * Striving for generic code. * Noticing patterns and turning them into abstractions. * Functors and monads as "patterns". * An example application built around those principles.
—
Computer Science student at Faculty of Electronics at Wrocław University of Technology. Loves metaprogramming and doing as much as possible during compile time, instead of wasting precious cycles at runtime.
—
*-----*
*--*
*-----*
—
At first glance C++ doesn't seem to be a language that lets you do much functional programming, not to mention actually focusing the structure of your application around that. But that is changing, together with the general approach to program in the language. We do care about const-correctness; when writing code meant to run concurrently, we want to avoid locks, so we do our best not to share mutable state (I'm here to argue that uniquely owned mutable state is perfectly fine). With that mindset, we can try to design our applications in a functional way.
This talk will focus not only on things typically associated with functional programming, but also on the following in the context of C++: * Making functions pure (as long as it makes sense). * Using functional data structures. * Designing control flows that don't lead to shared state. * Composability and benefiting from laziness. * Striving for generic code. * Noticing patterns and turning them into abstractions. * Functors and monads as "patterns". * An example application built around those principles.
—
Computer Science student at Faculty of Electronics at Wrocław University of Technology. Loves metaprogramming and doing as much as possible during compile time, instead of wasting precious cycles at runtime.
—
*-----*
*--*
*-----*
Комментарии