<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sukhrob</title>
    <description>The latest articles on DEV Community by Sukhrob (@sukhrob).</description>
    <link>https://dev.to/sukhrob</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F847727%2Ffd3f8cd1-88db-4da3-8b3f-bc71aec9c2a6.jpeg</url>
      <title>DEV Community: Sukhrob</title>
      <link>https://dev.to/sukhrob</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sukhrob"/>
    <language>en</language>
    <item>
      <title>Asynchronous Programming in C#</title>
      <dc:creator>Sukhrob</dc:creator>
      <pubDate>Wed, 27 Apr 2022 17:26:56 +0000</pubDate>
      <link>https://dev.to/sukhrob/asynchronous-programming-in-c-5dc7</link>
      <guid>https://dev.to/sukhrob/asynchronous-programming-in-c-5dc7</guid>
      <description>&lt;p&gt;Sometimes we need to download a large file, or we need to build a software or game like Counter Strike or Valorant that it's functions works simultaneously or need to work at the same time. For example if you are playing Competitive Valorant and you throw a flashback to blind your enemy, everyone are blind in the same time. In this case, your game does complex calculation and need to blind your enemy at the same time. Without an asynchronous programming, it is not gonna happen. &lt;/p&gt;

&lt;p&gt;So asynchronous programming is the way of executing programming code in a thread without having to wait for IO bound or CPU bound task to finish. IO bound operations could be file-system accesses, HTTP requests, API calls, or database queries. CPU bound operations would be actions like encrypting a data, complex calculations, image or document management.&lt;/p&gt;

&lt;p&gt;One of the ideas of asynchronous programming is to create awaitable tasks, so that we don't block the execution of our application. We can call an asynchronous method and get a task object that represents it. After we execute those operations, we await the asynchronous task, which may already be finished or not. If the execution is finished, we will get result from the task and use it in the next dependant operations or start next operations.&lt;/p&gt;

&lt;p&gt;It has benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;UI of our application is responsive&lt;/li&gt;
&lt;li&gt;Performance of our application has improved&lt;/li&gt;
&lt;li&gt;Avoid thread pool starvation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But also it has drawbacks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Code will be more complex and harder to maintain&lt;/li&gt;
&lt;li&gt;Increased memory allocation, so some objects should stay longer while awaiting other code to be executed. That's why you need a stronger PC to play FPS games&lt;/li&gt;
&lt;li&gt;It can be harder to find bugs in code&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>csharp</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Abstract Method/Property</title>
      <dc:creator>Sukhrob</dc:creator>
      <pubDate>Sat, 23 Apr 2022 05:37:05 +0000</pubDate>
      <link>https://dev.to/sukhrob/abstract-methodproperty-38ja</link>
      <guid>https://dev.to/sukhrob/abstract-methodproperty-38ja</guid>
      <description>&lt;p&gt;abstract methodlarning tanasi derived klasslarda yozilishi shart va shuning uchun o'sha methodni base klassda &lt;code&gt;abstract&lt;/code&gt; deb e'lon qilish kerak. Derived klassda esa uni &lt;code&gt;override&lt;/code&gt; qilib e'lon qilish kerak.&lt;/p&gt;

&lt;p&gt;Uning fichalari:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Abstrakt methodlar implicitly virtual methodlar ekan (babr chummadim).&lt;/li&gt;
&lt;li&gt;Abstrakt methodlar faqatgina base classda e'lon qilinishi shart&lt;/li&gt;
&lt;li&gt;Chunki abstrakt methodning implementatsiyasi derived klassda qilinadi, base klassda methodning tanasi bo'lmaydi
Misol:
&lt;code&gt;public abstract void NimaGap;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Abstrakt method declarationida ularni static va virtual qilib e'lon qilib bo'lmaydi&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Abstrakt propertylarning fichalari&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;static propertyni esa abstract qilib e'lon qilib bo'lmaydi&lt;/li&gt;
&lt;li&gt;Inherit qilingan property derived klassda override qilib ishlatilinadi&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X1cR54ct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77phs4vriz4ujvn561xt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X1cR54ct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77phs4vriz4ujvn561xt.png" alt="Image description" width="880" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>advancedcsharp</category>
    </item>
    <item>
      <title>Abstract Class</title>
      <dc:creator>Sukhrob</dc:creator>
      <pubDate>Thu, 21 Apr 2022 09:44:11 +0000</pubDate>
      <link>https://dev.to/sukhrob/abstract-classmethod-1me8</link>
      <guid>https://dev.to/sukhrob/abstract-classmethod-1me8</guid>
      <description>&lt;p&gt;Abstraksiya kodning ma'lum qismini yashirishga va kerakli ma'lumotlarni berishga yordam beradigan protsess hisoblanadi. Va bu protsess abstrakt klass yoki interface orqali amalga oshiriladi.&lt;/p&gt;

&lt;p&gt;Abstrakt modifier klasslar, metodlar, propertylar, eventlar va intexerlar uchun ishlatilinadi. Abstrakt klasslarni boshqa klasslarga ota (base) sifatida ishlatinglar, shunchaki emas. Chunki u ABSTRAAAKT klass. Abstrakt sifatida belgilangan memberlar abstrakt klassdan kelib chiqadigan, lekin abstrakt bo'lmagan klasslar tomonidan amalga oshirilishi kerak.&lt;/p&gt;

