Wednesday, July 31, 2013

Languages and databases - a step back a day

I've started to learn the Go language recently and to be frank I'm horrified. Horrified by the way the future of programming looks like and the NoSQL movement just making it worse.

Languages - a step back

If you haven't read any Fortran code yet, do it by any means. It's a language that was invented in 1957 when 'computers' were practically non existent. However, if you look at it more than 50 years later it's still readable and not really ugly - especially compared to some C++ code...

Then we had Python, Ruby, Java, C# and all sorts of modern languages. In fact, we have a new language born almost every day (have you heard about Rust for instance?). The only issue with them is that the programming model hasn't really changed in the past 50 years. We write text files, line by line, instructing the computer what to do step after step. The processors didn't really change much either unfortunately.

And the horrifying part? Google comes along, creates a new language (Go) and makes a big hype around it. And they are really good at making hype around things. As a result people think that this is the future, that finally this is a solution to our problems! Did you say you wanted a nice IDE to work with? Sure, you can use Vim or Emacs! Or wanted a great debugger? GDB is the perfect solution! How about inheritance? Event handlers? Lambda expression? Language integrated queries? Generics? Annotations? You don't need them, right?

How about a language that is not a stripped down version of other great languages? Go is great, it's readable, it compiles to native code and usually the code is faster than Java. Hurray! Oh, your site has like 10.000 impressions a day? That's less than 1 request per second if distributed over 8 hours, or 3 request a second if you have a spike for an hour! What framework cannot handle that? Even if you have 100.000 impressions in an hour it's still just 30 request per second. It's practically zero for any kind of hardware and software framework today but it would already be among the biggest sites out there.

But no, let's invent a language that fits our specific purpose and shove it down everyone else's throat. But wait a sec, why not actually evolve a language? Not strip it down but to make it THE next big thing? How about a language where I don't have to write boilerplate ever again? Where validating a field from front-end to backend does not make me write code again and again? Where I don't have to think about threads and mutexes when writing distributed code? How about not writing for cycle every again? Or not bothering with connection strings again? And forgetting about beginning and ending transactions? Because these are the actual problems developers are working on every day.

NoSQL - the NoSolution

And this brings us to the next big issue, the NoSQL movement. Just because a handful of companies are dealing with data volumes that cannot be handled by relational databases, it does not mean everyone is. But everyone seems to think it's the best storage idea ever. However, before you jump in, make sure you have a look at what functional complexities these companies struggle with! A wall post? To upload a photo? To synchronize your plain text notes? Now check what complexities an ERP system is dealing with.

But again, when several parties criticized Google for this not-relational approach, they arrogantly responded: "it works for us". Sure it does, because you can invest thousands of hours/weeks/years of engineering time in creating a simple web application. Or just to add a new field to an existing one. Or create a new report. Oh, creating a new report needs a new data structure? Well, it works for you, not for me!

How about inventing the next big thing in databases? Where I don't need to map my fields to columns, where I could compile my code against the database to eliminate 99% of useless integration test? To have the ability to create reports with ease? To never bother with change scripts again?

We think we got it right - so we are stuck

The really horrifying part of all this is that the 'average Joe' developer does not know anything about all this. He's happy copy-pasting code from Stackoverflow, day in, day out. Meanwhile the 'top of the game' developers are just mesmerized by all the latest-and-greatest ideas from companies that do very different things from what they do.

However, if we get stuck and keep thinking that the way forward is a dumbed down language and database that is as smart as a text file, we won't see much progress any time soon. Actually, we haven't seen that much since '57 either...

Given that you don't need just to follow other ideas, do you think it's all going in the right direction? I do not.

1 comment:

  1. For the first time, I've seen an honest and frank opinion. I am fed up with people drooling all over it singing its hosannas. Its a low level language...meaning less productivity. Hard to keep things DRY...meaning less maintainability. Go rules out some of the other programming constructs which have proven useful - inheritance...out the window, why, because its not needed. Well, I find it useful that sometimes in nature you encounter an "is-a" relationship. Employee "IS-A" person. Employee will NEVER "HAVE-A" person. No generics, silly error handling -- and it goes on.

    ReplyDelete