神刀安全网

Declarative programming is a dead-end for the lowly programmer

Most programmers focus on software execution. We want to understand what the computer is actually doing. Java, C, JavaScript, PHP, Python… all these languages make it easy to build any software you like. In these languages, even at the very beginning, you are truly in charge. They are like hammers, screwdrivers, nails and screws… they don’t know how to do much, but if you are skilled, you can do what you want.

Opposed to this view are declarative programming languages. SQL is maybe the best known. On the web, we have HTML and CSS. And you have regular expressions. These languages are more like entrepreneurs. They won’t let you touch the tools directly. They are telling you “tell me what is needed, I’ll do it”.

That’s why people who only do HTML and CSS, or only SQL, are often not considered “programmers”.

Nevertheless, I think we can agree that HTML and SQL are pretty useful ideas. But like all declarative programming languages, they are dead-ends for the lowly programmer. What you see is what you get. It is hard to extend them meaningfully. I don’t mean that they can’t be extended, but they are typically only extended by people with enormous resources like browser makers or database vendors. This makes sense in the spirit of these languages: you are meant to delegate to the language itself.

When you first learn a language, say JavaScript, you might realize that it has missing features that you need for your domain. For example, JavaScript does not know anything about video games. Neither does SQL. JavaScript does not really have a concept of “library” or “extension package”, but people have still written lots of software libraries to make it easier to write video games in JavaScript. No such luck with SQL.

HTML and SQL have become enormously sophisticated over the years. They are truly powerful tools. But they mostly are as they are.

It is a problem because interesting programming projects are about new unsolved problems. And these mostly get solved by people using non-declarative languages.

If you are interested in a new emerging discipline like data science, and you know how to program in Python, Java or R, you can build useful software packages. If you publish them, others might use them and extend them. But if all you know is SQL or HTML, you are stuck with what these languages provide you.

Credit: This blog post was inspired by an offline exchange with Antonio Badia. The opinion stated here is mine alone however.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Declarative programming is a dead-end for the lowly programmer

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