We Need Better Languages, Not More Frameworks

We tend to think that programming languages are getting smarter every year. But do they? Many people also believe that the endless stream of open source frameworks makes us more productive. But is that the full truth?

It’s hard to measure productivity. And, of course, we can produce more beautiful and bigger systems than ever before. It can however still take a considerable amount of time to build something like a business input form based on an underlying database model. Why is that?

The answer is in what our current languages actually do for us—or rather, what they don’t do for us. Besides basic arithmetic and logic operators, they manage objects in memory and make sure we can call methods from other methods. Sure, most languages can do a lot more, like closures, immutability, generics, co-routines, and so on. But all these features are just there to make programming easier, safer, or more fun. They do not contradict my basic premise that most languages today just process code to manage data in memory.

It becomes interesting when you ask yourself what we use these languages for. In any typical business or web application, we write and query data to and from databases; facilitate communication between client, server, and external systems; and do some business logic. Business logic can be as complex as you want it to be—it can check constraints, do complex calculations, or concern very specific queries. But on average, those business logic functions do not make up more than, say, twenty percent of the total. That’s because most of the code we write is meant to handle data communications with the outside world.

I purposely use the term “business logic” in a very restricted way here. I do not regard as business logic the one-to-one passing of data from the database to the caller of a service method. Most service methods are just frozen queries (or updates) transforming data from one format into another. And even in a client, we can spend a lot of JavaScript to pass data from one place to another. That’s not business logic, and we have a term for it: CRUD (create, read, update, and delete). We typically need these basic operations for most entities and attributes because it makes sense for most data that we want to keep track of. Today’s data processing systems are less about processing and mostly about communicating data back and forth between users. Doing nonstandard queries, making calculations, or segueing between screens based on certain conditions: that is real business logic.

To put this into perspective, we should look beyond current mainstream architectures. In the nineties we had fourth-generation languages (4GL) that had a native interface with the underlying database. Instead of calling an API to execute a handwritten query, we could just refer to tables and columns to get things done. It was even possible to define screens in terms of the underlying data model, automatically handling common use cases. True, these two-tier environments were not perfect and gave way to the three-tier services-based architectures that we tend to use today. But some are still in use, and they prove the theory that a programming language does not have to limit itself to managing internal memory.

But wait! We have frameworks, don’t we? They can make things easier, so we can write less code. Especially since the advent of the Internet and open source, an almost inconceivable amount of creative effort has been put into the thousands of frameworks and libraries out there, and some frameworks do pretty well. They help us implement services, load and submit screen forms, access databases, and other important stuff.

The problem is that frameworks won’t help you get rid of the eighty percent of source code that do not actually fall under business logic. They help you glue things together, but because all data is still passing through all layers of an application (assuming an SOA architecture, of course), we still have to glue the frameworks to each other.

We do all that secretly knowing that most of the code we write can be derived from the conceptual data model of the given system. Adepts of model-driven development (MDD) know that. But they have their own problems because they tend to use code generation, which indirectly keeps them stuck in third-generation languages and frameworks like the rest of us.

There is a saying: “Don’t try to fix the language.” It was used to criticize people building stuff, especially in C++, who distanced themselves so much from the underlying language that they eventually made things more complicated than they were to begin with. I think we can apply that saying to some of today’s frameworks. Although some do an amazing job, they cannot fundamentally extend the language with better abstractions. Frameworks were never able to really add garbage collection to a language. They can use tricks to help us with asynchronous behavior, but they cannot add real co-routines without the compiler’s help. By the same token, you cannot add persistency awareness or something like native communications to a language that is concerned only with internal memory.

What we need is better languages.

Not better in the sense of steeling features from languages invented in the sixties and seventies, which seems to be a popular hobby these days. All that does is change how we humans interface with the language.

Instead, we should develop new abstractions that make languages aware of their inescapable surroundings: databases and client-server communication. I know we might need some research here, and it may sound challenging. But if we do this better than in the nineties, there is huge potential to boost the productivity of application developers like never before, while at the same time improving reliability, maintainability, and quality. Let’s start thinking today.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Up ↑

%d bloggers like this: