[英]In the source files of an Eclipse plug-in, why are a lot of variables prefixed with “f”?
我正在瀏覽Eclipse插件的源代碼(現在我正在研究TextMergeView
類),並且我注意到很多變量都以f
開頭。
我知道我們經常給接口加上前綴I
,以便乍一看就容易將它們識別為接口。 但是f
意味着什么?
這是一個片段:
......
private int fInheritedDirection; // inherited direction
private int fTextDirection; // requested direction for embedded SourceViewer
private ActionContributionItem fIgnoreAncestorItem;
private boolean fHighlightRanges;
private boolean fShowPseudoConflicts= false;
private boolean fUseSplines= true;
private boolean fUseSingleLine= true;
private boolean fUseResolveUI= true;
private boolean fHighlightTokenChanges = false;
private String fSymbolicFontName;
private ActionContributionItem fNextDiff; // goto next difference
private ActionContributionItem fPreviousDiff; // goto previous difference
private ActionContributionItem fCopyDiffLeftToRightItem;
private ActionContributionItem fCopyDiffRightToLeftItem;
private CompareHandlerService fHandlerService;
private boolean fSynchronizedScrolling= true;
...
為什么這些變量以f
開頭? f作為前綴是什么意思?
幾乎可以肯定它的意思是“字段”,但是它明顯違反了Eclipse的編碼約定 :
私有類變量不得具有任何字段前綴或后綴。
class Person { private String name; // NOT private String _name; // NOT private String fName; // NOT private String name_; ... }
我懷疑這段代碼比編碼約定要舊...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.