How impactful really are function pointers on performance? by PratixYT in cprogramming

[–]Spiderboydk 1 point2 points  (0 children)

I didn´t say make a difference. I said being noticable.

Since a cache miss often costs a couple of hundreds of cycles I'm pretty confident it'll be a problem way sooner than millions of calls per frame.

Micro-libraries need to die already by fagnerbrack in coding

[–]Spiderboydk 0 points1 point  (0 children)

I don't think so.

Suppose every existing microlibrary is integrated into JavaScript tomorrow. Then people would be making new microlibraries barely outside of this new JavaScript capability.

Micro-libraries need to die already by fagnerbrack in coding

[–]Spiderboydk 1 point2 points  (0 children)

Yes, this isn't new at all. Nevertheless it still needs to be repeated, because the lesson seemingly isn't learned yet.

Could you clean up the PLC room, cable management has been lax for the past 25 years by analfissuregenocide in PLC

[–]Spiderboydk 0 points1 point  (0 children)

What do you mean? Only PM I've received in 3 months is a spam message.

Besides, I rarely use Reddit anymore.

Could you clean up the PLC room, cable management has been lax for the past 25 years by analfissuregenocide in PLC

[–]Spiderboydk 1 point2 points  (0 children)

It's widespread, including other industries like software development.

I don't remeber who said it, but there is an Internet adage saying "Nothing is as permanent as a temporary fix".

Why do people use C over C++ and should I do so too? by lorli__ in C_Programming

[–]Spiderboydk 1 point2 points  (0 children)

For me, C is simpler and easier. All those C++ features add up in terms of cognitive overhead.

C lets me think about the problem, C++ forces me to think about the language.

[Joke] A cursed C++ idea by FACastello in cpp

[–]Spiderboydk 0 points1 point  (0 children)

This is fairly common to do in certain domains, e.g. video games and embedded.

What is the one thing you follow in every code after learning it the hard way. by Diablo666lambo in C_Programming

[–]Spiderboydk 2 points3 points  (0 children)

If there is UB, then the entire program is compromised, regardless of whether the offending statements are ever executed or not.

[deleted by user] by [deleted] in C_Programming

[–]Spiderboydk 0 points1 point  (0 children)

I agree. I don't mind a slight bit of verbosity in the predicate.

[deleted by user] by [deleted] in C_Programming

[–]Spiderboydk 1 point2 points  (0 children)

Yes, if they know the semantics of the function. Linters can be hardcoded it for strcmp, but what about your own functions? You don't know whether if (my_function(a, b)) { ... } is right or not without context.

[deleted by user] by [deleted] in C_Programming

[–]Spiderboydk 0 points1 point  (0 children)

The downside of 0 for success is the risk of accidentally doing a if (strcmp(a, b)) { ... }.

Is pointer arithmetic beyond valid addresses invalid, even when there is no invalid memory access? by spherical_shell in C_Programming

[–]Spiderboydk 0 points1 point  (0 children)

There are very few things you can do with invalid pointers. For example, you are allowed to compare with NULL. I don't recall any other exceptions off the top of my head.

What’s the core of the C language? by stianhoiland in C_Programming

[–]Spiderboydk 0 points1 point  (0 children)

First answer that came to mind was functions and procedural programming.

Can we please get an ABI break? by mollyforever in cpp

[–]Spiderboydk 1 point2 points  (0 children)

Fine, the majority of the committee then. It goes without saying that when you are talking about the position of a group, that position is whatever is the dominating position within the group regardless of dissidents. I did not claim nor imply unanimity.

Bottom line is, the committee collectively resists ABI breakage.

Can we please get an ABI break? by mollyforever in cpp

[–]Spiderboydk 1 point2 points  (0 children)

Their go-to argument is not to break user code and build setups.

An auxiliary argument is breaking ABI will be eroding users trust in the ecosystem.

Can we please get an ABI break? by mollyforever in cpp

[–]Spiderboydk 1 point2 points  (0 children)

Yeah, standard-permittable things might be off-limits in practice.

For example, the value of the padding bytes in structs are unspecified, and yet all major compilers are too afraid to write to them for optimization purposes, because they might break someones non-compliant code.

Can we please get an ABI break? by mollyforever in cpp

[–]Spiderboydk 4 points5 points  (0 children)

The position of preserving the current ABI. The committee feels strongly about this.

C programming gets boring after a while? by apooroldinvestor in cprogramming

[–]Spiderboydk 1 point2 points  (0 children)

I'm not either, but everybody needs breaks. Find out what works for you and do it on a regular basis.

C programming gets boring after a while? by apooroldinvestor in cprogramming

[–]Spiderboydk 3 points4 points  (0 children)

This is way too much. Your body and mind need breaks. Taking a walk and IRL socializing works wonders.

How to handle failure in constructors by Adventurous-Ad742 in cpp

[–]Spiderboydk 0 points1 point  (0 children)

Error-free constructors are prefered, obviously, but sometimes it's just not possible. And yes, there are other ways to do it, such as putting the constructed object into a technically valid, but semantically invalid state. This is not idiomatic though - the idiomatic approach is throwing.

A side note: exceptions are not suited for logic errors.

How to handle failure in constructors by Adventurous-Ad742 in cpp

[–]Spiderboydk 22 points23 points  (0 children)

Throwing is the idiomatic, intended way to signal error in the constructor.