Hacker News new | ask | show | jobs
by dfghdfhs 1624 days ago
Wouldn't it be better to have in the title _what_ the library is supposed to achieve, as opposed to who published it?

Right now the title reads essentially: "Here's a library".

8 comments

It's worse than that. The GitHub title is "Folly: Facebook Open-source Library". The bolded sentence in the readme is "Folly contains a variety of core library components used extensively at Facebook". In fact, the entire first paragraph is about how it's used at Facebook.

It takes about a minute to find any information at all about this library besides the fact that it's used at Facebook (by the way, did you miss that? it's used at Facebook! Facebook!!). And even that information is empty bromides about how it's "designed with practicality and efficiency in mind". Hmm, I prefer my software to be impractical and inefficient...

All I take away from this is that Facebook has an irrationally optimistic expectation of how the world views its engineering prowess.

People are so grouchy over even mildly ambiguous titles.

Right in the intro section, second paragraph, it says "It complements (as opposed to competing against) offerings such as Boost and of course std". Come on, what more do people want?

Rule one is don't waste people's time. Waiting until the second paragraph to get to the point violates that rule. And that's assuming your reader knows what boost or std are.
Virtually everyone who uses C++ knows what Boost and std are.
I would say most people who are writing C++ professionally should known what folly (and abseil from Google) is.
Missing the most important part: avoid them (including boost), when you have a choice.

Professionals often don't have that choice. Cue many thousands of comments on HN why working in c++ sucks.

Um... what? Why should I have any knowledge of some kitchen sink library at Facebook just because I write C++ elsewhere? (hypothetically speaking)
Perfect. Put that in your title. Or at least in the first sentence of your description. Not paragraph 2.
I haven't touched C++ since first year university and even I know what boost and std are.
People want an article in a headline, it's ridiculous frankly. Take the extra 3 seconds to scan the page.
>> And even that information is empty bromides about how it's "designed with practicality and efficiency in mind". Hmm, I prefer my software to be impractical and inefficient...

the opposite from practical is general. for example is std not practical but general. Its api is not optimized for 95% of the use cases but rather so that everything is possible and equaly verbose.

the opposite of efficient can for example be trade of for readability, portability and cost (as in development time).

For me as a possible user of the lib i found this information critical. I write always similar info in the readme for my libraries.

> the opposite from practical is general

No, it's certainly not at all. Those are completely unrelated spectrums. Something can easily be practical and general, or impractical and specific.

> the opposite of efficient can for example be trade off for [...]

And if they stated what trade-offs they made, then that paragraph would actually start to say something useful. Unfortunately, they don't.

Also, if you're developing documentation for libraries, I really would recommend finding a better source of inspiration. Take Redis, in the very first paragraph:

> What this means is that Redis provides access to mutable data structures via a set of commands, which are sent using a server-client model with TCP sockets and a simple protocol. So different processes can query and modify the same data structures in a shared way.

That's all you need to do: before anything else, tell the user what the thing does. Then you can give some basic details about implementation: "written in Go", "runs on Linux & macOS", "uses GC, so not suitable for RT applications", etc. After that you can get into trade-offs, real narrow implementation details, setup, handwaving abstract adjectives, etc. But lead with what the hell it actually does.

> the opposite from practical is general.

Let me guess: English is not your native language, right?

Instead of pointing a finger at Facebook, I'd scoff at C++ and the way in which the language has grown where orgs build up their own utility libraries rather than depend on a standard library.

That said, this is an issue for other languages as well. Another example: the "Google core libraries for Java": https://github.com/google/guava

But why is that an issue at all ? Having boost and other utilities is great. And since it's all templates there's in practice in your binary no added cost if you're using folly::foo or std::foo or boost::foo, you can pick and choose the exact data structures that allow exactly what you want (or write your own if you think that you can do a few percent better than folly of abseil in your specific use case).

If I was using java or python I'd definitely not use the standard things most of the time either because it's more than likely that there's a more efficient way in some other library, and because my main paycheck comes from "can you make this as fast as technically possible given this average consumer hardware"-problems

interesting case in point. i just learned today that std::variant and boost::variant differ in their:

   1. exception-safety guarantees
   2. real-time safety
