Recently I found an interesting theory, that sais that OOP is bad. The author Brian Will is showing many code examples, where OOP will never match the right creteria to solve a real world problems. As an alternative he prefered functional or procedural programming. His thoughts made be thinking a lot about good software design. And I decided to make a little HTML/javascript app, completely in functional style.

To do so, there are a few rules to follow. The simple ones are “no new and no this.” Next is “let data be data”. In object oriented programming you bind functionality to your objects, but now only plane simple objects get used as you create them using curly braces {}. The objects get used to structure the app-data and to namespace your functions.

Next I thought the abstration of the DOM tReeact, that I developed serval months ago, where usefull. Actually, when rendering a Template, that is happen in pure functional style. That made me render the UI using underscore-templates. tReeact has the Component-system, that let me handle the UI events.

The plan is now the Events will trigger some functions to change the data and course an rerendering of the entire application ui. This aproach has lead to a great separation of consernes. UI is defined in the templates, Events are handled in Components, the logic is implemented in functions, and the models are just plane data in a structured object-tree.

It has shown, that this way to build an app is very effective, the app is showing a good performance and the structure could easily scale to very complex applications.

The application is available at http://tobiasnickel.github.io/ .
next time I will tell you why I made this app.