Errors vanish. WhyExceptions thrown inside delegates are harder to trace. Fix Use explicit loops for critical logic.
Category: C#
List
Task.Run Inside ASP.NET Core Hurts Scalability
Seems async, kills throughput. WhyConsumes thread pool threads. Fix Use async APIs instead of offloading.
IEnumerable Executes More Than Once
Unexpected duplicate work. WhyDeferred execution. Fix var data = query.ToList();
Boxing Happens Without You Noticing
Performance drops mysteriously. WhyInterfaces cause value types to box. Fix Use generics to avoid boxing.
async void Swallows Exceptions
Errors disappear. Whyasync void cannot be awaited. Fix async Task MethodAsync()
ASP.NET Core Thread Pool Starves Under Load
Requests queue endlessly. WhyLong-running sync tasks block threads. Fix await Task.Run(LongRunningWork);
DateTime.Now Breaks Distributed Logic
Same code, different results. WhyLocal time zones and daylight saving. Fix DateTimeOffset.UtcNow 🔥 Why DateTime.Now Breaks Distributed Logic (And What to Use Instead) Same code. Different results.If you’ve ever seen time-based logic randomly fail in production, DateTime.Now might be the silent culprit. In distributed systems, local time is a trap. 🚨 The Core Problem […]
LINQ Looks Clean but Allocates Heavily
Readable code, hidden cost. WhyMultiple enumerations. Fix var list = items.ToList();
Async Methods Still Block the Thread Pool
Looks async, behaves sync. WhyCPU-bound work inside async methods. Fix await Task.Run(Compute);
ASP.NET Core Memory Usage Keeps Growing
GC runs, memory stays high. WhyObject pooling misused or ignored. Fix services.AddPooledDbContextFactory<AppDbContext>();
Exceptions Used for Control Flow
Works until scale. WhyExceptions are expensive. Fix if (!TryParse(…)) return;
Events Cause Memory Leaks
Even in managed code. WhyUnsubscribed event handlers. FixAlways unsubscribe or use weak events.
Structs Can Be Slower Than Classes
Surprising but true. WhyLarge structs copied by value. Fix void Process(in MyStruct data)
ASP.NET Core Requests Hang Under Load
CPU low, threads exhausted. WhyBlocking calls inside async pipeline. Fix await SomeAsyncMethod();
Exceptions Used for Flow Control
Works… until scale. WhyExceptions are expensive. Fix Use Try-patterns instead.
LINQ Causing Hidden Allocations
Clean code, slow runtime. WhyDeferred execution + boxing. Fix Materialize once when needed.
C# Async Methods Still Block Threads
Looks async, isn’t. WhyCPU-bound work inside async. Fix Offload CPU work explicitly. await Task.Run(() => HeavyCalculation());
Events Can Cause Memory Leaks
Even in managed code. Why it happensUnsubscribed event handlers. FixAlways unsubscribe or use weak events.
DateTime.Now Can Break Distributed Systems
Time is harder than it looks. Why it happensTime zones + daylight saving. FixUse DateTimeOffset.UtcNow.
C# Value Types Copied More Than You Think
Structs aren’t always faster. Why it happensLarge structs passed by value. FixUse in parameters.
C# — GC.Collect() Hurts More Than It Helps
Manual GC kills performance. Rule Let the runtime decide.
C# — async void Event Handlers Swallow Exceptions
Crashes disappear silently. Fix Wrap logic with try/catch and logging.
C# — Equals Without Operator Overload Is Inconsistent
== and Equals() behave differently. Fix Override both consistently.
C# — Stopwatch Is More Accurate Than DateTime
Measuring performance with DateTime lies. âś… Fix Stopwatch sw = Stopwatch.StartNew();
C# — async Lambdas Capture Variables Unexpectedly
Loop variables are captured by reference. ❌ Bug Perfectly compiled, logically broken code. ✅ Fix Create a local copy inside the loop.
C# — string.Equals() Without ComparisonType Is a Bug
Default comparison is culture-sensitive. string.Equals(a, b) ❌ Risk Unexpected results in different locales. ✅ Fix string.Equals(a, b, StringComparison.Ordinal)
Prayer Times App v1.0.2
🕌 Modern, User-Friendly Prayer Times Application Completely free, portable prayer times application for Windows — no installation required. Supports 203 countries and 4,120+ cities worldwide. ✨ Features 🌍 Global Support: 203 countries, 4,120+ cities worldwide 🇹🇷 🇬🇧 Bilingual: Turkish and English interface ⏰ Smart Notifications: 5-minute and 1-minute advance warnings 🔇 Auto Volume Control: Automatically […]
Namaz Vakitleri Uygulaması v1.0.2
🕌 Modern, Kullanıcı Dostu Namaz Vakitleri Uygulaması Windows için tamamen ĂĽcretsiz, kurulum gerektirmeyen (portable) namaz vakitleri uygulaması. DĂĽnya genelinde 203 ĂĽlke ve 4,120+ Ĺźehri destekliyor. ✨ Ă–zellikler 🌍 KĂĽresel Destek: 203 ĂĽlke, 4,120+ Ĺźehir, TĂĽrkiye’nin tĂĽm il ve ilçeleri 🇹🇷 🇬🇧 Çift Dil: TĂĽrkçe ve İngilizce arayĂĽz ⏰ Akıllı Bildirimler: 5 dakika ve 1 dakika […]
C# — List.ForEach() Is Slower Than foreach
It allocates a delegate and blocks break/continue. âś… Prefer foreach (var item in list) { }
C# — DateTimeKind.Unspecified Breaks Serialization
Unspecified kind leads to wrong conversions. âś… Rule Always specify: DateTime.SpecifyKind(date, DateTimeKind.Utc)



