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
  • Privacy Policy

Author: ErcanOPAK

Asp.Net Core

Security — URL Length Can Kill Requests

- 28.12.25 - ErcanOPAK comment on Security — URL Length Can Kill Requests

Browsers & proxies limit URL size. ❌ Breaks Large GET filters Search queries ✅ Fix Use POST for complex payloads.

Read More
Networking

Networking — DNS Is Usually the Real Bottleneck

- 28.12.25 - ErcanOPAK comment on Networking — DNS Is Usually the Real Bottleneck

APIs “randomly slow”? 🧠 Cause DNS lookup delays No connection reuse ✅ Fix Enable DNS caching & keep-alive.

Read More
Asp.Net Core

HTTP — Caching Is Disabled More Often Than You Think

- 28.12.25 - ErcanOPAK comment on HTTP — Caching Is Disabled More Often Than You Think

No cache headers = slower everything. ✅ Add ETag Cache-Control If-None-Match Result: fewer bytes, faster pages, happier users.

Read More
SQL

SQL — Floating Point Columns Corrupt Financial Data

- 28.12.25 - ErcanOPAK comment on SQL — Floating Point Columns Corrupt Financial Data

FLOAT ≠ money. ❌ Result Rounding errors accumulate silently. ✅ Fix Use: DECIMAL(18, 2)  

Read More
C# / Entity Framework

EF Core — Change Tracking Is a Hidden Performance Tax

- 28.12.25 - ErcanOPAK comment on EF Core — Change Tracking Is a Hidden Performance Tax

Tracking thousands of entities slows everything. ✅ Fix context.ChangeTracker.QueryTrackingBehavior = NoTracking; Or per query: .AsNoTracking()  

Read More
C#

Unicode — String Length Is Not What You Think

- 28.12.25 - ErcanOPAK comment on Unicode — String Length Is Not What You Think

“👨‍👩‍👧‍👦”.Length // NOT 1 Why UTF-16 code units Grapheme clusters ✅ Fix Use text element enumeration for user-visible length.

Read More
C#

Time Zones — DateTime.Now Is a Data Corruption Bug

- 28.12.25 - ErcanOPAK comment on Time Zones — DateTime.Now Is a Data Corruption Bug

DateTime.Now depends on server locale. ❌ What breaks Distributed systems Daylight Saving Time Audits & reporting ✅ Rule Store UTC, display local. DateTime.UtcNow  

Read More
Visual Studio

Visual Studio — “Random” Test Failures Are Parallelism

- 27.12.25 - ErcanOPAK comment on Visual Studio — “Random” Test Failures Are Parallelism

Tests passing alone, failing together? ❌ Cause Shared static state. ✅ Fix Make tests isolated or disable parallel execution.

Read More
Wordpress

WordPress — REST API Enabled = Attack Surface

- 27.12.25 - ErcanOPAK comment on WordPress — REST API Enabled = Attack Surface

Many sites don’t need it. ✅ Fix Disable REST endpoints if unused. Result Better security Lower load

Read More
Windows

Windows 11 — Defender Real-Time Scan Blocks Git

- 27.12.25 - ErcanOPAK comment on Windows 11 — Defender Real-Time Scan Blocks Git

Git operations become painfully slow. ✅ Fix Exclude: .git repo folders

Read More
Windows

Windows 11 — TPM Firmware Can Throttle CPU

- 27.12.25 - ErcanOPAK comment on Windows 11 — TPM Firmware Can Throttle CPU

Some TPM firmware causes periodic CPU spikes. ✅ Fix Update BIOS + TPM firmware.

Read More
JavaScript

AJAX — Fetch Does NOT Reject on HTTP Errors

- 27.12.25 - ErcanOPAK comment on AJAX — Fetch Does NOT Reject on HTTP Errors

This surprises many devs. fetch(url) // resolves on 404 ✅ Correct Manually check: if (!response.ok) throw Error();  

Read More
JavaScript

JavaScript — == Can Change Logic After Refactors

- 27.12.25 - ErcanOPAK comment on JavaScript — == Can Change Logic After Refactors

Loose equality causes temporal bugs. if (value == false) ❌ Problem 0, “”, null behave differently over time. ✅ Rule Always use ===.

Read More
HTML

HTML5 — autocomplete Can Leak Sensitive Data

- 27.12.25 - ErcanOPAK comment on HTML5 — autocomplete Can Leak Sensitive Data

Browsers aggressively remember fields. ❌ Risk Passwords, tokens, internal IDs ✅ Fix autocomplete=”off” Where appropriate.

Read More
CSS

CSS — height: 100% Does Nothing Without Context

- 27.12.25 - ErcanOPAK comment on CSS — height: 100% Does Nothing Without Context

This fails silently: .child { height: 100%; } 🧠 Reason Parent has no explicit height. ✅ Fix Define height on all parents.

Read More
Asp.Net Core / C#

.NET Core — Request Aborted Token Is Ignored Too Often

- 27.12.25 - ErcanOPAK comment on .NET Core — Request Aborted Token Is Ignored Too Often

