Created
October 3, 2016 06:20
-
-
Save Finglas/16d8dd7c759a182b4eafb132d7f8fd78 to your computer and use it in GitHub Desktop.
Constant Usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bad use of constant if this was separated. | |
File.Open(FilePath); | |
// Local constant. More clarity. | |
const string FilePath = "..."; | |
File.Open(FilePath); | |
// Inline, named argument for cases where you want | |
// readability but also the ability to change at runtime | |
// or on deployment. | |
File.Open(filePath: "d:/example") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment