Telegram Web Link
🧩 10 травня о 15:00 стрім «Мінімум патернів для максимуму користі у реальному проекті»
Deep dive into 5 most useful patterns: Strategy, Factory, Pool, Queue, Adapter
👉 https://patterns-js.com/p2brao?utm_source=telegram_channel&utm_medium=t_shemsedinov&utm_campaign=stream_10_05
👩‍💻 Can you explain difference between FinilizationRegistry and Explicit resource management?
This week topic for Node.js 2025: Disposable objects
Examples: https://github.com/HowProgrammingWorks/Disposable
Please open Telegram to view this post
VIEW IN TELEGRAM
'use strict';
// node.js 24 required

const fs = require('node:fs');
const timers = require('timers/promises');
const { Console } = require('node:console');

class RefCount {
#resource = null;
#dispose = null;
#context = null;
#count = 0;

constructor(create, dispose) {
this.#dispose = dispose;
return this.#init(create);
}

async #init(create) {
const { resource, context } = await create();
this.#resource = resource;
this.#context = context;
return this;
}

use() {
console.log('👉 Use');
this.#count++;
const disposable = Object.create(this.#resource);
disposable[Symbol.asyncDispose] = async () => {
console.log('👉 Dispose');
this.#count--;
if (this.#count > 0) return;
await this.#dispose(this.#resource, this.#context);
this.#resource = null;
this.#context = null;
};
return disposable;
}
}

const main = async () => {
const logger = await new RefCount(
async () => {
const file = './output.log';
const stream = await fs.createWriteStream(file);
const resource = new Console({ stdout: stream });
console.log(`👉 Open: ${file}`);
return { resource, context: { file, stream } };
},
async (resource, context) => {
console.log(`👉 Close: ${context.file}`);
await context.stream.close();
},
);
// Block 0
{
await using console = logger.use();
console.log('Log 1');
// Block 1
{
await using console = logger.use();
console.log('Log 1');
}
// Block 2
{
await using console = logger.use();
console.log('Log 2');
}
await timers.setTimeout(1000);
}
};

main().then(() => {
console.log('After main');
});

Repo: https://github.com/HowProgrammingWorks/Disposable/blob/main/JavaScript/7-ref-count.js
✔️ Software Structure & Architecture 2025

У новому курсі записано вже 19 лекцій:
1. Introduction
2. Layered (onion), DDD, Clean architecture
3. App structure, Modularity, DI, unittesting
4. DTOs, models, race conditions
5. Hexagonal Architecture, ports and adapters architecture
6. Clustering, Parallel, Distributed systems, CAP, ACID, BASE, Locking, CQRS
7. Actor Model
8. Databases, data modeling
9. Domain Specific Languages: DSL, AST, LISP
10. Command, QueryObject, CQS, CQRS, EventSourcing
11. Messaging: MQ, Pub/Sub, Pull
12. System integration and topology: API, bus, brocker, MQ
13. Communication styles: data, call, event, log sync, p2p, blockchain
14. Feature-Sliced Design
15. Architecture for Web: DDD for Frontend and Backend
16. Data access patterns
17. Asynchronous programming
18. Imperative shell, Functional core
19. Multi-paradigm programming in Architecture
20. Metaprogramming

Влітку вийде у такому складі, але восени із додаткових тем ще 10 переїде у основний курс.
Слідкувати за станом справ можна тут https://github.com/HowProgrammingWorks/Index/blob/master/Courses/Architecture-2025.md
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
👩‍💻 Поки не спав, зробив вам ще прикладів:
- монадичні обчислення у синтаксисі класів
- монадичні обчислення у синтаксисі прототипів
- монадичні обчислення у синтаксисі замикань
- монадичні обчислення з універсальним контейнером
- ізоляція виводу у монаду IO
- ізоляція читання та виводу у монаду IO
- ізоляція читання та виводу + універсальний монадичний контейнер
Examples: https://github.com/HowProgrammingWorks/Paradigms/tree/main/JavaScript
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
👩‍💻 Added more paradigms and code styles: event-driven (6 styles), traits and ownership (Rust-inspired) just as a concept:
https://github.com/HowProgrammingWorks/Paradigms/tree/main/JavaScript
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Тупеем от LLM? Та не, мы от Stackoverflow и Search engine уже отупели, и уровень не упадет ниже, потому, что мы тренируемся находить виноватых в факапе спринтов, сремся в интернетах, в унитаз целимся и попадаем... иногда
2025/06/27 16:28:16
Back to Top
HTML Embed Code: