Let's talk optimisation and pooling! In Unity, allocation can seem pretty simple since everything is handled by the language. Most of us call "new" on class without blinking. The truth is we should blink, a lot. #unitytips #csharptips

indyNarf's tweet image. Let's talk optimisation and pooling!

In Unity, allocation can seem pretty simple since everything is handled by the language. Most of us call "new" on class without blinking.
The truth is we should blink, a lot.

#unitytips #csharptips

Según me vaya dando, iré escribiendo pequeños consejos y micro-tutoriales de uno de los lenguajes más usados hoy en día, sobre todo gracias a Xamarin y Unity #CSharpTips


تو سی شارپ میتونی از span<T> , memory<T> استفاده کنی مزایا: مصرف حافظه کمتر سرعت پردازش بالاتر فشار کمتر رو gc #CSharpTips


By using extension methods, you can enhance built-in or custom classes, making your code more readable and modular. **#CSharpTips #ExtensionMethods #CodeEnhancements #SoftwareEngineering #CodeReadability**

binyf07's tweet image. By using extension methods, you can enhance built-in or custom classes, making your code more readable and modular.

**#CSharpTips #ExtensionMethods #CodeEnhancements #SoftwareEngineering #CodeReadability**

Looking for an optimized way to get a distinct list of strings in C#? Look no further than using a Hashset! This method provides constant time-performance for adding elements and ensures uniqueness. #CSharpTips #Optimization

gregintech_'s tweet image. Looking for an optimized way to get a distinct list of strings in C#? Look no further than using a Hashset! This method provides constant time-performance for adding elements and ensures uniqueness. #CSharpTips #Optimization

در .NET 8 به بعد، FrozenDictionary و FrozenSet معرفی شدن ساختارهایی immutable و optimized for read performance #CSharpTips


Whenever possible, in C#, use Lambda-bodied expressions instead of conventional method bodies. Why? - It makes code declarative, instead of imperative - It prevents mutable variable assignments - It is 2 lines shorter #csharp #csharptips #programming

SilasReinagel's tweet image. Whenever possible, in C#, use Lambda-bodied expressions instead of conventional method bodies. 

Why?
- It makes code declarative, instead of imperative
- It prevents mutable variable assignments
- It is 2 lines shorter

#csharp #csharptips #programming

💡 Did you know that C# has local functions that help unclutter your code? 💡 They are great when you need to repeat yourself several times with a method, but exposing this method your class is meaningless elsewhere. #unity3d #unitytips #csharptips

BestlaGaming's tweet image. 💡 Did you know that C# has local functions that help unclutter your code? 💡 
They are great when you need to repeat yourself several times with a method, but exposing this method your class is meaningless elsewhere. #unity3d #unitytips #csharptips

Method 2: Collections Export a List<t> or object collection using IWorksheet.ImportData(). It supports nested objects and grouping options, which are useful for complex data models. ➡️ Next, let’s explore database exports 👇 #CSharpTips #Excel #List #ObjectCollections (4/8)

Syncfusion's tweet image. Method 2: Collections
Export a List&amp;lt;t&amp;gt; or object collection using IWorksheet.ImportData(). It supports nested objects and grouping options, which are useful for complex data models.
➡️ Next, let’s explore database exports 👇
#CSharpTips #Excel #List #ObjectCollections
(4/8)

تو سی شارپ میتونی با IAsyncEnumerable<T> داده ها رو به صورت stream بخونی و پردازش کنی بدون اینکه همه رو تو حافظه لود کنی -پردازش داده های بزرگ به صورت تکه تکه -راحتی در پردازش real-time -کمک به حافظه #CSharpTips


در .NET 8 می‌تونی از TimeProvider استفاده کنی تا وابستگی به DateTime.UtcNow رو از بین ببری یعنی زمان هم قابل mock و تست می‌شه #CSharpTips


Explora estas pautas esenciales para escribir código más eficiente y robusto en C#. 💡💻 Nuestros consejos de C# te guiarán hacia la excelencia. #CSharpTips #DesarrolloDeSoftware

beparrot_co's tweet image. Explora estas pautas esenciales para escribir código más eficiente y robusto en C#. 💡💻

Nuestros consejos de C# te guiarán hacia la excelencia.

#CSharpTips #DesarrolloDeSoftware

در C# فرق زیادی بین throw; و throw ex; هست - throw; → exception رو دوباره پرتاب می‌کنه و StackTrace اصلی حفظ میشه - throw new ex; → StackTrace رو ریست می‌کنه 🔹 همیشه برای حفظ context واقعی از throw; استفاده کن. #CSharpTips


