24 ms·
I'm not talking about namespaces. I mean stuff like "srch" in https://github.com/Clay-Ferguson/meta64/blob/master/src/main/resources/public/ts/panel/timelineRes
by Kiro 10y ago
I'm not talking about namespaces. I mean stuff like "srch" in https://github.com/Clay-Ferguson/meta64/blob/master/src/main/resources/public/ts/panel/timelineResultsPanel.ts https://github.com/Clay-Ferguson/meta64/blob/master/src/main...
Also, singletons are simply bad practice so that's just another sign that your code is far from "state of the art".
> Yes it's inverted from the way the rest most people are still doing it, but what I'm doing is the future.
Of course you consume JSON through a REST API and let the client handle HTML generation when building an SPA. "The future" you're speaking of has been industry standard for 10 years. Nothing radical or innovative about it. How do you think React, Vue or Angular work?
- ClayFerguson 10y agosrch is namespace: I think it was about line 8 in this file: https://github.com/Clay-Ferguson/meta64/blob/master/src/main/resources/public/ts/search.ts https://github.com/Clay-Ferguson/meta64/blob/master/src/main... That's funny that you don't like singletons. Not sure how you got brainwashed about them, but they are good and VERY widely used today by all major codebases. Singleton is literally the "default scope" for all Spring Beans, so you are so completely clueless about that.
- Kiro 10y agoYou 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.