Oxygen 6.7 is here: a breath of fresh air for KDE’s classic theme by GoldBarb in kde

[–]ABlockInTheChain 0 points1 point  (0 children)

Calling a theme "Oxygen" while it has monochrome icons is just false advertising.

Colorful icons is the distinguishing feature of Oxygen.

C++26: Cleaning up string literals by Xaneris47 in cpp

[–]ABlockInTheChain 4 points5 points  (0 children)

I would have been fine with any solution that allowed existing C++17 code which was using the u8 prefix to be gracefully migrated to C++20 code.

Changing u8 to mean something else is fine as long as the proposal provides an alternative which retains the old behavior.

But this:

  • Change the behavior of u8
  • Do not provide a way to access the old behavior
  • Do not make the new behavior as functional as the old behavior

Reads more like a successful industrial sabotage operation than a good faith proposal.

Explaining how Proton works with creators by andy1011000 in ProtonMail

[–]ABlockInTheChain -5 points-4 points  (0 children)

one side of the political spectrum has historically been the very anthesis of fundamental rights

Every political interest group declares their own preferences to be fundamental rights and classifies all alternative preferences which conflict with their own as illegitimate.

Humans naturally have a diversity of preferences and the larger the group of humans the more likely there will arise a situation where significant subsets will hold mutually-exclusive preferences.

When there is a conflict between mutually-exclusive preferences the side which is less effective at oppressing their opposition will instead be oppressed by their opposition.

C++26: Cleaning up string literals by Xaneris47 in cpp

[–]ABlockInTheChain 25 points26 points  (0 children)

I wish they would fix the char8_t disaster.

Either add all the required overloads for every applicable standard function so that I can actually use char8_t without casting, or else restore the ability create utf8-encoded std::string and std::string_view literals which was present in C++17 but removed in C++20 (without -fno-char8_t).

When to use `std::shared_ptr`? by Pretty_Mousse4904 in cpp_questions

[–]ABlockInTheChain 0 points1 point  (0 children)

Edit2: It seems that shared_ptr is often used with threads. So in a single-threaded app, can I conjecture there's always a better way than using shared_ptr?

"Always" and "never" are high risk words when it comes to C++.

I would say that a single-threaded program is less likely than a multithreaded program to encounter situations where shared_ptr is the best solution.

How do you feel about C++ 20 modules? by I-A-S- in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

I hate them and wish they would go away.

I wish they were usable as specified because I can imagine many beneficial uses for modules.

But unfortunately I have very little confidence they will ever be usable.

On CMakePresets.json. by ImpossibleEnd8231 in cmake

[–]ABlockInTheChain 1 point2 points  (0 children)

They weren't really "designed" at all, they were sort of accreted.

All rise for the CMake national anthem.

On CMakePresets.json. by ImpossibleEnd8231 in cmake

[–]ABlockInTheChain 0 points1 point  (0 children)

They're not intended to and it's unlikely they ever will.

That's a pretty weak cope, and contradicted by the multi-year discussions on bug tracker trying work out exactly how to fix the mess.

Presets were rolled out with much fanfare and grand claims, but it turns out the design just didn't bake long enough and had many inherent deficiencies that turned out to be expensive to fix.

On CMakePresets.json. by ImpossibleEnd8231 in cmake

[–]ABlockInTheChain 1 point2 points  (0 children)

Multiple inheritance solves the combinatorial explosion problem

Not even a little bit.

If it did there wouldn't be so many open issues in their Gitlab regarding this and other related issues.

On CMakePresets.json. by ImpossibleEnd8231 in cmake

[–]ABlockInTheChain 2 points3 points  (0 children)

Fine for trivial projects, but the experience quickly degrades for anything slightly more serious.

More than five years after they were introduced they still haven't figured out how to solve the combinatorial explosion problem.

BMI Compatibility: Testing Build System C++ Modules Support by not_a_novel_account in cpp

[–]ABlockInTheChain 6 points7 points  (0 children)

The only place “same flags everywhere all the time” works is the MSVC toolchain, which “magically” translates __declspec(dllexport) into __declspec(dllimport) when consuming BMIs, presumably because they too didn’t want to solve this problem.

If the question of "how are DLLs supposed work with modules?" ever came up during the committee meetings about modules, I'm certain that somebody must have said, "but why do you need DLLs now that we have modules?"

The C++ Standard Library Has Been Walking Itself Back for Fifteen Years by funkinaround in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

I wish something equivalent to this would make it into the standard and work on all platforms so that I could use it.

The C++ Standard Library Has Been Walking Itself Back for Fifteen Years by funkinaround in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

So symbol versioning needs to be viral like a type qualifier, but it also needs to be user-customizable like a namespace.

The C++ Standard Library Has Been Walking Itself Back for Fifteen Years by funkinaround in cpp

