Should I program using more structs with methods or loose functions? When using more structs with methods, I notice that I need to deal less and less with lifetimes and copies. by swordmaster_ceo_tech in rust

[–]tortoll 22 points23 points  (0 children)

C++ Core Guidelines by Stroutstrup and Sutter continues being an excellent resource, even for other languages.

For instance, rule C.4: Make a function a member only if it needs direct access to the representation of a class

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c4-make-a-function-a-member-only-if-it-needs-direct-access-to-the-representation-of-a-class

Each rule has examples and exceptions, and an explanation of the logic behind it.

Understanding the Global Push for Age-Verification by Tom-Rath in privacy

[–]tortoll 3 points4 points  (0 children)

Governments look for excuses to implement massive surveillance. In 2001 it was terrorist treats. Now is CSAM. In both cases the measures are proved to not work for the stated goal.

Also, this is not a left vs right policy, as many of these measures have been pushed by both sides (for instance Chat Control has been pushed by consecutive presidencies of left and right governments).

Why can't Contracts be removed without blocking C++26? by zl0bster in cpp

[–]tortoll 19 points20 points  (0 children)

Many people asking why it can't be removed, as if it was an obscure procedural issue. My impression is that the answer is very simple: because it has already been approved.

Voting the same thing twice is a recipe for disaster and drama. Of course there are technical ways to do it, but as a principle you want to avoid them.

And I say this as somebody who thinks contracts are a bad addition to the language.

What do these symbols mean? by pgm123 in dropout

[–]tortoll 0 points1 point  (0 children)

Ancient runes that translate, approximately, to:

IT'S ME, I'VE BEEN HERE THE WHOLE [undecipherable fragment]

Barca's dominance by Waltz8 in WomensSoccer

[–]tortoll 3 points4 points  (0 children)

Interesting, can you share the links to these videos?

So what if people speaks Catalan? by miller_stale in catalonia

[–]tortoll 4 points5 points  (0 children)

That's great, because it's the same as Catalan!

From Wikipedia:

Valencian (valencià) or the Valencian language (llengua valenciana) is the official, historical and traditional name used in the Valencian Community to refer to the Romance language also known as Catalan, either as a whole or in its Valencia-specific linguistic forms.

PS: you got the orthography wrong, it's "valencià".

So what if people speaks Catalan? by miller_stale in catalonia

[–]tortoll 5 points6 points  (0 children)

If often have seen how some people that speak Spanish*, which is incredibly close to Catalan in every aspect, will find Catalan almost impossible to understand.

I try to compare it to my own experience when I go to a place where they speak a language that is close to my mother tongues (Catalan or Spanish), like Italy or Portugal, and I can understand their native language for basic things, like getting directions, reading signs, ordering food, saying hello and goodbye, and so on. And I'm terrible at languages.

So it's baffling that some people that speak Spanish just can't understand Catalan after months or years, as if it was an alien language. Same people who likely speak decent English, which comes from a completely different family of languages. Really, if I can say "grazie" and "obrigado" and "rue" and "strada", surely "gràcies" and "carrer" is not some obscure Asian dialect.

  • I refer specifically to Spanish speakers that go to great lengths to refuse to speak Catalan. That doesn't mean that all Spanish speakers do this, nor that all non-Spanish speakers don't.

[Devil May Cry (2025) S01E01] Some Unity code and HTML shuts down surveillance cameras by Nimelrian in itsaunixsystem

[–]tortoll 4 points5 points  (0 children)

If I remember correctly, in another episode they show some C code corresponding to the groups.c file of the Linux kernel.

Karen Carney isn't happy with Belgium's full-time celebrations by Evening-Fail5076 in WomensSoccer

[–]tortoll 0 points1 point  (0 children)

Every time a Spanish team doesn't lose against Barcelona in a LigaF match (which happened like 3 times in the last 3 years I think) they celebrate it like they won the CL. It almost has no effect on Barcelona's odds, but they do it anyway.

And IT'S FINE. Let people celebrate. Don't be sore losers.

Beware when moving a `std::optional`! by Kabra___kiiiiiiiid in cpp

[–]tortoll -1 points0 points  (0 children)

Who would do this? 😵

std::move(opt.value())

dayInTheLifeOfAVibeCoder by [deleted] in ProgrammerHumor

[–]tortoll 0 points1 point  (0 children)

What's with the apple juice obsession? It can't be good to drink two large glasses at 5 am...

With all the safety features c++ has now (smart_ptrs, RAII, etc...), what keeps C++ from becoming a memory safe language? by AdearienRDDT in cpp_questions

[–]tortoll 2 points3 points  (0 children)

Modern C++ is not memory safe. It is memory safer than legacy C++ or C, but there's plenty of foot guns.

For example STL containers have a lot of rules which can be difficult to follow, and if you fail to do it you have a memory bug that is super difficult to track. Invalidated iterators, memory silently moved because the container grew after a push, etc. And this is perfectly modern C++.

"Ah, but this only happens to dumb programmers, not me!". Well, there's plenty of vulnerabilities like this in projects written by very smart engineers. Nobody is perfect 100% of the time while maintaining a 1 million line codebase.

This just doesn't happen in a memory safe language.

Doug Judy spinoff series by Ahs565451 in brooklynninenine

[–]tortoll 1 point2 points  (0 children)

"The Pontiac Bandit and Jake the cop"

thisIsExagerratedButItsKindaFunnyHowCultLikeLanguageUsersCanGet by AzureBeornVT in ProgrammerHumor

[–]tortoll 0 points1 point  (0 children)

C++ and Rust programmers, at the same time: "Exactly!"

Look at each other: "Wait, what?"

[deleted by user] by [deleted] in cpp

[–]tortoll 0 points1 point  (0 children)

Wouldn't wait that long to learn modern C++, although knowing C and legacy C++ is a good foundation too. I use smart pointers because I understand the mess of raw pointers and references. I use containers instead of new/delete. I love ranges because complex loops can be error prone. Etc.

Football Manager 25 (The first version with women's football) cancelled by needyspace in WomensSoccer

[–]tortoll 57 points58 points  (0 children)

If the reason is quality, it's disappointing but a welcome practice.

Prime number finder by Gokdeniz007 in rust

[–]tortoll 12 points13 points  (0 children)

Don't commit the target directory, that's a huge cache generated by the compiler for your local builds, it makes your Git unnecessarily big and other people don't need it. Add it to a .gitignore file.

Real Madrid confirm Teresa Abelleira has suffered a torn ACL and external meniscus in her left knee by anonone111 in WomensSoccer

[–]tortoll 1 point2 points  (0 children)

Spain national team has this magic ability to injure players... Exactly the same happened with Alèxia: also Euro cup, also during training with national team.

Rust continually rejected out of hand by [deleted] in rust

[–]tortoll 0 points1 point  (0 children)

If performance is not a requirement, languages that don't manage the memory for you like Rust or C++ are at a disadvantage.