четверг, 13 сентября 2018 г.

[prog.flame] Beast-vs-RESTinio or is Boost.Beast really good for solving simple tasks?

It seems that after inclusion of Beast C++ framework in Boost the Boost.Beast is regarded as the only right way to work with HTTP in modern C++. Maybe it is because some C++ developers know only Boost and look for libraries in Boost only. Some even don't know that there is something else except Boost.Beast (like CROW, Pistache, RestBed, served, C++REST SDK, POCO and so on).

And there also is a strong opinion that any library from Boost is the best in its class. For some Boost libraries it is just true. But now Boost has more than 100 libraries inside. It is hard to belive that all of them are exceptionaly useful, easy to use, well documented and maintained well...

Boost.Beast looks like a high-quality library. It just a bright example of C++ masterpiece. But there is a problem: it is too low-level. If you need to solve a simple task you have to write a lot of code on top of Boost.Beast.

To show this we reimplemented a simple example from Vinnie Falco's (he is Beast's author) talk at CppCon-2018 (code and slides can be found here) by using RESTinio library.

The repository with our implementation can be found here: https://bitbucket.org/sobjectizerteam/beast-cppcon2018-vs-restinio

We think that Boost.Beast is a great building block for something really complex (like high-performant HTTP server or client) or for something high-level and user-friendly (like that). But if you have to create a simple RESTful API or simple HTTP-service then it is better to look for something more simple and expressive. We hope our code shows this.

Комментариев нет: