Hot answers tagged

3 votes

Will anything that's written in c/c++ be rerwritten in rust?

Anything? Sure. I mean, there's literally 50 years of legacy code out there, something will almost certainly be ported. Everything? No way in hell. I mean, there's literally 50 years of legacy code ...
2 votes

Is it safe to make training data and labels as global variables in C?

in C, every callback should get a void* parameter to allow such decoupling. Then you can pass the address of a structure containing the parameters you need: struct foo_data { int alpha; int ...
  • 4,508
1 vote

Where to check preconditions in multi functions

There are basically two ways to deal with preconditions. The caller is fully responsible, and if the preconditions are not met, all warranties are void. This is essentially how the C standard library ...
1 vote

Should I assert the preconditions of functions in a public API?

People tend to fixate on the C “assert” macro. To me it’s much too inflexible. Look at an abstract assertion instead. What should it do in production? There are choices. Do nothing is what C assert ...
  • 40.5k

Only top scored, non community-wiki answers of a minimum length are eligible