Five ways to reuse code
What is code re-use?
Code reusability is the use of existing code to build new software applications.
The existing code may be reused to perform the same function or may be re-purposed to do a similar but somewhat different function providing for efficiencies, cost savings, adherence to standards and improved overall quality.
The availability of web APIs, web components, microservices and other technologies assume and allow for reusability. However, for a web or mobile application developer to best make use to the available technologies a mindset of architecting the web or mobile application up front is important.
These are five considerations to optimise code re-usability:
1. Selection of the appropriate front-end web component architecture
Component-based frontend architecture is a new fashion in web development. React does it, Angular, VUE.JS use this approach as to other trending frameworks.
2. Use of an object-oriented approach
While object-oriented programming has a long history, the approach and design aspects are relevant for planning a web or mobile application with elements to be used for similar tasks. A good discussion of the currency of the concepts:
3. Designing with modular logic
Each code module should be granular for a singular responsibility. This is the idea of structured programming at a component level. With the full application design, the consideration of the smallest task – that is merely a tool or component and independent as an entity. A primer on considerations can be found here.
4.Using code templates vs. copying, pasting and then modifying code
There are open source options and products that are certified that offer options. Templates offer efficiencies. One should take into consideration: capabilities; certification; ownership of / customization of the template results. Templates vary from API list generations to code generators with varying features, and limitations.
5. Planning the documentation first
Facilitating a structured and modular approach to the application code. A good overview of how to create good documentation can be found here.
These are just highlights of some considerations. As a SaaS tool for developers, "Generato" makes software development more efficient and ultimately more cost-effective by first creating applications visually and then generating them repeatedly with code templates. Generato's regenerative approach is language and framework independent and aims to support developers in the best possible way - not replace them.