You don't have to write everything from scratch just because you're in a browser. dotnetfiddle.net lets you add real NuGet packages to your fiddle - Humanizer, Newtonsoft.Json, whatever you need. Just search, add, and run. No `.csproj`, no restore dance, no terminal. It shipped quietly years ago and somehow half the devs we know still don't use it. --- int bugs = 342; Console.WriteLine($"You have {bugs.ToWords()} bugs in your backlog."); Console.WriteLine($"That's been sitting there for {"day".ToQuantity(5)}."); Console.WriteLine("Status: " + "this_is_fine".Humanize()); --- Try it yourself (no setup required): https://lnkd.in/ezgMfRmj #dotnet #csharp #programming #nuget
dotnetfiddle with NuGet packages and no setup required
More Relevant Posts
-
Dependency Injection sounds advanced... but the idea is simple. Instead of creating objects manually, .NET creates and gives them when needed. Here’s what happens: 1️⃣ Service is registered 2️⃣ .NET stores it in container 3️⃣ Class asks for dependency in constructor 4️⃣ .NET provides the required object 5️⃣ App stays clean and easy to manage Why DI is powerful: ✅ Clean code ✅ Easy testing ✅ Loose coupling ✅ Better project structure If you use ASP.NET Core, you are already using DI. Do you use Scoped, Singleton, or Transient most? #dotnet #dependencyinjection #aspnetcore #csharp #backenddeveloper #softwaredeveloper #webapi #developer #coding #programming
To view or add a comment, sign in
-
-
𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 𝗜𝗻𝗷𝗲𝗰𝘁𝗶𝗼𝗻 𝗶𝗻 𝗔𝗦𝗣.𝗡𝗘𝗧 𝗖𝗼𝗿𝗲: 𝗧𝗿𝗮𝗻𝘀𝗶𝗲𝗻𝘁 𝘃𝘀 𝗦𝗰𝗼𝗽𝗲𝗱 𝘃𝘀 𝗦𝗶𝗻𝗴𝗹𝗲𝘁𝗼𝗻 If you’re using Dependency Injection in ASP.NET Core, you’ve probably asked: • When should I use Transient? • Why is Scoped so common for DbContext? • When is Singleton actually safe? The answer lies in service lifetimes and choosing the wrong one can lead to: • memory leaks • threading issues • hard-to-debug bugs 𝗜’𝘃𝗲 𝗽𝘂𝘁 𝘁𝗼𝗴𝗲𝘁𝗵𝗲𝗿 𝗮 𝘀𝗶𝗺𝗽𝗹𝗲 𝘃𝗶𝘀𝘂𝗮𝗹 𝗲𝘅𝗽𝗹𝗮𝗻𝗮𝘁𝗶𝗼𝗻 𝘁𝗵𝗮𝘁 𝗯𝗿𝗲𝗮𝗸𝘀 𝗱𝗼𝘄𝗻: • what each lifetime really means • how long instances live • when to use each one in real projects 📌 𝗥𝗲𝗮𝗱 𝘁𝗵𝗲 𝗳𝘂𝗹𝗹 𝗮𝗿𝘁𝗶𝗰𝗹𝗲 𝗵𝗲𝗿𝗲: Understanding this early can save you hours of debugging later. Which service lifetime do you use the most in your projects Scoped, Singleton, or Transient? 𝗪𝗮𝗻𝘁 𝗺𝗼𝗿𝗲 𝗖# & 𝗔𝗦𝗣.𝗡𝗘𝗧 𝗖𝗼𝗿𝗲 𝘁𝗶𝗽𝘀 𝗹𝗶𝗸𝗲 𝘁𝗵𝗶𝘀? #dotnet #aspnetcore #csharp #dependencyinjection #softwaredevelopment #backend #programming
To view or add a comment, sign in
-
-
Your API returns 10,000 rows and you're loading them into a `List<T>` before doing anything. Bold strategy. `IAsyncEnumerable<T>` lets you stream data asynchronously, processing each item as it arrives instead of waiting for the whole payload. It pairs with `await foreach` and it just works. --- await foreach (var tick in GetLiveTicker()) Console.WriteLine($"${tick.Symbol}: {tick.Price:F2}"); --- Shipped in C# 8 and .NET Core 3.0 back in 2019, it quietly solved the "why is my app eating 2GB of RAM" problem for a lot of teams. Run it, break it, learn it: https://lnkd.in/e5jMbUvr #dotnet #csharp #programming #asyncprogramming
To view or add a comment, sign in
-
-
Learn how to build real-time applications using ASP.NET Core SignalR. Instead of constantly refreshing the page, SignalR allows your server to push updates instantly to connected clients, making your applications faster, smarter, and more interactive. https://lnkd.in/d45d-E9u #dotnet #aspnetcore #signalr #realtime #webdevelopment #programming #backend #websockets #learncoding #softwarearchitecture #csharp
To view or add a comment, sign in
-
-
C#/.NET Performance Tip - String vs Char Usage Many .NET developers may not be aware of a significant performance difference: Using StartsWith("s") is 5 times slower than using StartsWith('s'). When a string is passed, .NET must: → Allocate a string object → Compare character by character with culture rules In contrast, when a char is passed, .NET: → Directly compares the first character → Involves zero allocation and zero overhead This performance difference applies to: • StartsWith • EndsWith • Contains • IndexOf A small change can lead to a massive impact at scale. Benchmark results show: 1.008 ns (char) vs 5.340 ns (string). Keep this in mind for your next code ! #csharp #dotnet #performance #programming #tips #coding #softwaredevelopment #aspnetcore #developer #cleancode
To view or add a comment, sign in
-
-
💡𝐂#/.𝐍𝐄𝐓 𝐀𝐬𝐲𝐧𝐜 𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧 𝐓𝐢𝐩 🚀 💎𝐇𝐨𝐰 𝐚𝐧𝐝 𝐰𝐡𝐞𝐧 𝐭𝐨 𝐮𝐬𝐞 ‘𝐚𝐬𝐲𝐧𝐜’ 𝐚𝐧𝐝 ‘𝐚𝐰𝐚𝐢𝐭’ 💡 '𝐚𝐬𝐲𝐧𝐜' and '𝐚𝐰𝐚𝐢𝐭' keywords introduced in C# 5.0 were designed to make it easier to write asynchronous code, which can run in the background while other code is executing. The "async" keyword marks a method asynchronous, meaning it can be run in the background while another code executes. ⚡ When using 𝐚𝐬𝐲𝐧𝐜 and 𝐚𝐰𝐚𝐢𝐭 the compiler generates a state machine in the background. 🔥 Let's look at the other high-level details in the example; 🔸 𝐓𝐚𝐬𝐤<𝐢𝐧𝐭> 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 = 𝐋𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧𝐀𝐬𝐲𝐧𝐜(); starts executing 𝐋𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧. 🔸 Independent work is done on let's assume the Main Thread (Thread ID = 1) then 𝐚𝐰𝐚𝐢𝐭 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 is reached. 🔸 Now, if the 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 hasn't finished and it is still running, 𝐃𝐨𝐒𝐨𝐦𝐞𝐭𝐡𝐢𝐧𝐠𝐀𝐬𝐲𝐧𝐜() will return to its calling method, this the main thread doesn't get blocked. When the 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 is done then a thread from the ThreadPool (can be any thread) will return to 𝐃𝐨𝐒𝐨𝐦𝐞𝐭𝐡𝐢𝐧𝐠𝐀𝐬𝐲𝐧𝐜() in its previous context and continue execution (in this case printing the result to the console). ✅ A second case would be that the 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 has already finished its execution and the result is available. When reaching the 𝐚𝐰𝐚𝐢𝐭 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 we already have the result so the code will continue executing on the very same thread. (in this case printing result to console). Of course this is not the case for in the example, where there's a 𝐓𝐚𝐬𝐤.𝐃𝐞𝐥𝐚𝐲(1000) involved. 🎯 𝐖𝐡𝐚𝐭 𝐝𝐨 𝐲𝐨𝐮 𝐭𝐡𝐢𝐧𝐤 𝐚𝐛𝐨𝐮𝐭 𝐚𝐬𝐲𝐧𝐜 𝐨𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧𝐬? #csharp #dotnet #programming #softwareengineering #softwaredevelopment
To view or add a comment, sign in
-
-
💡𝐂#/.𝐍𝐄𝐓 𝐀𝐬𝐲𝐧𝐜 𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧 𝐓𝐢𝐩 🚀 💎𝐇𝐨𝐰 𝐚𝐧𝐝 𝐰𝐡𝐞𝐧 𝐭𝐨 𝐮𝐬𝐞 ‘𝐚𝐬𝐲𝐧𝐜’ 𝐚𝐧𝐝 ‘𝐚𝐰𝐚𝐢𝐭’ 💡 '𝐚𝐬𝐲𝐧𝐜' and '𝐚𝐰𝐚𝐢𝐭' keywords introduced in C# 5.0 were designed to make it easier to write asynchronous code, which can run in the background while other code is executing. The "async" keyword marks a method asynchronous, meaning it can be run in the background while another code executes. ⚡ When using 𝐚𝐬𝐲𝐧𝐜 and 𝐚𝐰𝐚𝐢𝐭 the compiler generates a state machine in the background. 🔥 Let's look at the other high-level details in the example; 🔸 𝐓𝐚𝐬𝐤<𝐢𝐧𝐭> 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 = 𝐋𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧𝐀𝐬𝐲𝐧𝐜(); starts executing 𝐋𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧. 🔸 Independent work is done on let's assume the Main Thread (Thread ID = 1) then 𝐚𝐰𝐚𝐢𝐭 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 is reached. 🔸 Now, if the 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 hasn't finished and it is still running, 𝐃𝐨𝐒𝐨𝐦𝐞𝐭𝐡𝐢𝐧𝐠𝐀𝐬𝐲𝐧𝐜() will return to its calling method, this the main thread doesn't get blocked. When the 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 is done then a thread from the ThreadPool (can be any thread) will return to 𝐃𝐨𝐒𝐨𝐦𝐞𝐭𝐡𝐢𝐧𝐠𝐀𝐬𝐲𝐧𝐜() in its previous context and continue execution (in this case printing the result to the console). ✅ A second case would be that the 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 has already finished its execution and the result is available. When reaching the 𝐚𝐰𝐚𝐢𝐭 𝐥𝐨𝐧𝐠𝐑𝐮𝐧𝐧𝐢𝐧𝐠𝐓𝐚𝐬𝐤 we already have the result so the code will continue executing on the very same thread. (in this case printing result to console). Of course this is not the case for in the example, where there's a 𝐓𝐚𝐬𝐤.𝐃𝐞𝐥𝐚𝐲(1000) involved. 🎯 𝐖𝐡𝐚𝐭 𝐝𝐨 𝐲𝐨𝐮 𝐭𝐡𝐢𝐧𝐤 𝐚𝐛𝐨𝐮𝐭 𝐚𝐬𝐲𝐧𝐜 𝐨𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧𝐬? #csharp #dotnet #programming #softwareengineering #softwaredevelopment
To view or add a comment, sign in
-
-
C# Dev Tip: Stop the GC Pressure! 🛑 String concatenation in loops can get expensive fast. Because strings are immutable, every + creates a brand-new object in memory. When repeatedly building strings, StringBuilder is the better choice. It reduces unnecessary allocations and significantly boosts performance. Small change, big difference. 🚀 #CSharp #DotNet #Programming #StringBuilder #Performance #CleanCode #SoftwareDevelopment #DeveloperTips
To view or add a comment, sign in
-
-
Imagine a world where building a web app could require 12 hour deep dive into debugging linker problems after bisecting two months of nightly tool chains. Put away your JavaScript and Node, and join us in the trenches with Rust and WebAssembly! Earn your stripes. Contribute to the growing pool of blood, sweat, and tears that you've always heard about. #Rust #Programming #WebAssembly #Leptos
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development