Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access

Day: January 1, 2026

C#

Events Can Cause Memory Leaks

- 01.01.26 - ErcanOPAK comment on Events Can Cause Memory Leaks

Even in managed code. Why it happensUnsubscribed event handlers. FixAlways unsubscribe or use weak events.

Read More
C#

DateTime.Now Can Break Distributed Systems

- 01.01.26 - ErcanOPAK comment on DateTime.Now Can Break Distributed Systems

Time is harder than it looks. Why it happensTime zones + daylight saving. FixUse DateTimeOffset.UtcNow.

Read More
C#

C# Value Types Copied More Than You Think

- 01.01.26 - ErcanOPAK comment on C# Value Types Copied More Than You Think

Structs aren’t always faster. Why it happensLarge structs passed by value. FixUse in parameters.

Read More
SQL

SQL COUNT(*) Isn’t Always Cheap

- 01.01.26 - ErcanOPAK comment on SQL COUNT(*) Isn’t Always Cheap

Especially on large tables. Why it happensFull scan required. TipUse metadata counts when possible.

Read More
SQL

SQL Queries Slow Down After Data Grows

- 01.01.26 - ErcanOPAK comment on SQL Queries Slow Down After Data Grows

Same query, worse performance. Why it happensMissing covering indexes. FixInclude frequently selected columns.

Read More
Asp.Net Core

Configuration Values Change Between Environments

- 01.01.26 - ErcanOPAK comment on Configuration Values Change Between Environments

Works locally, breaks in prod. Why it happensConfiguration providers load order. FixLog final configuration on startup.

Read More
Asp.Net Core

ASP.NET Core Requests Hang Randomly

- 01.01.26 - ErcanOPAK comment on ASP.NET Core Requests Hang Randomly

CPU low, threads exhausted. Why it happensBlocking calls inside async pipeline. FixRemove .Result and .Wait().

Read More
Git

Git History Looks Clean But Lies

- 01.01.26 - ErcanOPAK comment on Git History Looks Clean But Lies

Squash merges hide context. Why it mattersDebugging regressions becomes harder. TipAvoid squashing critical feature branches.

Read More
Git

Git Merge Conflicts Appear “Out of Nowhere”

- 01.01.26 - ErcanOPAK comment on Git Merge Conflicts Appear “Out of Nowhere”

Nothing changed… or did it? Why it happensLine-ending normalization (CRLF vs LF). FixConfigure .gitattributes.

Read More
Ajax / JavaScript

AJAX Requests Work Locally But Fail in Production

- 01.01.26 - ErcanOPAK comment on AJAX Requests Work Locally But Fail in Production

No errors, no data. Why it happensCORS preflight blocked by server config. FixAllow OPTIONS requests explicitly.

Read More
JavaScript

JavaScript forEach Can’t Be awaited

- 01.01.26 - ErcanOPAK comment on JavaScript forEach Can’t Be awaited

Silent async bugs everywhere. Why it happensforEach ignores promises. FixUse for…of or Promise.all.

Read More
HTML

HTML5 Forms Submitting Twice

- 01.01.26 - ErcanOPAK comment on HTML5 Forms Submitting Twice

Looks like a JS bug — often isn’t. Why it happensButton defaults to type=”submit”. FixAlways declare button types explicitly.

Read More
CSS

CSS position: sticky Not Working?

- 01.01.26 - ErcanOPAK comment on CSS position: sticky Not Working?

It’s not broken — it’s constrained. Why it happensParent container has overflow: hidden. FixRemove overflow or move sticky element.

Read More
Windows

Bluetooth Audio Sounds “Bad” Randomly

- 01.01.26 | 01.01.26 - ErcanOPAK comment on Bluetooth Audio Sounds “Bad” Randomly

Sudden quality drop mid-call. Why it happensHands-Free profile overrides stereo mode. FixDisable Hands-Free Telephony in device settings.

Read More
Windows

Windows 11 Laptop Battery Drains While Idle

- 01.01.26 - ErcanOPAK comment on Windows 11 Laptop Battery Drains While Idle

No apps open, battery dying. Why it happensBackground apps + wake timers. FixDisable unnecessary startup tasks + check powercfg wake sources.

Read More
AI

AI Prompt — Decision Making Under Uncertainty

- 01.01.26 - ErcanOPAK comment on AI Prompt — Decision Making Under Uncertainty

Useful for everyone, not just developers. Prompt Help me make a decision. List: – Best case – Worst case – Hidden risks – Opportunity cost Decision: <DESCRIBE SITUATION>  

Read More
AI

AI Prompt — Safe Refactoring Without Side Effects

- 01.01.26 - ErcanOPAK comment on AI Prompt — Safe Refactoring Without Side Effects