#unityTips #CSharpTips How to remove lambda listener from the event? Create a delegate instance field from the lambda. Assign it to the listener. Then, if you need, remove it from the listener. Ref: stackoverflow.com/questions/1362…

KroyanArshak's tweet image. #unityTips #CSharpTips
How to remove lambda listener from the event?
Create a delegate instance field from the lambda.
Assign it to the listener.
Then, if you need, remove it from the listener.

Ref:
stackoverflow.com/questions/1362…

در C# 12 می‌تونی از Primary Constructors نه‌فقط برای record، بلکه برای class و struct هم استفاده کنی -کمتر boilerplate می‌نویسی - dependencies are immutable مناسب برای clean architecture و service-oriented design #CSharpTips


در .NET 8 می‌تونی از TimeProvider استفاده کنی تا وابستگی به DateTime.UtcNow رو از بین ببری یعنی زمان هم قابل mock و تست می‌شه #CSharpTips


در C# فرق زیادی بین throw; و throw ex; هست - throw; → exception رو دوباره پرتاب می‌کنه و StackTrace اصلی حفظ میشه - throw new ex; → StackTrace رو ریست می‌کنه 🔹 همیشه برای حفظ context واقعی از throw; استفاده کن. #CSharpTips


در .NET 8 به بعد، FrozenDictionary و FrozenSet معرفی شدن ساختارهایی immutable و optimized for read performance #CSharpTips


در C# 12 می‌تونی از Primary Constructors نه‌فقط برای record، بلکه برای class و struct هم استفاده کنی -کمتر boilerplate می‌نویسی - dependencies are immutable مناسب برای clean architecture و service-oriented design #CSharpTips


در C# هر بار از async void استفاده می‌کنی، یه exception ممکنه از کنترل خارج بشه و کل برنامه رو کرش بده فقط برای event handlerها از async void استفاده کن. برای بقیه همیشه async Task بنویس. #CSharpTips


در C#، وقتی متدی مقدار رو بلافاصله برمی‌گردونه، استفاده از ValueTask به‌جای Task می‌تونه allocation-free باشه و GC pressure رو کم کنه. فقط حواست باشه که یکبار await اش کنی #CSharpTips


در C# هر بار که async متد تعریف می‌کنی، کامپایلر پشت صحنه یه state machine می‌سازه. اگه متد واقعاً async نیست، این overhead بی‌دلیله #CSharpTips


در C#، اگه روی objectهای shared از lock اشتباه استفاده کنی (مثلاً روی this یا string literal)، ممکنه به deadlock یا lock contention برسی. #CSharpTips


تو سی شارپ وقتی از record استفاده میکنی -مقدار immutable داری -مقایسه های byValue هستن #CSharpTips


تو سی شارپ میتونی با IAsyncEnumerable<T> داده ها رو به صورت stream بخونی و پردازش کنی بدون اینکه همه رو تو حافظه لود کنی -پردازش داده های بزرگ به صورت تکه تکه -راحتی در پردازش real-time -کمک به حافظه #CSharpTips


تو سی شارپ میتونی از span<T> , memory<T> استفاده کنی مزایا: مصرف حافظه کمتر سرعت پردازش بالاتر فشار کمتر رو gc #CSharpTips


وقتی داری از struct استفاده میکنی حواست باشه 1-برای داده های کوچک و immutable مناسبه 2- مقدارش by value ذخیره میشه و کپی میشه #CSharpTips


Method 2: Collections Export a List<t> or object collection using IWorksheet.ImportData(). It supports nested objects and grouping options, which are useful for complex data models. ➡️ Next, let’s explore database exports 👇 #CSharpTips #Excel #List #ObjectCollections (4/8)

Syncfusion's tweet image. Method 2: Collections
Export a List&amp;lt;t&amp;gt; or object collection using IWorksheet.ImportData(). It supports nested objects and grouping options, which are useful for complex data models.
➡️ Next, let’s explore database exports 👇
#CSharpTips #Excel #List #ObjectCollections
(4/8)

What's the difference between var and int in C#? var is shorthand for implicitly typed variables, while int specifies a specific data type. Get familiar with it for better coding practices! #CSharpTips #Variables


Leverage automatic properties for boilerplate code reduction. The compiler creates a private, anonymous backfield that can only be accessed through the property! #CSHARPTips


⚡️ Use `await Task.WhenAll()` with multiple `async` methods to perform parallel tasks efficiently and improve code performance. 🚀 #CSharpTips


Day-2 Today's C# Lesson 1.Literal (Character,interger,float-point,Boolean literals) 2. Data types 3.Variable #CSharpProgramming #DotNet #CSharpTips


4/7🧵: This code snippet uses the ‘Length’ property to calculate the length of ‘array1’, which, in this case, will print ‘5’. 🖥️🔢 #CodeSnippet #CSharpTips #tutorial

