C# guides
Every published C# guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular C# guides
Most readLatest C# guides
Page 41 of 77Using Stack<T>.TryPop in C#
Learn how Stack<T>.TryPop avoids exceptions on empty stacks in C#, when to use it instead of Pop, and how ConcurrentStack<T> handles thread safety.
C# Stack Peek: Inspect the Top Element Without Removing It
Learn how to use C# Stack<T>.Peek to inspect the top element without removing it, including empty stack handling, TryPeek, and performance.
C# Stack Push and Pop: Practical Usage
Learn how to use Stack<T> in C# for LIFO operations. Understand Push, Pop, Peek, TryPop, performance, and common pitfalls with practical examples.
C# Stack Usage: Allocation, Performance, and Limits
Understand C# stack usage: call stack frames, value-type allocation, and using stackalloc safely for short-lived buffers.
C# Generic Queue: FIFO Operations and Performance
Learn how to use C# generic Queue<T> for FIFO processing, including Enqueue, Dequeue, Peek, performance behavior, and thread-safety considerations.
C# Queue vs Stack: Choosing the Right Collection
Learn the differences between C# Queue<T> and Stack<T>, when to use each, and how FIFO/LIFO behavior affects your code.
Using Queue<T>.TryPeek in C# to Inspect Items Safely
Learn how Queue<T>.TryPeek works in C#, how it differs from Peek, and how to safely inspect queue items without removing them.
C# Queue.TryDequeue: Safe Dequeue Without Exceptions
Learn how to use Queue<T>.TryDequeue in C# to safely dequeue items, handle empty queues without exceptions, and apply the same approach with ConcurrentQueue<T> in multithreaded code.
C# Queue Peek: Reading the Front Without Removing It
Learn how Queue<T>.Peek() returns the front element without removing it, how it differs from Dequeue, and when TryPeek is the safer choice.
C# Queue Enqueue and Dequeue: Usage and Performance
Learn how to use C# Queue<T> Enqueue and Dequeue with practical examples, thread-safety options, and performance considerations for FIFO processing.