Prompt Refactor this code. Rules: – No behavior change – No public API changes – Explain WHY each change is safe Code: <PASTE CODE>  

Read More
AI

AI Prompt — Find Hidden Performance Bottlenecks

- 01.01.26 - ErcanOPAK comment on AI Prompt — Find Hidden Performance Bottlenecks

Prompt Act as a senior performance engineer. Analyze the following code. Identify: – Hidden allocations – Blocking calls – Thread pool starvation risks Suggest fixes with reasoning. Code: <PASTE CODE>  

Read More
Docker

Docker Build Is Slow Even With Cache

- 01.01.26 - ErcanOPAK comment on Docker Build Is Slow Even With Cache

You changed one line… everything rebuilt. Why it happensCOPY instructions invalidate layers. FixCopy dependency files first, source files last.

Read More
Kubernetes

Kubernetes Pod Restarts With No Error Logs

- 01.01.26 - ErcanOPAK comment on Kubernetes Pod Restarts With No Error Logs

Looks healthy… until it isn’t. Why it happensThe container is killed before logging (OOMKill). How to confirmCheck pod events, not container logs.

Read More
Wordpress

WordPress Login Keeps Failing Behind Cloudflare

- 01.01.26 - ErcanOPAK comment on WordPress Login Keeps Failing Behind Cloudflare

Correct password, endless redirects. Why it happensX-Forwarded-Proto header missing → HTTPS confusion. FixForce SSL detection in wp-config.php.

Read More
Wordpress

WordPress Suddenly Gets Slow After “Just One Plugin”

- 01.01.26 - ErcanOPAK comment on WordPress Suddenly Gets Slow After “Just One Plugin”

Classic WordPress horror story. Why it happensPlugins hook into init and wp_loaded, running on every request. Life-saving moveDisable plugins one by one while profiling (Query Monitor).

Read More
Photoshop

Photoshop Slows Down Over Time Without Crashing

- 01.01.26 - ErcanOPAK comment on Photoshop Slows Down Over Time Without Crashing

No errors, no warnings — just pain. Root causeHistory states and hidden smart objects silently eat RAM. FixLower History States + periodically rasterize unused layers.

Read More
Photoshop

Photoshop Export Looks Different on Every Screen

- 01.01.26 - ErcanOPAK comment on Photoshop Export Looks Different on Every Screen

Your design looks perfect… except everywhere else. Why it happensWide-gamut monitors + unmanaged color profiles = visual chaos. FixConvert image to sRGB IEC61966-2.1 before export.

Read More
Visual Studio

Visual Studio Runs Fine… Until You Attach Debugger

- 01.01.26 | 01.01.26 - ErcanOPAK comment on Visual Studio Runs Fine… Until You Attach Debugger

Ever noticed your app slowing down only when debugging? Why it happensThe debugger disables certain JIT optimizations and adds tracking hooks. Why it mattersPerformance bugs may disappear in Release but appear in Debug — or vice versa. Life-saving tipAlways reproduce performance issues using Release + Attach to Process.

Read More
January 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Dec    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (924)
  • How to add default value for Entity Framework migrations for DateTime and Bool (820)
  • Get the First and Last Word from a String or Sentence in SQL (816)
  • How to select distinct rows in a datatable in C# (790)
  • How to make theater mode the default for Youtube (687)
  • Add Constraint to SQL Table to ensure email contains @ (565)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (545)
  • Average of all values in a column that are not zero in SQL (512)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (467)
  • Find numbers with more than two decimal places in SQL (433)

Recent Posts

  • Why foreach Is Sometimes Slower Than for
  • The Hidden Cost of Exceptions as Flow Control
  • Why lock Can Kill Throughput
  • Indexes Can Make Queries Slower (Here’s Why)
  • Why SELECT * Slowly Destroys Performance
  • The Real Cost of IHostedService Misuse
  • Why Async Controllers Still Block Threads
  • Stop Using git pull (Yes, Really)
  • Why Git Rebase “Loses” Commits (It Doesn’t — You Did)
  • Why Fetch Requests “Randomly” Hang (But Server Is Fine)

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (924)
  • How to add default value for Entity Framework migrations for DateTime and Bool (820)
  • Get the First and Last Word from a String or Sentence in SQL (816)
  • How to select distinct rows in a datatable in C# (790)
  • How to make theater mode the default for Youtube (687)

Recent Posts

  • Why foreach Is Sometimes Slower Than for
  • The Hidden Cost of Exceptions as Flow Control
  • Why lock Can Kill Throughput
  • Indexes Can Make Queries Slower (Here’s Why)
  • Why SELECT * Slowly Destroys Performance

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com