えいたんごクイズ

getter

/ˈɡɛtɚ/
noun

ゲッター

解説 Definition

getter はプログラミングで、オブジェクトやクラス内部の値を外部から読み出すためのメソッドや構文を指します。値を変更する setter と対になり、内部状態を隠しつつ必要な情報だけを公開する設計で使われます。

A getter is a person or thing that gets, brings, or obtains something. The word is not very common by itself and often appears as part of a longer expression.

覚え方のコツ Memory Tip

技術用語の getter は「値を取りに行く人」ではなく、「値を読み出す入口」として覚えるのが要点です。private な変数やプロパティを直接触らせず、getName() や email の getter を通して参照させるイメージです。setter が書き込み担当なら getter は読み取り担当。一般語 get の「得る」が、プログラム内のデータ取得という専門的な意味に固定された語です。

A getter is the thing that gets a value. The easiest memory pair is getter and setter: getter reads, setter writes. If you see it with words like property, method, or value, think of code that lets you access data.

例文

The getter function retrieves the value of the private variable.

取得関数はプライベート変数の値を取得します。

In JavaScript, getters provide a way to access object properties.

JavaScriptでは、取得関数はオブジェクトプロパティにアクセスする方法を提供します。

The class defines a getter for the user's email address.

クラスはユーザーのメールアドレスの取得関数を定義します。

getter の類義語・関連語

getter の語源・成り立ち Etymology

getter は get+行為者を表す接尾辞 -er で、字義どおり「取る人・得るもの」です。get は古ノルド語 geta「得る・生じさせる」に由来するゲルマン系の語で、「手に入れる」が核なので、programming の getter も「値を取ってくるもの」と納得できます。関連語は get, beget です。

Getter comes from get plus the agent suffix -er, so it first meant "one that gets." Get entered English from Old Norse geta, meaning "obtain" or "reach," and it kept the core idea of gaining or bringing something. That is why even in computing, a getter is something that "gets" a value. Related words include get and beget.

外部辞書で調べる

この単語をシェア

この単語を英単語クイズで覚えよう