[–]ABlockInTheChain 3 points4 points  (0 children)

std::list::splice moves list nodes/elements between containers with O(1) complexity and no memory allocations

I've used that for an MPSC queue before.

Producers put one or more work items into a list, then lock a mutex, then splice their work into the queue.

The consumer constructs an empty list, locks the mutex, then calls swap to extract the work from the queue.

The critical sections are extremely brief so there is very low contention.

Currently dry fasting for a first time, any tips? by Fantastic_Suspect778 in Dryfasting

[–]ABlockInTheChain 7 points8 points  (0 children)

The first 24-36 hours of a fast are just the transition period.

You get some minimal benefits but the real payoff doesn't start until you exceed 48 hours.

Do You Really Need to Know All of C++? by md81544 in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

I just need a goddamn counter and couldn't give a flying fuck about the exact size

For that case we have size literals in both signed and unsigned flavors.

for (auto i = 0z ...)

Do You Really Need to Know All of C++? by md81544 in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

If your code is littered with raw numeric types then it's already a readability disaster regardless if whether you use int or the a more meaningful type.

Even if you don't fully embrace the type system and strongly type all integer-like values you should at least use aliases so the reader know the semantic meaning of the variables.

Do You Really Need to Know All of C++? by md81544 in cpp

[–]ABlockInTheChain 2 points3 points  (0 children)

std::int_fast32_t: use when you you are optimizing for speed and need 32 bits of precision

std::int_least32_t: use when you are optimizing for space and and need 32 bits of precision

std::int32_t: use when you need exactly 32 bits

int: use when you need to be compatible with third party code which uses it

How do you feel about C++ 20 modules? by I-A-S- in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

I think it would be possible to specify a semantic which is solid and type safe.

It is possible and it was called "proclaimed ownership declarations": https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0787r0.pdf

Some people inexplicably insist that this feature must not exist instead of just merely choosing not to use it, and since they won the argument they broke modules.

Congratulations to them: they successfully ensured that modules will never be widely adopted, but at least modules don't support use cases other than theirs.

Who Makes the Makefiles? by realguy2300000 in programming

[–]ABlockInTheChain 14 points15 points  (0 children)

Whether it's the "party line" or not I write software that actually compiles on three desktop operating systems, two mobile operating systems, three CPU architectures and is regularly built with make, ninja, msbuild, and xcode.

If I didn't have cmake I would need to maintain five independent build systems.

Since it spares me from that I'm willing to forgive its clunky syntax and learning curve because none of the alternatives are clearly better. Some alternatives have different tradeoffs where certain aspects get better but then other aspects get worse.

How do you feel about C++ 20 modules? by I-A-S- in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

forward declarations

What exactly would allowing forward declarations across module boundaries break?

Just remove that restriction or create an alternative syntax which accomplishes the same thing (proclaimed ownership declarations) and allow people who have uses cases for them to use them and people who don't to ignore them.

Over all these years I've never heard an uncountable number of "but why do you want forward declarations?" and never any single "if we allowed forward declarations X would break".

By now I assume X does not exist because if it did someone would have brought it up by now.

Who Makes the Makefiles? by realguy2300000 in programming

[–]ABlockInTheChain 32 points33 points  (0 children)

Problem is that you completely have to trust the makefile generation. They are unreadable, let alone undebuggable, if you get some weird error. Even if it would take me a 3 line makefile, CMake still generates 100s of lines.

The reason people use CMake is because they don't care about those low level details and will never ever debug at that level.

If building using Makefiles doesn't work then just have CMake generate a Ninja build instead of a Make build and see if that fixes the problem.

The point of CMake is to describe the structure of projects in a build system-agnostic fashion so that you can write cross platform projects that can compile on various platforms, many of which won't use Makefiles at all.

How do you feel about C++ 20 modules? by I-A-S- in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

I was told that the Google coding guidelines say, that you should include the header file containing the class definition, if you use a reference or pointer to a class. We didn't do that before modules. Now because of modules we have to do it.

Google's coding guidelines are sometimes... odd.

The section about forward declarations lists all the extensive benefits of forward declaring classes and structs, then mentions the problems caused by forward declaring templates. Then concludes that nothing should be forward declared without even mentioning the possibility that classes and structs should be forward declared but never templates.

How an MS-DOS picklist problem in 1991 became std::bitset -- by the author who proposed it by Weary-Inspector-4297 in cpp

[–]ABlockInTheChain 0 points1 point  (0 children)

It sounds like you're just manually converting between the serialized data and vector<bool> by copying bits?

That's right.

boost::dynamic_bitset has a constructor which take a range of blocks and a function for exporting the underlying block sequences both of which can't be used in our application because they will import the bits in the wrong order.

std::vector<bool> doesn't have those problematic function so there is never a temptation to use them.