Better HN
topnewbestaskshowjobs
Log inSign up

proikan

8 karma · joined Oct 16, 2024 (2y ago) · 1 submissions

Submissions

comment 2y ago · link · parent

Isn't ```dependency injection``` (aka passing arguments) the big thing that's supposed to solve this?

  Config config;
  // production
  config_from_file(&config, "config.json");
  run_production_stuff(&config);
  
  // unit tests
  Config config;
  config_from_memory(&config, &some_test_values);
  run_tests(&config);