What is Dependency Injection?? #coding #programming #javascript #developer #softwaredeveloper

preview_player
Показать описание
The basics of Dependency Injection
Рекомендации по теме
Комментарии
Автор

Only problem with JS is that here logger can be anything.

Radju
Автор

Now you need to remember all the dependencies when instantiating unless you have another bulky framework to auto resolve them. Just use a singleton class, get the job done and get paid instead of making it 10 times harder to work on in 6 months time. I hated this in Laravel having to make a ton of other things where a singleton or simple construction would work.

These SOLID/AGILE/etc principles are all well and good but don’t half slow things down and create cost cycles.

I recently got dragged in to help a client finish a 3 year overdue project - the first thing I did was kick out agile, banned pair programming, put a team on making unit tests for critical stuff and watched the bug list diminish in 8 weeks. Nice fat cheque thank you very much.

I saved jobs as part of it as the company was about to fire the entire dev team and bin the project and outsource it overseas.

Not saying they don’t have uses but when form and methodology gets in the way of progress bin off the trendy approach. If its an internal closed system stop writing it like its open source that millions will integrate.

jamesrbrindle
Автор

Im really confused.

Why does instantiating a new logger mean that Logger.log() will fail if Logger adds a new feature or changes how it works?

mikehill
Автор

The problem is it is written in JS LUL

idk_who_am_i
join shbcf.ru