Похожие чаты

You write js?

35 ответов

20 просмотров

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.

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

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

А кто-то пробовал, уезжая из Эстонии получить э-рез и продолжить вести предпринимательскую деятельность внутри Эстонии, используя свой OÜ?
Lalalashechki Lalala
62
Если у меня есть такой класс: Object = {} function Object:new(a_name, a_transform, a_color, a_mesh, a_material, a_shader, a_textures) local private = {} private.n...
Cuarno Vile
4
I'm new at Monero and I'd like to ask you all - why are you in Monero? I know about privacy but what do you expect to happen in the next years, decades that Monero will make i...
Konrad
18
Is Kadena onto something special? No one really knows. Good luck!
Bright Uncle Stephen EqualBet
40
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
At which price point will BCH, an ASIC mined coin, be succeptible to reorg attacks because of low hashrate? $10? $1? $0.1? $0.01?
Kishniev
18
Гайз, кто-нибудь пробовал запустить probe-rs под камень, которого нет в probe-rs? Мб есть какой-нибудь пример у кого... Через target-gen попробовал сгенерировать chip-descript...
Максим Смирнов
2
зачем же переименовывать ? чтобы кол-во участников возросло или вдруг IBM от этого снова на свифте начнет кодить ? Я не понимаю что страшного в том что свифт гавно, если это т...
Oleh Nerzh
10
2 years ago I bought akt on Bittrex, at that time it gave a withdrawal option to the polygon network. I have read in this chat and they say that akt is not in polygon but if ...
TW
13
здравствуйте. совершаю вот такую вещь: strcpy(line, (char)current_number); где current number — неподписанный шорт, line — массив чаров. ругань следующая: main.c:29:30: error...
Roberto's Ширгозиев
13
Карта сайта