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 7, 2026

C#

C# Exceptions Used as Flow Control

- 07.01.26 - ErcanOPAK comment on C# Exceptions Used as Flow Control

Code works… but crawls. WhyExceptions are expensive. Fix Use conditional logic for expected paths.

Read More
C#

C# String Concatenation Hurts Performance in Loops

- 07.01.26 - ErcanOPAK comment on C# String Concatenation Hurts Performance in Loops

Looks harmless, isn’t. WhyImmutable strings cause repeated allocations. Fix Use StringBuilder for iterative builds.

Read More
C#

C# lock Statements Reduce Scalability

- 07.01.26 - ErcanOPAK comment on C# lock Statements Reduce Scalability

Code is safe but slow. WhyThreads block instead of cooperating. Fix Prefer concurrent collections when possible.

Read More
SQL

SQL Queries Get Slower as Data Grows

- 07.01.26 - ErcanOPAK comment on SQL Queries Get Slower as Data Grows

Worked fine for months. WhyMissing pagination strategy. Fix Always paginate user-facing queries.

Read More
SQL

SQL Indexes Exist but Queries Stay Slow

- 07.01.26 - ErcanOPAK comment on SQL Indexes Exist but Queries Stay Slow

Indexes aren’t magic. WhyIndex selectivity is too low. Fix Index columns with high cardinality.

Read More
Asp.Net Core

.NET Core Logging Hurts Performance

- 07.01.26 - ErcanOPAK comment on .NET Core Logging Hurts Performance

Logs enabled, throughput drops. WhySynchronous sinks block execution. Fix Use async logging providers.

Read More
Asp.Net Core

ASP.NET Core Apps Feel Slower Over Time

- 07.01.26 - ErcanOPAK comment on ASP.NET Core Apps Feel Slower Over Time

No memory leak detected. WhyThread pool starvation under burst load. Fix Avoid blocking calls in async pipelines.

Read More
Git

Git Hooks Improve Code Quality Automatically

- 07.01.26 - ErcanOPAK comment on Git Hooks Improve Code Quality Automatically

Manual checks are skipped. WhyHumans forget, tools don’t. Fix Use pre-commit hooks for formatting and linting.

Read More
Git

Git Rebase Feels Dangerous in Teams

- 07.01.26 - ErcanOPAK comment on Git Rebase Feels Dangerous in Teams

People avoid it entirely. WhyShared branch history risk. Fix Rebase locally, merge publicly. Clear separation prevents disasters.

Read More
Ajax / JavaScript

Ajax Requests Succeed but Data Is Outdated

- 07.01.26 - ErcanOPAK comment on Ajax Requests Succeed but Data Is Outdated

Server updated, client not. WhyAggressive caching on GET requests. Fix Add cache-busting headers or query tokens.

Read More
JavaScript

JavaScript Timers Drift Over Time

- 07.01.26 - ErcanOPAK comment on JavaScript Timers Drift Over Time

Intervals slowly become inaccurate. WhysetInterval depends on event loop timing. Fix Recalculate timing based on actual timestamps.

Read More
HTML

HTML Forms Submit Twice on Fast Clicks

- 07.01.26 - ErcanOPAK comment on HTML Forms Submit Twice on Fast Clicks

Users accidentally double-submit. WhyNo submit lock during async handling. Fix Disable submit button after first click.

Read More
CSS

CSS Layouts Break on Large Screens Only

- 07.01.26 | 07.01.26 - ErcanOPAK comment on CSS Layouts Break on Large Screens Only

Mobile and desktop fine, ultrawide broken. WhyFixed max-width assumptions. Fix Use fluid containers with max-width limits instead of fixed layouts.

Read More
Windows

Windows 11 Laptop Battery Drains Fast While Idle

- 07.01.26 - ErcanOPAK comment on Windows 11 Laptop Battery Drains Fast While Idle

Screen off, battery gone. WhyModern standby keeps apps semi-active. Fix Limit background app permissions and disable unnecessary wake sources.