2 is caused by 1, because to be exception safe requires a heap allocation, and that's not RT-safe.

Who would want to work in a language where you could not make these choices?

Boost even has variant2 which comes with another set of design tradeoffs
When does std::variant allocate?
boost::variant will allocate to save state during construction of a new value type, in order to be able to roll back if the constructor throws an exception.

std::variant does not do this.

> I'd scoff at C++ and the way in which the language has grown where orgs build up their own utility libraries rather than depend on a standard library.

This comment makes no sense at all. I mean, would it make any sense to also criticize JavaScript/NodeJS for their relatively spartan standard modules and extensive use of vended modules from the likes of npm?

And have we learned nothing from the mistake of going with the "everything and the kitchen sink" that is java which failed to actually satisfy basic needs and resulted in projects like guava and apache commons and vavr stepping in to provide alternatives? And how about C's infamous standard library with it's security vulnerability-inducing standard functions which remain in the standard?

Perhaps we should learn lessons and avoid basic mistakes such as setting libraries in stone. C++ learned that lesson, and so did C#/.NET, and up to a point Rust. Why unlearn them?

> would it make any sense to also criticize JavaScript/NodeJS for their relatively spartan standard modules and extensive use of vended modules from the likes of npm?

Uh .. Yes? Yes, very much so.

Instead of pointing the finger at C++, I'd scoff at any language that promotes the belief that a standard library could possibly meet all the needs of a project.
You mean because it has gotten so unreadable and vast?

I've never worked with a place using C++ that didn't make their own core libraries. As a low-level language, there's almost always a way to get some performance benefit by starting from scratch for your specific case.

I've also never worked in a C++ place that didn't make their own core libraries, but when you ask, their rationale for building and maintaining their own libraries (as opposed to using the Standard Library) is often very weak. It's usually based on very outdated assumptions and Cargo Cutting, such as "the STL[1] is slow (but we haven't profiled ours to prove it's faster)." Or "We need our own string type because decades ago, there was something that std::string didn't do." Or "Our founding developer didn't like templates, so he build this vast copy of the standard library but using explicit data types."

(yes I've heard all of these "reasons")

1: Just calling it "the STL" is a key sign of living in the past--pretty much nobody uses the actual STL anymore: What we use is called the C++ Standard Library.

> pretty much nobody uses the actual STL anymore: What we use is called the C++ Standard Library.

I won't deny your prior, but my prior is that people who complain about the use of the word "STL" to mean "C++ Standard Library" (and ignore that the latter is 10 times as many keystrokes) do so only to flaunt their knowledge, not because anyone actually experiences confusion nowadays.

Supporting evidence: https://github.com/microsoft/STL

To me, the STL is specifically Stepanov's idea for how to do generic programming in C++ in the early 1990s, and so it makes sense to distinguish the STL from unrelated stuff that happens to be in the C++ Standard Library.

For example iostream isn't part of Stepanov's idea, Stroustrup created that bundle of craziness in the 1980s and today it's part of the Standard Library, but it was not part of STL which only came into existence in the 1990s (although Stepanov's ideas about generic programming are older).

Often these libraries exist as glue to an existing ecosystem. To that end, I have also seen portability libraries that provide a single interface to multiple implementations of system functions or datatypes on different operating systems.
Why? Having millions of libraries is a good dilemma to have, even if it means a bunch don't work well together so you make your own anyway. Better than having no choice.

C++ is a massive beast but it works.

https://github.com/facebook/folly/blob/main/folly/docs/Overv...

This has library contents: it’s a mix of various utilities - type conversion, data structures, memory management, random numbers, concurrency, etc.

I agree, but HN policy is to use the title from the link verbatim and IME even slight editorializing to provide context tends to get reverted by the moderators
It's a kitchen-sink library, like Abseil. It does too many different things to state succinctly.
Looks like that's because the library isn't for anything specific, other than general C++ programming at Facebook. They might worded it a bit better, like "core library" or common library" or something.
The docs have a bit more detail about what is included:

https://github.com/facebook/folly/blob/main/folly/docs/Overv...

I thought the same, then read the actual page and realized it's Just A Library. Of Stuff. Like it could be called fbutil.
For me it sounds like an argument of authority.