byte_hide's tweet image. 4/7🧵: This code snippet uses the ‘Length’ property to calculate the length of ‘array1’, which, in this case, will print ‘5’. 🖥️🔢 #CodeSnippet #CSharpTips #tutorial

Let's talk optimisation and pooling! In Unity, allocation can seem pretty simple since everything is handled by the language. Most of us call "new" on class without blinking. The truth is we should blink, a lot. #unitytips #csharptips

indyNarf's tweet image. Let&apos;s talk optimisation and pooling!

In Unity, allocation can seem pretty simple since everything is handled by the language. Most of us call &quot;new&quot; on class without blinking.
The truth is we should blink, a lot.

#unitytips #csharptips

Looking for an optimized way to get a distinct list of strings in C#? Look no further than using a Hashset! This method provides constant time-performance for adding elements and ensures uniqueness. #CSharpTips #Optimization

gregintech_'s tweet image. Looking for an optimized way to get a distinct list of strings in C#? Look no further than using a Hashset! This method provides constant time-performance for adding elements and ensures uniqueness. #CSharpTips #Optimization

By using extension methods, you can enhance built-in or custom classes, making your code more readable and modular. **#CSharpTips #ExtensionMethods #CodeEnhancements #SoftwareEngineering #CodeReadability**

binyf07's tweet image. By using extension methods, you can enhance built-in or custom classes, making your code more readable and modular.

**#CSharpTips #ExtensionMethods #CodeEnhancements #SoftwareEngineering #CodeReadability**

💡 Did you know that C# has local functions that help unclutter your code? 💡 They are great when you need to repeat yourself several times with a method, but exposing this method your class is meaningless elsewhere. #unity3d #unitytips #csharptips

BestlaGaming's tweet image. 💡 Did you know that C# has local functions that help unclutter your code? 💡 
They are great when you need to repeat yourself several times with a method, but exposing this method your class is meaningless elsewhere. #unity3d #unitytips #csharptips

Whenever possible, in C#, use Lambda-bodied expressions instead of conventional method bodies. Why? - It makes code declarative, instead of imperative - It prevents mutable variable assignments - It is 2 lines shorter #csharp #csharptips #programming

SilasReinagel's tweet image. Whenever possible, in C#, use Lambda-bodied expressions instead of conventional method bodies. 

Why?
- It makes code declarative, instead of imperative
- It prevents mutable variable assignments
- It is 2 lines shorter

#csharp #csharptips #programming

Según me vaya dando, iré escribiendo pequeños consejos y micro-tutoriales de uno de los lenguajes más usados hoy en día, sobre todo gracias a Xamarin y Unity #CSharpTips


Method 2: Collections Export a List<t> or object collection using IWorksheet.ImportData(). It supports nested objects and grouping options, which are useful for complex data models. ➡️ Next, let’s explore database exports 👇 #CSharpTips #Excel #List #ObjectCollections (4/8)

Syncfusion's tweet image. Method 2: Collections
Export a List&amp;lt;t&amp;gt; or object collection using IWorksheet.ImportData(). It supports nested objects and grouping options, which are useful for complex data models.
➡️ Next, let’s explore database exports 👇
#CSharpTips #Excel #List #ObjectCollections
(4/8)

#unityTips #CSharpTips How to remove lambda listener from the event? Create a delegate instance field from the lambda. Assign it to the listener. Then, if you need, remove it from the listener. Ref: stackoverflow.com/questions/1362…

KroyanArshak's tweet image. #unityTips #CSharpTips
How to remove lambda listener from the event?
Create a delegate instance field from the lambda.
Assign it to the listener.
Then, if you need, remove it from the listener.

Ref:
stackoverflow.com/questions/1362…

Explora estas pautas esenciales para escribir código más eficiente y robusto en C#. 💡💻 Nuestros consejos de C# te guiarán hacia la excelencia. #CSharpTips #DesarrolloDeSoftware

beparrot_co's tweet image. Explora estas pautas esenciales para escribir código más eficiente y robusto en C#. 💡💻

Nuestros consejos de C# te guiarán hacia la excelencia.

#CSharpTips #DesarrolloDeSoftware

🔸 I keep getting “file in use” errors in C# Remember to close or dispose of file streams. Using using blocks helps prevent locked resources. #FileHandling #CSharpTips #Code

IBL_SystemHouse's tweet image. 🔸 I keep getting “file in use” errors in C#

Remember to close or dispose of file streams. Using using blocks helps prevent locked resources.

#FileHandling #CSharpTips #Code

Loading...

Something went wrong.


Something went wrong.


United States Trends