Read More
Windows

Windows 11 Feels Slower After Updates

- 07.01.26 - ErcanOPAK comment on Windows 11 Feels Slower After Updates

Nothing broken, just slower. WhyBackground indexing and telemetry re-enabled. Fix Review startup tasks and background permissions after major updates.

Read More
AI

AI Prompt — Personal Learning Accelerator

- 07.01.26 - ErcanOPAK comment on AI Prompt — Personal Learning Accelerator

Prompt: Create a 30-day learning plan for: – A complete beginner – Only 20 minutes per day – Focus on practical outcomes Topic: <ANY SKILL>  

Read More
AI

AI Prompt — Generate Tests for Edge Cases Only

- 07.01.26 - ErcanOPAK comment on AI Prompt — Generate Tests for Edge Cases Only

Prompt: Generate unit tests focusing only on: – Boundary conditions – Rare edge cases – Failure paths Code: <PASTE CODE>  

Read More
AI

AI Prompt — Refactor Code for Long-Term Ownership

- 07.01.26 - ErcanOPAK comment on AI Prompt — Refactor Code for Long-Term Ownership

Prompt: Refactor this code assuming: – It will be maintained by juniors – It will live for 5+ years Explain trade-offs and decisions. Code: <PASTE CODE>  

Read More
Docker

Docker Images Grow Over Time Without Reason

- 07.01.26 - ErcanOPAK comment on Docker Images Grow Over Time Without Reason

Same app, bigger image. WhyLayer cache accumulates unused artifacts. Fix Use multi-stage builds and remove build-time dependencies.

Read More
Kubernetes

Kubernetes Deployments Appear “Healthy” but Perform Poorly

- 07.01.26 - ErcanOPAK comment on Kubernetes Deployments Appear “Healthy” but Perform Poorly

Pods are green, users complain. WhyResource limits hide throttling issues. Fix Monitor CPU throttling, not just pod status. Healthy pods can still be starved.

Read More
Wordpress

WordPress Images Look Blurry on Retina Screens

- 07.01.26 - ErcanOPAK comment on WordPress Images Look Blurry on Retina Screens

Uploaded images look fine locally, blurry online. WhyDefault image sizes don’t match device pixel ratio. Fix Enable responsive image sizes and serve higher-resolution variants.

Read More
Wordpress

WordPress Admin Becomes Slower Over Time

- 07.01.26 - ErcanOPAK comment on WordPress Admin Becomes Slower Over Time

Not broken — just painfully slow. WhyAccumulated transients and orphaned options. Fix Clean expired transients periodically and limit autoloaded options. This prevents admin-side slowdown without affecting visitors.

Read More
Photoshop

Photoshop Brushes Feel Laggy on Powerful Machines

- 07.01.26 - ErcanOPAK comment on Photoshop Brushes Feel Laggy on Powerful Machines

High-end GPU, still stuttering. WhyBrush smoothing and real-time preview overload input processing. Fix Lower brush smoothing slightly instead of disabling GPU acceleration entirely.

Read More
Photoshop

Photoshop Files Suddenly Get Huge After Small Edits

- 07.01.26 - ErcanOPAK comment on Photoshop Files Suddenly Get Huge After Small Edits

You save a minor change… file size doubles. WhyHidden layer metadata and smart object history are preserved by default. Fix Convert Smart Objects to raster when finalized Use File → Save a Copy instead of Save This strips unnecessary history without losing quality.

Read More
Visual Studio

Visual Studio Uses Too Much RAM Even with Small Projects

- 07.01.26 - ErcanOPAK comment on Visual Studio Uses Too Much RAM Even with Small Projects

You open a tiny solution… memory spikes instantly. WhyVisual Studio loads analyzers, live diagnostics, and background code models eagerly. ImpactSlower builds, sluggish IntelliSense, high battery usage. Fix Disable unnecessary background features: Turn off CodeLens Limit live analyzers for non-critical projects This keeps the IDE responsive without breaking core features.

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