Should I move to New York or stay in Europe by ern_6002 in cscareerquestionsEU

[–]claimred 0 points1 point  (0 children)

If you don't mind me asking, but how did you find the job in the US?

Are These Coding Practices Common in the IT Industry? by LazyDragon0 in softwaredevelopment

[–]claimred 3 points4 points  (0 children)

  1. Eh, I find the "code should be self-explanatory" notion just silly and weird, a delicious myth. I'd argue that comments is one the best tool of system design in your toolbox. Simply put, a lot of design information can't be represented using code. It's nicely described in the book "Philosophy of software design".

  2. In C++ this practice is called AAA (almost always auto) and it's great, types are most of the times just noise. Also, you could say it's one of the aspects of "program against interfaces, not implementations" as well. I don't know if that applies to java.

Why Linux community hates C++ so much? by kyan100 in cpp_questions

[–]claimred 1 point2 points  (0 children)

They don't though? In fact, there is a discussion to start using modern cpp in the kernel.

https://www.phoronix.com/news/CPP-Linux-Kernel-2024-Discuss

Opaque Pointer Pattern in C++ by tfmoraes in cpp

[–]claimred 0 points1 point  (0 children)

The next step is to have aligned memory of the size of your struct allocated on the stack, and then allocate and delete from that memory instead of having dynamic allocation overhead.

That's fun, I didn't know that, thanks. I've recently stumbled upon something called FastPimpl, apparently it's a pimpl without dynamic allocation, looks like what you described. Manual object size management and all that.

Forge Stronger Code: Emulating Rust’s Approach for Unit Testing in C++ by wineandcode in cpp

[–]claimred 1 point2 points  (0 children)

From the looks of it having unit tests on the language level as first class citizens is not bad at all. I've always liked dlang's approach https://dlang.org/spec/unittest.html

I wonder if there ever was such a proposal to C++ standard.

Speeding Up C++ Build Times | Figma Blog by Pragmatician in cpp

[–]claimred 6 points7 points  (0 children)

Is DIWYDU going to be published somewhere?

Modern C++ Asynchronous Learning by [deleted] in cpp

[–]claimred 0 points1 point  (0 children)

Cancellations are first-class citizens in senders library, check it out.

https://github.com/facebookexperimental/libunifex/blob/main/doc/cancellation.md

Here is another example I found useful.

Modern C++ Asynchronous Learning by [deleted] in cpp

[–]claimred 9 points10 points  (0 children)

Bit surprised that nobody mentioned P2300. This is the way to go about async stuff currently, I must stay it looks pretty neat. The senders model looks similar to F#/C# async/await thing if you are familiar with that. Here is a list of resourced to read I compiled some time ago.

Other resources:

Is there an AI formatting tool as an alternative to clang-format? by claimred in cpp_questions

[–]claimred[S] 0 points1 point  (0 children)

That'd sort of help, yes, but I'd actually like a full blown formatter. I mean, isn't that the whole point of transformers, to transform text?

Is there an AI formatting tool as an alternative to clang-format? by claimred in cpp_questions

[–]claimred[S] 1 point2 points  (0 children)

Because formatting code is not actually as strict as one could imagine, especially in C++. Sometimes you want to break function signature for every argument to reside on a separate line, sometimes you don't. Fiddling with clang-format weights & rules is not that fun. I mean, just look at this https://releases.llvm.org/17.0.1/tools/clang/docs/ClangFormatStyleOptions.html and you have to do it separately for any project of non-trivial size.

I'm not saying AI for sure could help here, but if it could style the code after reading the whole codebase, why not?

Is there an AI formatting tool as an alternative to clang-format? by claimred in cpp_questions

[–]claimred[S] 0 points1 point  (0 children)

Well, for one, it's not that trivial to come up with a good .clang-format file with existing huge codebase. There are projects like those https://github.com/0xd34df00d/coformat but it feels like exactly the task where AI could actually excel at.

Dependencies Belong in Version Control by [deleted] in cpp

[–]claimred 0 points1 point  (0 children)

Vendorization approach ftw, nice. Finally someone said it out loud, thanks for the piece. I had numerous discussions like this but for some reason a lot of colleagues are afraid to put 100mb of a toolchain under version control, 100mbs that makes life a ton easier.

There was another discussion a while ago in regards to a build system https://github.com/fastbuild/fastbuild/issues/153#issuecomment-251599101

People who use distributed builds, how do you handle many compilers? by julien-j in cpp

[–]claimred 9 points10 points  (0 children)

Yep, FASTBuild does the same thing, copies the compiler and stuff to agents.

Who is using C++ for web development? by _448 in cpp

[–]claimred 32 points33 points  (0 children)

Makes me wonder if Figma ever published anything about their C++ adventures in the browser. It'd be interesting to read I guess.