C#で使える命名用語彙辞典

コンピュータ

クラス、メソッド、プロパティ、変数、イベント、インターフェイス、名前空間で使える用途別・語感別の用語カタログ。和英併記/サンプルレシピ付き。必


0. 規約クイックリファレンス(.NET 標準)

  • PascalCase: 型名、プロパティ、メソッド、イベント、名前空間、レコード、属性クラス。
  • camelCase: ローカル変数、パラメータ、プライベートフィールド(_camelCase も一般的)。
  • I 接頭辞: インターフェイス(IEnumerable)。
  • Async 接尾辞: 非同期メソッド(LoadAsync)。
  • bool の語感: Is/Has/Can/Should/Allow/Enable で始める。
  • イベント: 「何が起きたか」を過去分詞で(Completed, Changed)+ EventHandler 系。
  • 略語: 頭字語は Pascal(HttpClient, XmlReader)。

1. 動詞(メソッド向け)/ Verbs

「する」系:命令形で統一。括弧内は近義語。

コア/汎用

Create(Generate, Build), Initialize(Setup), Configure, Reset, Clone, Copy, Convert, Transform, Map, Merge, Split, Compose, Aggregate
Load, Save, Open, Close, Read, Write, Append, Insert, Update, Delete(Remove), Fetch, Query, Lookup, Resolve
Validate, Verify, Ensure, Sanitize, Normalize, Format, Serialize, Deserialize, Parse, TryParse
Start, Stop, Pause, Resume, Cancel, Retry, Backoff, Schedule, Enqueue, Dequeue
Measure, Calculate(Compute), Estimate, Benchmark, Profile
Render, Draw, Paint, Export, Import

コレクション/アルゴリズム

Add, Remove, Contains, Find, IndexOf, Sort, OrderBy, Filter, Select, GroupBy, Distinct, Zip, Join

非同期/並行

Await, Delay, Debounce, Throttle, Lock, Unlock, Acquire, Release

ファイル/IO

Copy, Move, Rename, Watch, Scan, Pack, Unpack, Mount, Unmount

ネットワーク/Web

Connect, Listen, Send, Receive, Publish, Subscribe, Encode, Decode, Authorize, Authenticate, Sign, Verify

画像処理/グラフィックス

Resize, Crop, Rotate, Flip, Blur, Sharpen, Denoise, Threshold, Segment, Dilate, Erode, Blend, Composite, Warp, Align, Colorize

WPF/UI

Show, Hide, Focus, Capture, Release, Measure, Arrange, Invalidate, Bind, Unbind, Animate, Scroll, Drag, Drop


2. 名詞(型名・プロパティ向け)/ Nouns

「もの/状態」系:クラス、レコード、DTO、設定、コンテキスト、リポジトリなどに。

コア

Manager, Service, Provider, Factory, Helper, Adapter, Builder, Strategy, Policy
Context, Scope, Session, Pipeline, Middleware
Repository, Store, Cache, Pool, Registry, Index
Result, Option, Range, Span, Slice, Snapshot, Token, Handle, Key, Value, Pair

コレクション

List, Array, Set, Bag, Queue, Stack, Dictionary(Map), Lookup

IO / ファイル

File, Path, Directory(Folder), Stream, Buffer, Cursor, Manifest, Archive, Entry

ネットワーク

Socket, Channel, Endpoint, Request, Response, Header, Route, Payload, Packet, Frame

画像/グラフィックス

Image, Bitmap, Pixel, Frame, Layer, Mask, Region, Kernel, Palette, Histogram

WPF/UI

Window, View, Page, Dialog, Panel, Grid, Canvas, Adorner, Thumb, Command, Behavior, Template, Resource

データ/DB

Entity, Record, Row, Column, Schema, Model, Query, Command, UnitOfWork

セキュリティ

Credential, Principal, Claim, Role, Secret, Certificate, Hash, Signature

数学/統計

Vector, Matrix, Tensor, Scalar, Series, Sample, Distribution, Histogram, FFT


3. 形容詞・修飾語 / Adjectives & Modifiers

プロパティ前置きや型名の差別化に。

Fast, Slow, Async, Sync, Lazy, Eager, Safe, Secure, Reliable, Robust, Light, Heavy, Persistent, Temporary, Local, Global, Primary, Secondary
ReadOnly, Writable, Virtual, Physical, Cached, Buffered, Parallel, Batched, Shared, Exclusive
Linear, Bilinear, Bicubic, Affine, Adaptive, Normalized, Quantized


