originally posted on my personal blog
This will be a personal post about how I would like to see the web development in the near future. However, I will not simple say this should like that because I like it better, but will try to reason about behind that.
With the introduction of Progressive Web Apps it is clear that the web applications should in the future replace the native applications. But, not quite at all. Technologies such NativeScript, ReactNative, ReactVR and a large renderers have teach us that the web development is not just about a browser, but instead this could be renderer by any kind of technologies.
This leads me to believe that web technologies will allow us to develop any kind of application in any kind of platforms, current or future.
Web languages was not created for any of the current applications, for that reason several other technologies and languages was create to allow a better development environment for the web, such Typescript, JSX and CSS-in-JS to name a few, but top used of that new technologies.
The browser itself haven't change much over the years. Of curse, web languages have become standardized and browsers now implements features for that standardizations, and new standards have allow us to develop with new features, but at the end, we are developing with the same languages, and the same syntax, to be interpreted in the same way. We are developing for a 25 years old system, and we have to maintain it.
I think that new web technologies need to be created, standardized and replace the current ones. We need to keep all the good things that we currently have, learn from the bad things, and apply the ones that the community have embrace over all these years.
There is essentially nothing bad with HTML, but we need to start noticing the importance of a good write program. HTML was create to write simple elements,
with a predictable syntax, and I don't think we have that anymore. With libraries such Angular, React, and Vue, and future features as Web Components, we are no longer written simple elements, and by any reason we have a predictable syntax. We need to know the properties that the elements needs, and how they will be applied.
HTML is a really simple to learn, and with that we could develop a skeleton application in seconds. The syntax is simple and play nice with other templates engines, such ejs, and other languages, such PHP.
We need a simple way to define custom elements and isolated templates. The way Vue define templates is really simple. I also like the way Angular consume templates, even when a template could be potentially used by many components, most of the times an Angular template is used by a single complement. Also, this new language have to be used for templates engines, and other languages without much effort, and have to be simple and effective.
HTML as is, is a great language. However, I think that this language have to evolve, and stop being a XML extension to become a complete language on its own, one that allows to grow, but also to keep backward compatibility with older implementations of the same language. Also, needs to have some template logic operations on its own, a syntax capable of be integrated with current and future languages, and maintain isolation.
I think a QML inspired language could be really good for the web. The tree structure that QML manages, resembles HTML, but its mean to be written for complex applications and to handle custom elements. It doesn't have to be QML as is right now. For me, this is just an idea, but I think we really need a markup syntax made for current applications. One more thing that I would like to see in this language would be typed attributes, and a simple way to define them in new components.
As with HTML, there is nothing really wrong about CSS, it is a simple language to learn, but is really hard to master it. Also a couple things that needs to be improved. One is the need for a way to apply isolated style in custom components, and restyle that components easily as well. And if you are thinking "Shadow DOM have that", yeah, it does. But Shadow DOM is still an experiment, and the specification is being developed, with several things being dropped, and replaced. Let's face it, adding a new feature to CSS is too slow, and even when we have it, we need to wait until majority of browsers could support it, and prefix the properties with the vendor name for properties that are not standardized.
And that leave us with the second thing to be improved. The current way to bring new features to older browsers is to polyfill them. CSS is really hard to polyfill, and effectively unviable.
Like HTML, CSS is a really simple language, that can accomplish complex thing.
As I said, is easy to learn, and most of editors have autocomplete capability.
We could learn as much as SCSS let us to learn. I formerly thought that SCSS stands for Super CSS, I know, I know. I was just beginning in web development, but can you blame me? The syntax is identical to CSS, and it allows to nest selectors, apply mixins, use variables, and many other things. SCSS have become in many case the standard way of develop web styles.
The new language for apply styles in complex applications should resemble CSS, with the features that SCSS allows us to have. What I'm saying is, the features that SCSS allow us to have should be standard. Needs support for better cross file references.
I think it needs some standardizations of the currently spec, including the initial value of the rules, and a standardized unit value, that would display nice in every device, and I not talking only about web consumer devices, but other renderer engines should display the same structure identical. In deep, it needs to be able to play nicely in older implementations of that language, and a simple way to polyfill when it need.
New features such spread operator, decorators, template strings, and others, have show us that a language needs to evolve from what it is to what the community wants.
Well, now that we are dreaming, we could deprecate keywords such
var, and operators like
=== in favor of the new syntax
const, and simple
== without any casting. I would even say that
const should be able to store a constant object and function, in which the assignment of new values for any of its properties, recursively would be impossible.
classes would be classes for real, and could be written as any other class in other languages.
interfaces would be a real thing that you could check in runtime. And several others features that would result in a better language.
The language would still the same function first language, with the nice syntax, optional typing, falling back to our dear
any type when there is not assignment or type declaration. Well, if we still have any type, there should be a type transformation when dealing with equality, right? Not exactly. Even when the type is not specify, the variable still have a type when gets evaluated, that is somewhat the current behavior with triple check equality.
The web applications are not compile for an operative system, nor they run on top of a virtual machine, they are run inside of a browser. But they can be compile for an operative system, and the could run on top of a virtual environment, and they could be used to program servers, and robots, and any kind of things now.
What is really good about the web applications, there are just developed using standards. You may notice that I use that word a lot along the post, and the reason is because Web as we know it, is just a complex series of standards, that can be implemented in anyhow, by anyone, anywhere. To do so, you just need to properly implement the current specifications about the technologies you want to use, as best as you can, and you can even decide what to do in things that are not properly describe. I think that is beauty. I think that is the future.
Maybe not in a year, maybe not in two. But sooner than latter, native web applications will be in our lives, they will behave like any other native application that we currently have, and will perform likewise. I'm not talking about Cordova, or NativeScript, but deep integration of web applications with the operative systems.
New operative systems that will only need to implement web technologies to be usable, and new web rendereres in devices we only dream now.
Applications will be develop like back in the days, when I didn't actually code, with a language for a feature, without bundlers, transpilers, or anything that we currently have. Because we will learn from what we have, and evolve.
If you really read all this, thanks you. It's a really long post, and it's very opinionated. I would like to read in your comments, how you imagine the applications development would be in a couple years.
The software industry moves fast. But if you keep up, you can have an incredible career.
This series of posts document a high-level process to use when planning a modern web application, from project organization, collaboration considerations and tooling choices during development, all the way through deployment and performance strategies.