Comments (3)
I almost assume the compiler is smart enough to simply replace all ""
with string.Empty
at compile time.
A quick test in sharplab seems to indicate different LI is generated by the compiler, but the JIT produced assembler code is indeed the same. So it might be that there is a very so slight overhead during runtime for the JIT to do it's work.
That said, I do agree that this is not a readability concern, and more often than not I actually write "" in tests because it makes it easier to understand what is going on.
from atc-coding-rules.
Pr. meeting 05/02-2020, we agreed upon that we want this rule enabled for src/props and set to none for test/props.
Arguments:
- It explicitly clarifies our intent
- Its easier to spot string.Empty than ""
- Its easier to search for string.Empty than a literal
- Eliminates zero width space issues LINK
- Minor performance gain
from atc-coding-rules.
from atc-coding-rules.
Related Issues (20)
- NSubstitute.Analyzers.CSharp HOT 4
- dotnet pack fails with SymbolPackageFormat property HOT 1
- Align distribution MSBuild files with Atc.Cosmos
- Microsoft.CodeAnalysis.NetAnalyzers should only be included when using older SDKs HOT 1
- CA1812: Avoid uninstantiated internal classes HOT 1
- Test rule: CA1068: CancellationToken parameters must come last HOT 4
- Rule: CA1002 replaces MA0016 HOT 2
- SA1202 (ElementsMustBeOrderedByAccess) should be covered by decision for SA1201 HOT 2
- Consider all StyleCop Documentation Rules HOT 2
- Semantic versioning of the ATC Rules
- Rule: CA1305 replaces MA0011 HOT 1
- Rule: MA0038 Make method static - Same as CA1822 HOT 1
- Rule: SA1601
- Rule: IDE0060
- Directory.Build.props streamline
- Rule: csharp_style_prefer_index_operator and csharp_style_prefer_range_operator
- Rule: IDE0161 - File-scoped namespace
- Rule: CA1602
- Rule: IDE0005
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atc-coding-rules.