I have to make sense of a codebase I was given on my new job. I can see many anti-patterns here, one of them is a "god object", which contains a lot of things and different object access it all the time. That's a different problem, my question here is about the fact, that some objects access its members using '.', others do it via [], for example
GOD.meow.woof()
in one source file and
GOD['meow']["woof"]()
in another.
I know javascript deeply enough to realize that there is no difference whatsoever. Or is there? git blame
shows me that both sources were written by the same person, so it has nothing to do with style. On the one hand, what can you expect from a person, who don't hesitate to create god objects, on the other hand maybe he was in a hustle and eventually didn't have time to repay this technical debt, we'll never know.
Is it possible that using the latter method of access is safer in any way? Your opinions are welcome, fellows, before I launch my inner refactoring ninja.