TGViewer
Channel Public Channel
Diyorbek.dev | ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

Diyorbek.dev | ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

@diyorbekk_dev

Allohga taqvo qiling. Va Alloh sizga ilm beradi. [2:282]


Software engineer @ OctaneJS Core Team

Dasturchi, jiddiy, kamgap, oddiy inson


ร’zim haqimda kรฒproq ma'lumot uchun: @Diyorbek_juraev_blog

Web sahifam: https://mrdiyorbek.uz/
Subscribers
381
Photos
299
Videos
35
Links
119

Showing posts older than #916 ยท Back to latest

Older Posts 14 shown
Post #911 97
30-Day Challenge: Day 6

1. Leetcode: โœ…

2. Reading (25-30 pages): โœ…

3. Writing & Reading Articles: โœ… Article

4. Typing & Vim Practice (25-30 minutes): โœ…

@Diyorbekk_dev
Post #909 74

Forwarded from Diyorbek's blog (Diyorbek Juraev)

Yangi รฒquv yili muborak!

Yana bir sinfga ulฤฃayib, maktab qanday รฒzgardi ekan? Sinfimizga yangi รฒquvchi kelganmikan? Jamshid aka matematika รฒqituvchisi ishdan ketmoqchi edi ketdimikan? ร’rnilariga qanday ustoz kelgan ekan? Sinfdoshim Nodira bilan bรฒyimiz teng edi. Meni bรฒyim baland bรฒldimikan, yoki uniki? deya รฒylanib yurgan ukalarim, singillarim!

Yangi o'quv yili muborak!

ร’zida yรฒq sevinib, ne-ne mashaqqatlar bilan (yoki mashaqqatlarsiz ๐Ÿ˜) talaba bรฒlgan! Universitet, institutlarni boshqacha tasavur qilib yurgan 1-kurs akalar, opalar, singillar va ukalar.

Yangi o'quv yili muborak!

1-kurslikda qiynalib, yakuniy imtihon qanday bรฒlar ekan deb ikki semester ni boshidan otkazgan, domlalarini tilini, dilini tushunib olgan 2-kurslar. Endi hammasi oson bรฒladi! Sizlarga ham..

Yangi o'quv yili muborak!

Talabalik yรฒlini yarmini bosib รฒtgan, qรฒrquv nimaligini bilmay gerdayib yuradigan. Kerakli joyda 1- kurslarga motivatsiya beradigan 3-kurslar!

Yangi o'quv yili muborak!

Bitirganimdan keyin qayerda ishlayman? Qattiq รฒqimasam bรฒlmas ekan deb, yangi oquv yilidan ingliz tili, rustili fanlaridan รฒquv kurslariga borishni reja qilib qoygan bolajak 4-kurslar!

Yangi o'quv yili muborak Jigarim ๐Ÿ˜‰

ยฉ Diyorbek Juraev

@Diyorbek_Juraev_Blog
Post #907 108
30-Day Challenge: Day 5

1. Leetcode: โœ…

2. Reading (25-30 pages): โœ…

3. Writing & Reading Articles: โœ… Article

4. Typing & Vim Practice (25-30 minutes): โœ…

@Diyorbekk_dev
Post #906 102
Interviewer seni diqqat qilganda ๐Ÿ˜… (Promise all)

Interviewer: Can you explain what Promise.all does in JavaScript.
Me: Okay, ๐๐ซ๐จ๐ฆ๐ข๐ฌ๐ž.๐š๐ฅ๐ฅ ๐ข๐ฌ ๐ฅ๐ข๐ค๐ž ๐ฉ๐ฎ๐ญ๐ญ๐ข๐ง๐  ๐š๐ฅ๐ฅ ๐ฒ๐จ๐ฎ๐ซ ๐ž๐ ๐ ๐ฌ ๐ข๐ง ๐จ๐ง๐ž ๐›๐š๐ฌ๐ค๐ž๐ญ. It takes an array of promises and waits for all of them to be resolved. If one promise fails, the whole thing fails.

Interviewer: How does it handle errors.
Me: If any promise in the array rejects, Promise.all immediately rejects with that error, and the remaining promises' results are ignored.

Interviewer: Can you give an example of its usage.
Me: ๐ˆ๐ฆ๐š๐ ๐ข๐ง๐ž ๐ฒ๐จ๐ฎ'๐ซ๐ž ๐ฅ๐จ๐š๐๐ข๐ง๐  ๐ฆ๐ฎ๐ฅ๐ญ๐ข๐ฉ๐ฅ๐ž ๐ข๐ฆ๐š๐ ๐ž๐ฌ ๐จ๐ง ๐š ๐ฐ๐ž๐›๐ฉ๐š๐ ๐ž. ๐˜๐จ๐ฎโ€™๐ ๐ฎ๐ฌ๐ž ๐๐ซ๐จ๐ฆ๐ข๐ฌ๐ž.๐š๐ฅ๐ฅ ๐ญ๐จ ๐ฐ๐š๐ข๐ญ ๐ฎ๐ง๐ญ๐ข๐ฅ ๐š๐ฅ๐ฅ ๐ข๐ฆ๐š๐ ๐ž๐ฌ ๐š๐ซ๐ž ๐Ÿ๐ฎ๐ฅ๐ฅ๐ฒ ๐ฅ๐จ๐š๐๐ž๐ ๐›๐ž๐Ÿ๐จ๐ซ๐ž ๐๐ข๐ฌ๐ฉ๐ฅ๐š๐ฒ๐ข๐ง๐  ๐ญ๐ก๐ž๐ฆ.

Interviewer: What happens if the array passed to Promise.all is empty?
Me: If the array is empty, Promise.all resolves immediately with an empty array, like ๐š ๐›๐š๐ฌ๐ค๐ž๐ญ ๐ฐ๐ข๐ญ๐ก ๐ง๐จ ๐ž๐ ๐ ๐ฌ.

Interviewer: Can Promise.all handle non-promise values.
Me: Yes, it will treat non-promise values as already resolved promises. So, if you pass a mix of promises and regular values, it will resolve with an array containing the resolved values.

Interviewer: Whatโ€™s the difference between Promise.all and Promise.allSettled?
Me: Promise.all stops as soon as one promise fails, while Promise.allSettled waits for all promises to complete, regardless of their outcomes. So, Promise.allSettled is like checking every egg in the basket to see if itโ€™s good or bad.

Interviewer: How does Promise.all improve performance in some scenarios?
Me: By running multiple promises concurrently rather than sequentially, Promise.all can significantly speed up tasks like making multiple API calls at once, compared to waiting for each one to finish before starting the next.

@Diyorbekk_dev
  • โœ 1
  • ๐Ÿ”ฅ 1
Post #901 99
30-Day Challenge: Day 4.

1. Leetcode: โœ…

2. Reading (25-30 pages): โœ…

3. Writing & Reading Articles: โœ… Article

4. Typing & Vim Practice (25-30 minutes): โœ…

@Diyorbekk_dev
  • ๐Ÿ‘ 4
Post #900 92
Challenge boshlanishi yaxshi start oldi.

Challengening 15-kunida alohida batafsil รฒrganilgan barcha narsalar haqida qisqacha tรฒhtalib รฒtaman.

30 kunlikni tugataylik hali katta va juda kuchli challengelar qilishni niyat qilganman.

Va albatta sizlar bilan ham.

Keyingi challengega mukofotlar ham qรฒyiladi insha'Alloh.

Let's keep going โœŠ

@Diyorbekk_dev
  • โšก 4
  • ๐Ÿ‘ 1
  • ๐Ÿ†’ 1
Post #894 94
30-Day Challenge: Day 3.

1. Leetcode: โœ…
Problem

2. Reading (25-30 pages): โœ…

3. Writing & Reading Articles: โœ…
Article

4. Typing & Vim Practice (25-30 minutes): โœ…


@Diyorbekk_dev
Post #891 75
The Importance of Interface Segregation in Software Development

The article emphasizes the significance of the Interface Segregation Principle (ISP), one of the SOLID principles in software development.

ISP advocates for creating smaller, more specific interfaces rather than large, monolithic ones. This approach enhances code maintainability and readability.

Historical Example
The article references a historical example from Xerox. Initially, they had a large Job class with many methods. This class was split into smaller, task-specific classes, which improved the systemโ€™s maintainability.

Applying ISP in React
In React development, ISP can be applied by refining prop definitions. Instead of passing a large object with many properties, you should pass only the necessary props to each component. This makes the components easier to test and understand.

Example Without ISP
// Large interface with many props
const JobComponent = ({
jobId,
jobName,
jobDescription,
jobStatus,
jobOwner }) => {
// Component logic
};


Example With ISP
// Smaller, specific interfaces
const JobDetails = ({ jobId, jobName }) => {
// Component logic
};

const JobStatus = ({ jobStatus }) => {
// Component logic
};

const JobOwner = ({ jobOwner }) => {
// Component logic
};

Avoiding Prop Drilling
Prop drilling occurs when you pass props through many layers of components. This can be avoided by using context or state management libraries like Redux.

Example of Prop Drilling
const ParentComponent = () => {
const jobId = 1;
return <ChildComponent jobId={jobId} />;
};

const ChildComponent = ({ jobId }) => {
return <GrandChildComponent jobId={jobId} />;
};

const GrandChildComponent = ({ jobId }) => {
return <div>Job ID: {jobId}</div>;
};


Using Context to Avoid Prop Drilling
const JobContext = React.createContext();

const ParentComponent = () => {
const jobId = 1;
return (
<JobContext.Provider value={jobId}>
<ChildComponent />
</JobContext.Provider>
);
};

const ChildComponent = () => {
return <GrandChildComponent />;
};

const GrandChildComponent = () => {
const jobId = React.useContext(JobContext);
return <div>Job ID: {jobId}</div>;
};

Conclusion
The article concludes by emphasizing that code should not depend on values it doesnโ€™t use. By adhering to the Interface Segregation Principle, developers can create more maintainable, testable, and understandable code.

@Diyorbekk_dev
Post #890 76
Never be a Consumer.

If you want to get rich, or If you wan to get free.

The path is the same, stop consuming today.

All the losers, in the world are consumers.

All the billionaires, in the world are producers.

All the free people have stopped consuming.

Consumers watch movies.

Producers read books.

Consumers buy stuff that loses value over time

Producers buy stuff that gains value overtime

Consumers always have the newest things.

Producers always have the oldest things

Discipline, persistence patience, never be a consumer.

@Diyorbekk_dev
Older posts โ†’
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’