4. 接頭辞・接尾辞・略語の扱い / Prefixes & Suffixes

  • I-: インターフェイス(IClock, ILogger
  • -Async: 非同期メソッド(GetUserAsync
  • Is/Has/Can/Should/Allow/Enable: bool プロパティ(IsEnabled, HasValue, CanExecute
  • Try-: 例外を投げない試行(TryParse, TryGetValue)戻り値 bool + out が慣例
  • On-: イベント発火ハンドラ(OnLoaded, OnChanged
  • -Options / -Settings / -Config: 設定クラス
  • -Provider / -Factory / -Repository / -Strategy: 役割を明確化
  • 略語: Http, Xml, Json, Io, Ui, Gpu(先頭のみ大文字)

5. ドメイン別チートシート / Domain Cheat Sheets

5.1 File/IO

  • クラス: FileService, PathResolver, DirectoryScanner, StreamFactory, ArchiveExtractor
  • メソッド: Copy, Move, ReadAllBytes, WriteAllText, Watch/Unwatch
  • プロパティ: FullPath, Extension, IsReadOnly, Size, CreatedAt, LastModified

5.2 Collections/Algorithm

  • クラス: PriorityQueue, RingBuffer, DisjointSet
  • メソッド: AddRange, RemoveWhere, SortBy, Shuffle
  • プロパティ: Count, Capacity, IsEmpty

5.3 Concurrency/Async

  • クラス: AsyncLock, TaskScheduler, RateLimiter
  • メソッド: WaitAsync, AcquireAsync, Release
  • プロパティ: IsAcquired, CurrentCount, MaxConcurrency

5.4 Networking/Web

  • クラス: HttpClientFactory, EndpointResolver, JwtTokenProvider
  • メソッド: ConnectAsync, SendAsync, Authorize, Authenticate
  • プロパティ: BaseAddress, Headers, Timeout

5.5 Imaging/Graphics

  • クラス: ImageProcessor, KernelBuilder, PaletteGenerator
  • メソッド: Resize, Crop, Blur, Sharpen, Composite
  • プロパティ: Width, Height, Channels, ColorSpace

5.6 WPF/UI

  • クラス: DialogService, CommandBinder, AdornerLayerHost
  • メソッド: Show, Hide, Bind, InvalidateVisual, Focus
  • プロパティ: IsEnabled, DataContext, SelectedItem, ItemsSource

5.7 Data/DB

  • クラス: DbContext, UnitOfWork, UserRepository
  • メソッド: Add, Update, Remove, Find, SaveChangesAsync
  • プロパティ: ConnectionString, Transaction, Entities

5.8 Security

  • クラス: PasswordHasher, JwtValidator, CertificateStore
  • メソッド: Hash, Verify, Sign, Encrypt, Decrypt
  • プロパティ: Salt, Iterations, Algorithm, PublicKey

5.9 Math/Stats

  • クラス: Vector3, Matrix4x4, FftProcessor, Histogram
  • メソッド: Dot, Cross, Normalize, Transform
  • プロパティ: Mean, Variance, StandardDeviation

6. サンプル命名レシピ / Naming Recipes

  • 非同期取得: GetUserAsync, LoadConfigAsync, FetchImageAsync
  • Try パターン: TryGetValue(string key, out T value)
  • ブール: IsValid, HasChanges, CanExecute, ShouldRetry
  • イベント: Loaded, Changed, Completed, Failed / 発火メソッドは OnLoaded, OnChanged
  • DTO/Record: UserDto, ImageInfo, FileEntry
  • 設定: ImageProcessingOptions, RetryPolicyOptions
  • インターフェイス: IClock, IFileSystem, IImageProcessor
  • テストダブル: FakeClock, StubRepository, MockHandler

7. アンチパターン / Anti-Patterns

  • 省略し過ぎ:Do(), Proc(), Mng() → 具体化する。
  • 型の重複:ImageImageProcessorFileFileInfo
  • 曖昧な動詞:Handle, Process文脈語。具体語を優先(Validate, Transform, Resize)。
  • bool の否定形:IsNotEnabled より IsEnabled を正論理で。
  • 略語の大文字連打:HTTPCLIENT / XMLREADER(Pascalで HttpClient, XmlReader)。

8. ミニ辞書(和英対応・拾い物)

  • 取得する:Get, Fetch, Retrieve
  • 設定する:Set, Configure, Apply
  • 生成する:Create, Generate, Build, Compose
  • 変換する:Convert, Transform, Map
  • 読み込む:Load, Read, Import
  • 書き出す:Save, Write, Export
  • 検証する:Validate, Verify, Ensure
  • 表示する:Show, Render, Display
  • 終了する:Close, Dispose, Shutdown
  • 待機する:Wait, Await, Delay
  • 再試行:Retry, Backoff

9. 予約語衝突回避 Tips

  • 衝突しそうなら 接尾辞で回避:ContextAppContext, ImageContext
  • 型名とプロパティ名が衝突する場合:Image Image は避けて Image Picture or Bitmap Image などに。
  • BCL有名型は避ける:Task, List, String, Console, Math などは型名に使わない。

10. ひな型ブロック

public interface IImageProcessor
{
    Task<Image> ResizeAsync(Image source, Size size, CancellationToken ct = default);
    Task<Image> SharpenAsync(Image source, float amount, CancellationToken ct = default);
    bool TryDetectEdge(Image source, out Region region);
    bool IsHardwareAccelerated { get; }
}

public sealed class RetryPolicyOptions
{
public int MaxRetryCount { get; init; } = 3;
public TimeSpan Delay { get; init; } = TimeSpan.FromMilliseconds(200);
public bool ShouldJitter { get; init; } = true;
} 

付録: ブール接頭辞チートシート

  • Is(状態): IsEnabled, IsEmpty
  • Has(所有): HasValue, HasChildren
  • Can(能力): CanRead, CanExecute
  • Should(方針): ShouldRetry, ShouldCache
  • Allow/Enable(設定): AllowOverwrite, EnableLogging

コメント