关于函数命名,什么'Generic'代表函数名'helloGCSGeneric'

About functions naming, what 'Generic' stand for function name 'helloGCSGeneric'

我的问题是什么代表像 'Generic' 这样的命名。

我正在查看 GCP 的云功能教程, https://cloud.google.com/functions/docs/tutorials/storage#object_finalize

本教程中有简单的示例。

/**
 * Generic background Cloud Function to be triggered by Cloud Storage.
 *
 * @param {object} event The Cloud Functions event.
 * @param {function} callback The callback function.
 */
exports.helloGCSGeneric = (data, context, callback) => {
  const file = data;

  console.log(`  Event: ${context.eventId}`);
  console.log(`  Event Type: ${context.eventType}`);
  console.log(`  Bucket: ${file.bucket}`);
  console.log(`  File: ${file.name}`);
  console.log(`  Metageneration: ${file.metageneration}`);
  console.log(`  Created: ${file.timeCreated}`);
  console.log(`  Updated: ${file.updated}`);

  callback();
};

即使对我来说,这个函数的作用也很简单。 在我的理解中,对象 creation/update 最终确定时触发。

'helloGCSFinalization'或'helloGCSGeneration'是有道理的,但为什么叫'Generic'呢? 在什么情况下使用'Generic'?我认为它与 C++ 或 Java.

等编程语言中的不同

这个问题听起来很傻,但英语不是我的母语,我还是想了解一下这个命名上下文。

提前致谢!

这个问题很有意思。我想知道还有谁会尝试回答...

我也不是以英语为母语的人,但我会尝试这样解决:因为这是 Google 文档,我尝试使用 Google Translator.

这个通用术语的第一个描述是(至少在我这边:)):

characteristic of or relating to a class or group of things; not specific.

您可能会发现的同义词有:一般的、常见的、非特定的。

当然我只能猜测,但我认为作者的想法是:"just simply function triggered Google Cloud Storage"。虽然我同意 computer programming theory.

中有这样的词

这只是我的声音...