Client disconnects — server keeps working. ✅ Fix Use: HttpContext.RequestAborted Cancel long-running operations immediately.

Read More
Asp.Net Core / C#

.NET Core — Async Controllers Can Still Block Threads

- 27.12.25 - ErcanOPAK comment on .NET Core — Async Controllers Can Still Block Threads

Async does NOT guarantee non-blocking. ❌ Hidden blocker Task.Result Task.Wait() ✅ Rule Async all the way — no sync-over-async.

Read More
SQL

SQL Server — LEFT JOIN + WHERE Turns Into INNER JOIN

- 27.12.25 - ErcanOPAK comment on SQL Server — LEFT JOIN + WHERE Turns Into INNER JOIN

This is a classic silent bug: LEFT JOIN Orders o ON o.UserId = u.Id WHERE o.Status = ‘Paid’ ❌ Result Rows without orders are removed. ✅ Fix Move condition into JOIN.

Read More
SQL

SQL Server — GETDATE() Breaks Deterministic Queries

- 27.12.25 - ErcanOPAK comment on SQL Server — GETDATE() Breaks Deterministic Queries

Using GETDATE() inside queries makes results non-cacheable. ❌ Problem Query plans cannot be reused efficiently ✅ Fix Pass time as a parameter instead.

Read More
C#

C# — Exceptions Are Extremely Expensive

- 27.12.25 - ErcanOPAK comment on C# — Exceptions Are Extremely Expensive

Exceptions are not control flow. ❌ Bad try { Parse(); } catch { } ✅ Better Use TryParse patterns. Impact Exceptions allocate Capture stack traces Kill throughput under load

Read More
C#

C# — foreach Copies Structs Silently

- 27.12.25 - ErcanOPAK comment on C# — foreach Copies Structs Silently

Iterating structs can create hidden copies. foreach (var item in largeStructList) { item.Modify(); // modifies a copy } ✅ Fix Use ref foreach: foreach (ref var item in CollectionsMarshal.AsSpan(list))  

Read More
C#

C# — Memory Works with Async, Span Does Not

- 27.12.25 - ErcanOPAK comment on C# — Memory Works with Async, Span Does Not

Span<T> is stack-only.Once you await, the stack frame is gone. ❌ This breaks Span<byte> buffer = stackalloc byte[256]; await DoAsync(buffer); // 💥 ✅ Correct Memory<byte> buffer = new byte[256]; await DoAsync(buffer); Rule: Span<T> → sync, hot paths Memory<T> → async-safe

Read More
Visual Studio

Visual Studio — Build Is Slow Because of File Watchers

- 25.12.25 - ErcanOPAK comment on Visual Studio — Build Is Slow Because of File Watchers

VS watches everything. ❌ Cost CPU usage Disk churn ✅ Fix Exclude large folders from file watchers.

Read More
Wordpress

WordPress — Plugins Loading Everywhere Is the Real Killer

- 25.12.25 - ErcanOPAK comment on WordPress — Plugins Loading Everywhere Is the Real Killer

Most plugins load on every request. ✅ Fix Conditionally load assets only where needed. Result: massive TTFB improvement.

Read More
Windows

Windows 11 — Clock Drift Breaks SSL & Auth

- 25.12.25 - ErcanOPAK comment on Windows 11 — Clock Drift Breaks SSL & Auth

Time desync causes: HTTPS failures Token rejections ✅ Fix Force time sync periodically.

Read More
Windows

Windows 11 — Indexing Service Slows Dev Machines

- 25.12.25 - ErcanOPAK comment on Windows 11 — Indexing Service Slows Dev Machines

Windows Search indexes code folders. ❌ Impact Slower file access Build delays ✅ Fix Exclude: node_modules bin obj

Read More
Ajax / JavaScript

AJAX — Preflight Requests Are Real Requests

- 25.12.25 - ErcanOPAK comment on AJAX — Preflight Requests Are Real Requests

CORS preflight: Hits server Costs latency Can be blocked ✅ Optimize Avoid unnecessary custom headers.

Read More
JavaScript

JavaScript — JSON.stringify Can Crash on Big Objects

- 25.12.25 - ErcanOPAK comment on JavaScript — JSON.stringify Can Crash on Big Objects

Circular references = runtime error. ✅ Safer Use structured cloning or custom serializers.

Read More
HTML

HTML5 —

- 25.12.25 - ErcanOPAK comment on HTML5 —

This is not optional. <label for=”email”>Email</label> <input id=”email”> Benefits Larger click target Screen reader support Better UX

Read More
CSS

CSS — z-index Only Works on Positioned Elements

- 25.12.25 - ErcanOPAK comment on CSS — z-index Only Works on Positioned Elements

This is ignored: z-index: 10; ❌ Reason Element must have: position: relative | absolute | fixed | sticky  

Read More
Page 51 of 69
« Previous 1 … 46 47 48 49 50 51 52 53 54 55 56 … 69 Next »

Posts navigation

Older posts
Newer posts
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

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