&lt;p&gt;abstrakt klass bu object orqali chaqirish mumkin bo'lmagan klass. Chaqirish uchun uni boshqa klassdan turib inherit qilish kerak&lt;/p&gt;

&lt;p&gt;abstrakt method faqatgina abstrakt klass ichida foydalana olishimiz mumkin bo'lgan method, va unda body bo'lmaydi. Uning bodysini derived klassda (inherit qilingan klass) yozishimiz kerak bo'ladi.&lt;br&gt;
Misol:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk5qtmzl99dwn4ndxk0a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk5qtmzl99dwn4ndxk0a.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Abstraktning fichalari:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Abstrakt sinfini yasab bo'lmaydi, ya'ni ichidagilarning hammasini boshqa klasslarda implementatsiya qilinadi&lt;/li&gt;
&lt;li&gt;Abstrakt klass abstrakt method va accessorlarni talab qilishi mumkin.&lt;/li&gt;
&lt;li&gt;Abstrakt klassni sealed modifier bilan o'zgartirib bo'lmaydi, chunki bu ikkalasi bir biriga qarama qarshi meaningi bor. Sealed modifier klassni inherit qilishdan saqlasa, abstrakt modifier uni majbur qiladi.&lt;/li&gt;
&lt;li&gt;Abstrakt klassdan derive qilingan (inherit qilingan) klass abstrakt klassning barcha abstrakt methodlar va accessorlarni implement qilishi shart.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Implementation -&amp;gt; (method) tanani boshqa klassdan turib yozish&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>advancedcsharp</category>
    </item>
    <item>
      <title>Delegates #2</title>
      <dc:creator>Sukhrob</dc:creator>
      <pubDate>Wed, 20 Apr 2022 05:50:30 +0000</pubDate>
      <link>https://dev.to/sukhrob/delegates-2-1agp</link>
      <guid>https://dev.to/sukhrob/delegates-2-1agp</guid>
      <description>&lt;p&gt;Bir vaqtning o'zida bir nechta funksiyalarni chaqirish mumkin. Buning uchun funksiyalarning barchasida signature bir xil bo'lishi lozim:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hGVv3gwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fmg52ekkm8idsozhi4wi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hGVv3gwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fmg52ekkm8idsozhi4wi.png" alt="Image description" width="880" height="894"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Delegatega bir necha funksiya biriktirilgan bo'lsa, ya'ni delegate bir nechta funksiyaga point qilib turgan bo'lsa va hammasini return qilsa (ya'ni var result qilib, hammasini shunga saqlasa) Invoke method oxirgi qiymatni saqlab qoadi:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UMpZxI-2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9krm0osvk852ftftgln0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UMpZxI-2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9krm0osvk852ftftgln0.png" alt="Image description" width="880" height="764"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Delegatlarni qanday qilib har xil type sifatida ishlatishimiz mumkin? Ya'ni qanday qilib delegatlarning tipi har xil bo'lishi mumkin.&lt;/p&gt;

&lt;p&gt;Generic qilib istalgan tipda ishlatishimiz mumkin, lekin bunda Genericda tip oldindan noma'lum bo'ladi va classning ichida fuksiyani parametr sifatida ishlatayotganimizda tipi ma'lum bo'ladi:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HIMrlII4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2hnp54scdei3pjt92wu3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HIMrlII4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2hnp54scdei3pjt92wu3.png" alt="Image description" width="880" height="732"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Delegates</title>
      <dc:creator>Sukhrob</dc:creator>
      <pubDate>Sun, 17 Apr 2022 20:34:13 +0000</pubDate>
      <link>https://dev.to/sukhrob/delegates-596o</link>
      <guid>https://dev.to/sukhrob/delegates-596o</guid>
      <description>&lt;p&gt;Delegatelar reference tipidagi data type bo'lib, funksiya uchun pointer vazifasini bajaradi. Classning ichida delegate yasaladi va classdan tashqarida yasalgan funksiyani ishlatish uchun delegateni ko'rsatkich qilib olinadi. Funksiya bilan delegate tabaka bilan sous kelishganday qachon kelishadi, qachonki ularning signaturelari bir biriga to'g'ri kelsa!&lt;/p&gt;

&lt;p&gt;Signature nima?&lt;br&gt;
Signature bu funksiyaning return tipi va parametri!&lt;/p&gt;

&lt;p&gt;Delegat ko'rinishi:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ACCESSMODIFIER DELEGATE RETURNTYPE NAMEOFDELEGATE(PARAMETERS);&lt;/code&gt;&lt;br&gt;
Misol uchun: &lt;br&gt;
&lt;code&gt;public delegate int Division(int firstNum, int secondNum);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: Har qanday delegateni invoke qilib chaqirish lozim&lt;/p&gt;

&lt;p&gt;Pastda delegatning ishlatilinishiga bir misol&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JSfsM0Zz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98nddq2b8l1wl0risuwh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JSfsM0Zz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98nddq2b8l1wl0risuwh.png" alt="Image description" width="880" height="673"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
