blog

Phava, by bunq

June 26, 2015

We talk to people from all walks of IT. We're constantly explaining what we're doing. A funny thing that we've noticed is that the conversation always ends in the same epiphany:

"Wait a minute. So if I understand correctly, you are doing Java in PHP?"

Yes

Wait, but why? Why in God's name?

To answer why, we need to explain what's good about Java. Java started out circumventing the complications that C++ had, such as multiple inheritance and other crap. C++ is furthermore difficult to read and therefore difficult to maintain over a longer period of time. Java goes around this by being truly object oriented. Other great things about Java: universities ram it into every student they can get their hands on and there are loads of libraries available. 

So, if Java is that great - why not simply use it then? Oracle added the label 'Enterprise', which as a result made the language bloated - too many unnecessary additions. Bloated software only works for lawyers, that have to read, correct and meddle through all the 14,000 pages you have to sign off on with every release. 

So why is the P of Pro in PHP then? Three reasons. 

1. Super super rapid development. You change something and presto, the result is there - no compiling required. Compiling takes at least 15 seconds of your time with every change. 

2. Readability. The code is so simple that even non-coders can read it. Incidentally, that's also how PHP got its bad name. It was so easy to read that non-coders started making crappy code. Loads of prejudices that surround PHP ("not secure", "not scalable"), stem from badly written (existing legacy) code bases.

3. Single threadedness. Multithreadedness results in race conditions, which are hard to predict: our brains are inherently just not capable of foreseeing them. PHP doesn't have that pain. 

In short, with PHP we get to do object orientism while keeping it simple.

PHP has its disadvantages though.

1. $variable can basically mean anything. It can be a string, a number, an object. It's a loosely typed language. That is why we use objects for everything, which counters the disadvantage of $variable freedom.

2. Fatal errors. Fucking fatal errors. 

Conclusion? We pick the best of both worlds. Phava. Object-oriented PHP, that has 95% of the niceties of Java while cutting away almost all the shitty things of PHP. This way we have object oriented thinking, fast prototyping and great readability. Our devs love Phava, external auditing parties love it ("where did you buy this, we want to recommend it to others!") and best of all, we develop at lightning speed.

Let's get a move on! Beep beep

- Djoeri