I happen to code websites for 18 years now and, understandably, the patterns of web programming are deeply ingrained in my daily geek habits.
When I first started to code for the blockchain - a little over a year ago - I faced quite a few hurdles. Many of the stemmed from the fundamental differences between these two coding paradigms.
What follows is a short description of my transition experiences.
In a web app, all the app functions are performed on the server, remote. Take authentication, for instance. In a traditional web app, you have a database on a server, holding user accounts. All account related activities will happen on the server: signup, login, logout, etc.
In a blockchain app, there is a significant separation between the user related functions and general data storing and retrieving functions. For instance, it's quite common in a blockchain app to sign a transaction locally (even offline) and then use a node to broadcast it. The cryptographic nature of the blockchain led to an increased separation of the functions and segmentation of activities.
Because in a web app everything is centralized, you do all of it in one place. In blockchain, you can post your data to a node, and retrieve other sets of data from another nodes. This may be mimicked in a web environment too, but with a huge overhead.
So, if you approach a blockchain app with the same monolithic view inherited from your web programming days, you'll probably have a hard time adapting.
One of the most ignored perks of the blockchain is that it comes with a 100% uptime and immutability guarantee. Once a transaction has been approved, then all the nodes in the blockchain will hold the same copy of the data and it's almost impossible that all of them will shut down at the same time.
This is an amazing achievement, from a programming point of view. Many programmers strive to achieve this in their apps and, without a significant amount of money poured into redundant hardware, you can't really make it. Because everything is in one place, you get a single point of failure, which, sooner or later, will fail.
Decentralization forced blockchain programmers to find ways in which data should stay identical on all instances, hence achieving immutability. It also created the incentive for providing computer power and storage, hence achieving 100% uptime.
In a web app, you have only one type of clients: web browsers. There isn't much going on in the browser, although recent advancement in JS allowed the one-pager apps to gain a bit of exposure (think Angular JS or React). I call these clients "invisible clients", because almost all the processing is still happening on the server.
In the blockchain, the paradigm is shifting towards what I call "independent clients" or clients which are taking care of a few crucial features like authentication and transaction signing. Because an account in a blockchain is just a pair of cryptographic keys, you can "pinch" into the blockchain from everywhere, and the blockchain will not even be aware of that. It's like you can design a blockchain client in Java, or in Java Script, or in Objective C, or even as a hardware device. Wait, there are already such clients (Trezer, Ledger One).
But not all is good. Perfection is yet to be attained by humans, so every good thing usually comes with a few of not so good things. In blockchain, we lost the ability to instantly index and access complex sets of data. Traversal of the hierarchical structures of the merkle trees is costly, so many blockchains resorted to a mixed approach: for the consensus layers they will use the merkle trees, but for selecting and filtering the data they will resort to traditional SQL databases, "fed" in real time by the blockchain. This is a bit of an overhead and it also gives a low factor of indexability to the blockchain.
Another problem in the blockchain - becoming more and more apparent as the community grows - is the storage space. For Steemit, you need now more than 200GB of SSD storage. Some mechanisms of sharding must be implemented, and should be implemented at the consensus level, otherwise the blockchain will crush under its own weight. This is different from the web paradigm, where you would just stick in another hard disk and solve the problem.
Obviously, not.
I think web apps, with their centralized approach, are still going to be around of a while. Because there are some problems they are solving better than blockchains, which are more suitable for apps relying heavily on consensus and transactions.
But in the medium and long term, enhanced blockchains could substitute web apps entirely, provided all the compromises above are solved in an elegant way.
I'm a serial entrepreneur, blogger and ultrarunner. You can find me mainly on my blog at Dragos Roua where I write about productivity, business, relationships and running. Here on Steemit you may stay updated by following me @dragosroua.
You can also vote for me as witness here:
https://steemit.com/~witnesses
If you're new to Steemit, you may find these articles relevant (that's also part of my witness activity to support new members of the platform):