Recently I found an interesting theory, that said that OOP is bad. The author Brian Will is showing many code examples, where OOP will never match the right criteria to solve a real world problems. As an alternative he prefer 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 abstraction of the DOM tReeact, that I developed serval months ago, where useful. 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 re-rendering of the entire application ui. This approach has lead to a great separation of concerns. 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
next time I will tell you why I made this app.