www.bytehide.com
7 Common MISTAKES made by C# developers (+ How to ...
Excerpt
## 1. Usage of String Concatenation String Concatenation Functions are really simple to use. When something is added to the string, a new address is **immediately created** in memory. The previous string is **transferred to the new section**, which now has a different location (this is not efficient at all). Let's see an example: … ## 2. Iterating with Values instead of with LINQ This problem happens when you attempt to iterate through a list of records using a loop, **which is not optimum.** … ## 5. Accessing Virtual Members within a Constructor Although this error is not one of the first, it is one of the **most common**, although it may not seem so. When an overridden method is called directly from the constructor of a base class, this **error will appear** because it comes from executing code before its time. … ## 6. Not knowing the importance of USING for Object Disposal As partech.nl says, many C# developers are +*unfamiliar* * with the concept that the using keyword is not only used as a directive for adding **namespaces**, but is also very beneficial for **object removal.** … ## 7. Using Weak Cryptographic Algorithms Here we agree with Stackify, this error is simply based on the fact that many developers use **obsolete** or **vulnerable encryption algorithms** (which is very easy to avoid). In this case we have for example SHA1 or RIPEMD160, which do not offer a current and very good level of security.
Related Pain Points
Use of obsolete or weak cryptographic algorithms
9Developers use outdated or vulnerable encryption algorithms like SHA1 or RIPEMD160, failing to recognize their security limitations. This creates security vulnerabilities that are easily avoidable with modern algorithms.
Inefficient string concatenation patterns in C#
6Developers frequently use string concatenation in loops instead of StringBuilder, causing new memory allocations for each operation. This creates unnecessary performance degradation, especially with repeated append operations on strings.
Unsafe virtual member access in constructors
6Developers call overridden methods directly from base class constructors, causing code to execute before proper initialization. This is a common error that leads to runtime failures and unexpected behavior.
Lack of awareness about 'using' keyword for resource disposal
6Many C# developers are unfamiliar with the dual purpose of the 'using' keyword, not recognizing it as a tool for proper object disposal and resource cleanup beyond namespace imports. This leads to resource leaks and improper memory management.