Похожие чаты

You write js?

35 ответов

39 просмотров

among many things

Pythongames- Автор вопроса

Since you are a staunch opposer of oop rite ? so I asked'

Thomas
JS is multiparadigm, but yes

But OOP is not possible in js but ts

D
But OOP is not possible in js but ts

supported in ES2020 or smth. ES5 has weird syntax.

D
But OOP is not possible in js but ts

OOP is possible in both JS and TS, but required in neither

D
Example?

class Foo { dep; constructor(dep) { this.dep = dep; } method() { return this.dep.otherMethod(); } }

ES5 also works: function Foo(dep) { this.dep = dep; } Foo.prototype.method = function method() { return this.dep.otherMethod(); };

Thomas
class Foo { dep; constructor(dep) { this.d...

So you write this boilerplate code w/o interfaces

Thomas
yup, exactly

You need oop for building a robust DI implementation, it isn't that simple

D
You need oop for building a robust DI implementati...

Dependency Injection is not the core feature of OOP

Thomas
ES5 also works: function Foo(dep) { this.dep = d...

do you know if the html messages support syntax highlight

D
You need oop for building a robust DI implementati...

I'm also confused about exactly what you think is missing here? Just interface syntax?

D
screenshot

You can use JSDoc?

D
screenshot

/** * @typedef Hello * @prop {() => void} hello */ class Foo { /** @type {Hello} */ dep; constructor(dep) { this.dep = dep; } method() { return this.dep.hello(); } }

D
screenshot

My first example works like the right hand side of this diagram

D
Yeah, but you miss the builder

Why would you need a builder?

D
Yeah, but you miss the builder

class FooBuilder { static buildFoo(service) { return new Foo(service); } } happy?

D
Factory

explain

Thomas
explain

To alter the type of object to implement

D
To alter the type of object to implement

I think you misunderstood my question entirely

D
To alter the type of object to implement

Why do you need a builder in order to do that?

Thomas
???

Easy of modify code

D
Easy of modify code

More code that provides no extra functionality is always harder to modify

D
screenshot

okay this is for reference.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта