This is not a good example of why oo is better than procedural.
The procedural example above is not how I would write procedural.
Bad code is caused by bad code organisation, not whether its oo or procedural.
I would organise my procedural code in its own block, wrapped in it's own namespace so you could access it like:
myModule.doSomething()
myModule.model.globalVar = ''
etc
↧
Re: Ask Dan : Procedural VS object-oriented in javascript
↧