3 ms·
I don't understand the point of saying something like: > "I show how to build a modern C++ high-performance, asynchronous echo server that can be written with
by SeanDav 11y ago
I don't understand the point of saying something like:
> "I show how to build a modern C++ high-performance, asynchronous echo server that can be written with just 48 lines of code."
The fact that it is 48 lines of code is almost meaningless. If the framework was a different design it could be done in 1 line of C++ code or 1 line of COBOL. Given the right library/framework, any application can be done with 1 line of code (taking a bit of poetic licence here, but hopefully you see my point).
As a discussion about using Wangle in C++, the article has far more merit.
Perhaps I am just being overly pedantic.
- ape4 11y agoI agree. Especially because this sort of code seems to be the whole purpose of this framework. I would expect it to take fewer LOC.
- BinaryIdiot 11y ago> The fact that it is 48 lines of code is almost meaningless. If the framework was a different design it could be done in 1 line of C++ code or 1 line of COBOL. Given the right library/framework, any application can be done with 1 line of code (taking a bit of poetic licence here, but hopefully you see my point). I think it's fine to state that; are you ever going to write C++ code with zero included libraries? Probably not. If you write some string manipulation code and you boast that you did it in 10 lines are you going to count it against them that they included std::string? I think saying how many lines of code it took, using the Wrangle framework, shows that it can be powerful and easy to use versus many of the libraries you end up seeing in C++.
- mentos 11y agoIf those frameworks/libraries are battle tested and not one off solutions for the project then I do think it has merit. Imagine building an overpass out of 3 prefabricated concrete pieces; two columns that serve as the base pedestals and 1 beam that spans them. The 48 lines of glue code to me are the nuts and bolts used to tie the pieces together. If the nuts and bolts are structurally sound then I would say our overpass has merit..?
- deleted 11y ago[deleted]
- userbinator 11y agoI'm far more interested in what those 48 lines of source actually compiles to, or how much framework code is involved. I've found that the more of the latter there is, the more difficult debugging tends to be.
- such_a_casual 11y agoI agree that a more fitting line would have been, "I show how to build a modern C++ high-performance, asynchronous echo server using Facebook's Wangle (which comes out to be only 48 lines of code). However the TITLE OF THE ARTICLE is "Writing modern C++ servers using Wangle." Furthermore, the author states that he's using that framework almost immediately after the statement you quoted, so I really see nothing to complain about. It would be more of an issue if the author led with a huge introductory paragraph or click-baity title that failed to mention the library she or he is using. Knowing how many lines it took for the author to implement the server in the Wangle framework is very relevant to the reader.
- ofrobots 11y ago> 1 line of COBOL Offtopic, but this would be quite a challenge.
- hnbro 11y agoit may not be an information-dense sentence, but it is merely a single sentence. one which you've isolated from it's context.
- SeanDav 11y agoIt is the direct TL;DR quote from the Author himself, given prominence with blank line separators, italics, bold prefix and located near the very start of the article, so hardly out of context.
- imh 11y ago48 lines is totally relevant. If I'm coming into the article and thinking, "Oh god, C++? This is going to be a mess," then seeing that it's only 48 lines is a great hook.
- cbsmith 11y ago> The fact that it is 48 lines of code is almost meaningless. If the framework was a different design it could be done in 1 line of C++ code or 1 line of COBOL. Yes, you can optimize it to whatever, but the point of mentioning that it is only a small number lines, it informs the reader they aren't going to get lost in a tone of code.