In the source files of the Eclipse plug-in, why are there so many variables with the prefix "f"?

I am looking at the source code for Eclipse plugins (I am currently studying the TextMergeView class), and I notice ALOT variables being assigned the initial letter f .

I know that we often provide I prefix interfaces to make it easier to identify them as interfaces at a glance. But what does f mean?

Here's a snippet:

 ...... 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; ... 

Why do these variables start with f ? What does f mean as a prefix?

+4
source share
1 answer

This almost certainly means โ€œfieldโ€, but it clearly contradicts the Eclipse coding rules :

Private class variables must not have a field prefix or suffix.

 class Person { private String name; // NOT private String _name; // NOT private String fName; // NOT private String name_; ... } 

I suspect this code is older than the coding conventions ...

+6
source

Source: https://habr.com/ru/post/1479812/


All Articles