3 ms·
You need to learn how to deal with dependencies properly. When reading a file it should always be obvious where the dependency comes from. There are a few use
by Kiro 10y ago
You need to learn how to deal with dependencies properly. When reading a file it should always be obvious where the dependency comes from.
There are a few use cases for singletons but using them as globals to avoid passing dependencies around is simply bad practice. Your code is a tightly coupled and untestable mess at its current state.
It's funny that you arrogantly just dismiss every single person in this thread as idiots. You need to take a step back and consider that you might actually be wrong.
- ClayFerguson 10y agoSo it's not obvious to you that 'podcast.open()' is implemented in 'podcast.ts'? There is a naming-convention in effect.
- Kiro 10y agosrch is defined in search.ts so no, that's not obvious at all. Having a naming convention is no reason not to do proper dependency management. This global approach just obscures things and makes it untestable.
- ClayFerguson 10y agohaha. There is ONE variable that violates the naming convention. srch!=search.ts. I had a reason for doing that but just never changed it back. The code will easily convert to modules if I ever decide to. For now I'm just keeping it simple. (i.e. no circular-reference risk, etc) It's easy to throw rocks at a design, but if you spent a day working in meta64 you'd realize how intuitive it is. Obscure is never the word you'd use.