When you call `Any()`, it clearly communicates the code's intention, which is to check if the collection is empty. Using `Count() == 0` for this purpose is less direct and makes the code slightly more complex. However, there are some cases where special attention should be paid:
* if the collection is an `EntityFramework` or other ORM query, calling `Count()` will cause executing a potentially massive SQL query and could put a large overhead on the application database. Calling `Any()` will also connect to the database, but will generate much more efficient SQL.
* if the collection is part of a LINQ query that contains `Select()` statements that create objects, a large amount of memory could be unnecessarily allocated. Calling `Any()` will be much more efficient because it will execute fewer iterations of the enumerable.
Also, the description is a shallow modification of the Java version. The reasoning sounded plausible, but please verify that the efficiency argument is valid for C#.
If you call `Count()` on a `List<T>`, it will cast the list to an `ICollection<T>`, and call the `Count` property. Whereas an `Any()` on a `List<T>` will get the underlying `IEnumerator`, and call `GetNext()` on it. My feeling is that the second one is going to be slower, but I haven't done any measurements.
Also, an `IEnumerable` can be an abstraction on top of a database as well. In this case `Any()` and `Count()` are transformed to SQL, and the performance may depend on many things. It seems that `Count()` performs better for SQL Server and Entity Framework: 2nd answer of \http://stackoverflow.com/questions/305092/which-method-performs-better-any-vs-count-0. But the samples there use predicates in the `Any()` and `Count()`, which might also affect the performance.
I wouldn't write the opposite rule. The developer needs to know whatever he is doing. In case of an underlying database table, the queries always need performance profiling, so the developer will need to optimize that, and can suppress this warning if he finds that for performance reasons he needs to use `Count() > 0`.
\[~ann.campbell.2], I've changed the `List<string>` to `IEnumerable<string>`, because the `List` has a `Count` property, so calling the `Count()` on it might not be the best example.