“ECMAScript 2015-2018 simplifies the approach for writing well-structured code”

Share

JAXenter: In your opinion, what are the most important aspects of the JavaScript class system introduced in ECMAScript 2015-2018?

Olga Petrova: The new class system allows developers to utilize all of the advantages of Object Oriented Programming that are common for other languages (like Java, C++, C#, Ruby, Python) but were not available for JavaScript developers for many years.

This simplifies the approach for writing well-structured code and managing the complexity of large enterprise applications. The new class system provides more instruments for web developers to use and I would say it is one of the main reasons why JavaScript has become so popular.

    iJS React Cheat Sheet

    Free: React Cheat Sheet

    You want to improve your knowledge in React or just need some kind of memory aid? We have the right thing for you: the iJS React Cheat Sheet (written by Joel Lord). Now you will always know how to React!

JAXenter: The standard your company had developed differed from the official one. What were the main differences?

Olga Petrova: Sencha has developed its own class system as a part of our Ext JS framework more than 10 years ago, at a time when JavaScript was a prototype-based language. It was a necessary step for us because we needed to provide our customers with a comprehensive tool to enable them to create complex enterprise web applications. Our class system is more advanced than the ones currently supported by the standard specification: aside from inheritance, dependencies and our own build tool (similar to WebPack which is commonly used now) it includes config properties, mixins, and overrides. We found that these last three features bring additional, important value to the class system and they are widely-adopted by our customers.

JAXenter: What were the greatest difficulties you faced in the re-architecting process?

When it comes to the re-architecting process, avoid the use of non-standard solutions if you can. Go for your own custom solution only if it is absolutely necessary.

Olga Petrova: After the wide adoption of the ECMAScript 6 class system we had to re-write our own class system based on the standard class systems. And we needed to find a way to re-implement config properties, mixins, and overrides – features that are not included in the standard. It was tricky to navigate. But new proposed JavaScript decorators seemed to be a perfect fit for this task. We have also used class fields that currently have a state of proposal and are available only through transpilation. We hope that both proposals will be approved soon and features will become a part of the standard.

JAXenter: Can you think of any tips for companies going through a similar adjustment process?

Olga Petrova: The main advice that we can share is to try to avoid the use of non-standard solutions if you can. Go for your own custom solution only if it is absolutely necessary, like it was in our case. And try to estimate the effort you would need to re-write it in advance. Another obvious tip is to encapsulate your custom extension because it reduces the modification time in the future. And always keep your eyes on new technologies and standards, and try to adapt your custom solution to align with industry trends faster.

JAXenter: In your opinion, what was the main takeaway of your talk at iJS 2019?

Olga Petrova: In my talk, I shared our architectural decisions, the technological background that influenced our decisions dramatically, as well as the pitfalls we encountered and the adaptations we made to align with standards used by the modern web community to ultimately re-build Ext JS, Sencha’s web application framework. I hope that attendees learned how to apply this experience and best practices we have learned to their own projects, and that it ultimately helped them navigate a better, more strategic approach that aligns with current technologies to properly build out their solutions.

The post “ECMAScript 2015-2018 simplifies the approach for writing well-structured code” appeared first on JAXenter.

Source : JAXenter