Translate

Friday, April 2, 2021

Angular vs. React vs. Vue: Which Framework is Best in 2021?

 Source: https://dzone.com/articles/angular-vs-react-vs-vue-which-framework-is-best-to

One is a UI library (React), another is a seasoned front-end framework (Angular), and the youngest among them (Vue) may be termed as a progressive framework.

  · Web Dev Zone · Analysis

You may be a React developer, a Vue developer, or an Angular developer specializing only in these technologies. Still, you cannot ignore the constant comparison that the development community keeps making. And for good reason. One is a UI library (React), another is a seasoned full-fledged front-end framework (Angular), and the youngest among them (Vue) may be termed as a progressive framework. Each of these possesses some unique benefits and performance metrics that compel people to analyze the three.

Each of these frameworks is component-based and facilitates the rapid creation of UI features. They can be used interchangeably, well, almost for building front-end applications. However, they are not 100% the same.

This is why we decided to create a short guide for you but, most importantly, a structure for you to help decide on technologies in the future as well.

Let’s dig in.

License

As obvious as it may sound, make sure to thoroughly check its license before using an open-source framework or library. Luckily, React, Angular, and Vue all use the MIT license, which is bliss because it provides limited restrictions on reuse, even in proprietary software. However, always go the extra mile and understand the implications of the license before using any framework or software.

Architecture

Angular

Angular framework belongs to the MEAN stack, which is today the hottest technology stack for startups. Angular is a complete framework for web application development based on TypeScript and is mainly used for building single-page web applications (SPAs).

Unlike AngularJS — the original framework, Angular 2 doesn’t have a strict association with MV*-patterns because it is component-based. The way Angular is structured, there are Modules, Components, and Services.

In the Angular framework, each component has a Class or a Template that defines the application logic and MetaData (Decorators). This metadata of the component provides guidance about where the building blocks needed to create and present its view are.

Another important factor in the Angular architecture is that the templates are written in HTML. They may also include Angular template syntax with special directives to output reactive data and may render multiple elements.

Services — a distinct element of Angular applications — are used by Components for delegating business-logic tasks such as fetching data or validating input. While using Services is not strictly enforced, it is always wiser to structure apps as a set of disparate services that are reusable.

React

React is an open-source, front-end library primarily used for developing user interfaces. This flexible front-end solution doesn’t enforce a specific project structure. A React developer may start using it with just a few lines of code.

React is based on JavaScript, but for the most part, it is combined with JSX (JavaScript XML), which is a syntax extension that allows a developer to create elements containing HTML and JavaScript at the same time. Effectively, anything that a developer can create with JSX can also be created with the React JavaScript API. React Elements are more powerful than DOM elements and are the smallest building blocks of React apps.

React components are building blocks that determine independent and reusable pieces to be used throughout the web application.

Vue

Used for developing user interfaces and SPAs, Vue is an open-source Model-View-View-Model front-end JS library. Called a progressive framework, it is used with other tools for front-end development. Vue’s popularity is owing to its versatility, high performance, and its optimal user experience on a web application.

With Vue, a developer mostly works on the ViewModel layer to make sure that the application data is processed in a manner that allows the framework to render an up-to-date view.

Vue’s templating syntax combines recognizable HTML with special directives and features. The syntax lets a developer create View components.

Now Components in Vue are reusable, self-contained, and small. The SFCs or Single File Components with the extension .vue have HTML, JavaScript, and CSS so that all the relevant codes stay in one file.

In larger Vue.js projects, SFCs are usually recommended to organize code. To transpile SFCs into working JavaScript code, you need tools like Webpack or Browserify.

Purpose and Scope

Angular

Angular is best suitable for large-scale and advanced projects. These may include but not be limited to: 

  • Developing Progressive Web App (PWA).
  • Redesigning of a website application.
  • Building dynamic content-based web designs.
  • Creating large enterprise application that needs complex infrastructure.

React

React comes from the family of the MERN stack — a technology stack known for building sophisticated business applications. React becomes a powerful tool when used along with Redux or MobX, or any flux patterned library. React is best suited for the following projects:

  • For applications that involve many components with navigation items, collapsed/expanded accordion sections, active/inactive states, dynamic inputs, active/inactive buttons, user login, user access permissions, etc.
  • For projects that have scope for scale and growth because React components have declarative nature that makes way for easy handling around such complex structures.
  • When UI is the center of the web app.

Vue

Vue is best suited for solving short-term problems because Vue has an affordable and quick learning curve. It can integrate with existing code blocks easily.  Vue may be required when:

  • You need development projects of web apps with animations or interactive elements.
  • Prototyping without the need for advanced skills.
  • Applications requiring seamless integration with multiple other apps.
  • Faster launch of MVP.

Performance and Development

Angular

Some highlights in Angular’s performance are:

  • Has seamless third-party integrations for enhancing the functionality of the product/application.
  • Provides a robust collection of components leading to simplified art of writing, altering, and using the code.
  • Its 'ahead-of-time-compiler' bestows faster load times and security strength.
  • The MVC model helps in curtailing queries in the background by allowing separation of views.
  • Facilitates the use of dependency injection as external elements for decoupling components that make way for reusability and ease of management and testing.
  • Reduces the initial load time of a webpage by splitting the tasks into logical chunks.
  • Fully customizable designs.
  • Facilitates the compiling of HTML and TypeScript into JavaScript — leading to the faster compilation of the code much before the browser starts to load the web app.

React

React is comparable to Vue when it comes to performance because both have the same architecture, i.e., interaction with DOM. The performance of React web development can be assessed as follows: 

  • Supports bundling and tree-shaking — a feature crucial for reducing the end users’ resource loads.
  • Offers better control over the project due to one-way data-binding support.
  • It can be easily tested and monitored.
  • Best for complex applications that require frequent changes.

Vue

Incredibly fast is the phrase that’s most attached with Vue. Some of its performance metrics are:

  • Faster learning curve.
  • Efficient and sophisticated single-page application.
  • Versatility due to high-end features.

Benefits of Angular, React, Vue

Angular

Well-documented understanding of templates, forms, bootstrapping or details about architecture, components, and interaction between components:

  • Smooth two-way data binding.
  • MVC architecture.
  • Built-in module system.
  • Significant reduction of the initial load time of a webpage.

Popular applications built using Angular:

Youtube TV | PayPal | Gmail | Forbes | Google Cloud

React

  • Flexible code due to its modular structure. Saves time and cost.
  • Facilitates high performance of complex apps.
  • Easier to maintain code during React front-end development.
  • Supports mobile native applications for both Android and iOS platforms.

Popular applications built with React:

Tesla | AirBnB | CNN | Nike | Udemy | Linked-in

Vue

  • Small size facilitates easy installation and download. 
  • When properly harnessed, Vue can be reused.
  • Vue.js allows updating of elements in a web page without rendering the whole DOM since it is virtual. 
  • Requires less optimization.
  • Stimulates web application development and allows the experts to separate template-to-virtual DOM from the compiler.
  • Proven compatibility and flexibility.
  • The codebase remains light regardless of the scaling of the application.

Popular applications built with Vue:

Gitlab | Spendesk | Behance | 9Gag | Wizzair | Nintendo

Community Support and Learning Curve

React JS library is created by Facebook that enjoys a large community of coders and developers offering solutions to the biggest problems. Angular has a large community of developers who have answers to the most challenging and weirdest cases. Vue has a decent ecosystem and enjoys all the right characteristics of React library and Angular framework. When it comes to the learning curve, React is the quickest to learn and adapt, followed by Vue and Angular. 

Final Thoughts

From the point of view of front-end development, React will be the quickest to learn in 2021. Both Vue and React are lightweight, intuitive, and perform flawlessly.

Thursday, March 25, 2021

An Overview: How-to Implement Google's Structured Data

 Source: https://dzone.com/articles/how-to-implement-google-structured-data 

by Rob Hinds    · Feb 27, 21 · Web Dev Zone · Tutorial

Google's Structured Data Schema helps you be a better web citizen as well as bringing SEO benefits, and if you have a dynamic web app, should be easy to implement.


As a result of working in web products (both personal and professional), I have become quite au fait with SEO from a technical point of view, and the purely technical things you can do to put you in good standing - all of which really, are just web best practices to be a good web citizen - things that we should be doing to make the web better (proper use of HTTP headers, mobile friendly designs, good performance for people on slower connections, etc.). 

One thing that is a bit above and beyond that is the use of Google's Structured Data. I will talk about what it is and what it does below, but if you are dynamically loading webpages (e.g. your website isn't just HTML on a web server, but either served from a server-side application, or is an API driven JS application), then you are most likely well placed to easily and immediately start implementing it.

1. What Is Structured Data?

Google has defined a set of schemas regarding Structured Data on websites. This is a schema that allows better definition of key data points from a given website. It's a sensible move by Google and is a natural progression for their search engine.

Think about it, there are millions of websites out there made up with sprawling HTML code and content - whilst HTML is a standard (more or less!) across the web, there are probably millions of different ways people use it. It would be nice if everyone used the H1 etc heading tags consistently, or if everyone used the <em> tag the same way (emphasis vs italics), but the reality is they don't - some sites will be using HTML as intended but many many more undoubtedly just rely on <span> or <div> tags combined with CSS classes to re-define every element they might need. 

This is all fine, Google is smart enough to pull out the content for indexing - yes, if you use span elements with custom styling for headings on your website rather than the H1+ tags then Google will penalise you, but it won't stop Google reading and indexing the site. What's more, its getting smarter all the time -  I'd probably back Google to be able to pull out relevant clips or question/answers directly in a fairly reliable way. However, they are Google and much like the Microsoft/IE of the 90s, they have the dominant market share so they can define their own standards for the web if they want to. That's exactly what Structured Data is. 

It's Google saying:

Hey, if you provide some data in your code that looks like this and is cool with our schema, then we will read that, so we don't have to guess or work out stuff. Or we can just keep trying to work it out from your HTML content.. it's your call

As mentioned earlier, if you have control over the source code and the data on your website, then this is really powerful. You can define specific (keyword heavy) snippets of content and explicitly tell Google about them - what's more the Schema for Structured Data lets you define content such as FAQ or how-to directions - so you can go beyond keyword heavy snippets and actually create FAQ for questions that you have identified from Google search trends (or whatever SEO tools you might use).  

Hopefully you get the picture by now - this is a pretty powerful tool.

2. Schema Tags: FAQ and HowTo

Two specific parts of the Structured Data Schema stood out to me as quite universally useful for websites, and also produce decent tangible results: FAQ schema and HowTo schema.

  • FAQ schema allows high level Q&A points to be provided in the metadata for Google - generally useful as most sites will have some element of their pages that could be presented as FAQ
  • HowTo schema allows step-by-step how to guides - less widely applicable, but if you have any website that provides how-to guides or anything with instructions this is applicable.

What exactly to these tags do and why do we care? Well, as well as trying to win favour with the all-seeing google search bot, if it gets picked up it also means we get more search real estate and increased accessibility to our content which should also increase the chance of click through conversion.

If you have ever seen search results like this:

Google search results

These points are being scraped from the site by Google from their schema tags - if you can automate the creation and inclusion of these for your site then you can be in a pretty good position to improve your SEO (still relatively low number of sites implementing these schemas).

3. Automating Your Schema Tags

As I have mentioned a couple of times, and as you have hopefully realised - if you have a dynamic website, you are likely already taking structured data (from your database for example, so reliably structured!) and building HTML pages (either server-side, or data as JSON to a JavaScript app for page creation client side) - but either way, we are starting off with structured data, and the Google Structured Data wants.. you got it, Structured Data! So if you have the content, it really is a generic, simple transform between structured data formats.

Below is some example code - It is based on Jekyll, as that's what my most recent personal project has been, but it's also pretty close to pseudocode, so hopefully you can easily translate it to whatever tech you use:

HTML

1
  {% if page.faqSchema %} 
2
    <script type="application/ld+json">
3
    {
4
      "@context": "https://schema.org",
5
      "@type": "FAQPage",
6
      "mainEntity": [
7
        {% for faq in page.faqSchema %}
8
          {
9
            "@type": "Question",
10
            "name": "{{faq.title}}",
11
            "acceptedAnswer": {
12
              "@type": "Answer",
13
              "text": "{{faq.answer}}"
14
            }
15
          }
16
          {% if forloop.last == false %}
17
            ,
18
          {% endif %}
19
        {% endfor %}
20
      ]
21
    }
22
  </script>
23
{% endif %}



As you can see, its a simple JSON based data structure and you just fill in the relevant parts of the object with your data. 

You can see the full code in my Jekyll food website over on GitHub here - likewise, you can see the end result in action on the website (hosted by GitHub pages, of course) too - the project was a food-science site - covering science and recipes, so a perfect match for FAQ (science pages) and HowTo (recipe pages). For example if you go to a recipe page view the page source, you will see the JSON schema at the top of the page, using the HowTo schema elements laying out resources required and then the steps required, if you compare that data with the actual page you will see the data mirrors each other (this is an important part, Google doesn't like what it thinks looks like "tricks"). Likewise on the Science of humidity in cooking in the page source you will see the JSON schema with FAQ:

JSON schema

4. Conclusion

If you have control of the data being loaded on to the page (a custom site - something like WordPress or another off the shelf platform might make this harder, but at the same time there are undoubtedly lots of plugins that already handle this for you on your given platform which make it even easier!), and are even vaguely interested in increasing organic traffic and search ranking, then I'd recommend implementing this. It's very easy to add (it's also primarily behind the scenes tech - it doesn't impact the visuals or design of the pages its added to) and can only be beneficial.

As with anything trying to improve SEO, its always hard to measure and get concrete details on, but its relatively low cost to add, minimal ongoing maintenance so I think its worth a shot.

If you have had experiences with Google's Structured data, good or bad, then I'd love to hear about it!

Thursday, March 18, 2021

Manifesto for Sustainable Agile

 Source: https://dzone.com/articles/manifesto-for-sustainable-agile

COVID-19 is proving to be a turning point in history. The changes introduced by this crisis are extraordinary and fundamentally reshaping our beliefs and behaviors. The immediate short-term measures, policies, and direct experiences are already changing how we work, including a greater emphasis on remote working, digital collaboration, workplace distancing, and support for temporary workers for example.

In the last two decades, we’ve witnessed multiple industry trends — globalization, the rise of the, start-up ecosystem, technological innovations, etc., that transformed ways of life and profoundly shifted business strategies across the industries. We’ve also experienced various methods and frameworks, such as Lean, XP, Agile, etc., that have helped companies optimize, expedite, and transform business outcomes across the industries.

The global growth story had been underpinned by capitalism at the forefront with little or no consideration towards sustainability or without truly understanding the impact on the natural ecosystem. When the majority of organizational goals are focused solely on driving revenue (or profits or margins), market share, or growth with an insatiable appetite to go faster, the toolbox for success can only mirror the language of speed, cost, and low (or no) failure. The long-term impact on mankind is not everyone’s worry if you’re chasing the year-on-year growth.

It’s not about philanthropy, it’s about renewing our value-system to demonstrate how uniquely we can build a long-term sustainable growth model by doing the right thing for our societies and our people.

It’s a new value-system

Now more than ever, business and government have a crucial role to play in protecting people’s health, bolstering the economy, and developing both practical solutions and game-changing innovations. The need for agility has never been greater. Over the long term, though, we know that the delivery of value to shareholders, employees, and society requires growth. And growth requires innovation and resilience as key ingredients. It’s imperative for everyone to balance immediate measures and growth orientation with sustainable agility.

As we continue to grow the Sustainable Agile Community, we have a new home for The Manifesto for Sustainable Agile https://sustainagile.org/

The Manifesto for Sustainable Agile

Over the last 10 years of my career studying sustainable business models, one key differentiator I found between sustainable vs. non-sustainable models is the “value-system” that drives every function of the organization. That provided the much-needed foundation for my thinking around the manifesto for sustainable agile.

The manifesto is an extension to the Agile Manifesto which I hope will help individuals, teams, leaders, and enterprises to navigate these turbulent times and discover a new normal and a better world.


Click to Download the PDF version

The four core values of Manifesto for Sustainable Agile are:

1. Collocated Minds Over Collocated People

Technology has helped us prove that remote work at such a massive scale is possible. Studies have long proven collocated teams are better at delivery outcomes and gain alignment quickly. The effect of the current situation will fundamentally shift how office spaces and collocation are perceived by individuals and leaders.

In the post-COVID-19 era and beyond, remote working may take a front seat, giving people a commute-free lifestyle combined with technology innovations. We are all learning and experiencing a global movement that shows it is more important to have the power of minds, ideas, and thoughts together and collocated through digital mediums and conferencing innovations. Physical collocation may prove not to be an essential aspect for new normal where everyone will master the art of remote working.

[Update 5/06/2020]:
In the last few weeks, we have seen some amazing examples of how companies and institutions have responded quickly towards ensuring a location-agnostic approach to various parts of work and life. Some examples are as below:

  1. In the Philippines, Virtual Courts were launched throughout the country.
  2. In the Maldives, lawmakers continue to work from Virtual Parliaments.
  3. The use of Virtual Classrooms throughout the world.
  4. TCS started a Remote Internship and plans to have 75% of its work-force working from home by 2025.
  5. The article from business.com about Remote Work Trends After COVID-19 summarizes efforts across various other industries.
  6. Organizations have started to re-imagine their employee journey, customer journey, and overall work experience to suit the new normal.
  7. The list goes on….

2. Collective Outcomes Over Individual Outputs

The urge to measure individual productivity has always been of keen interest for people who are more focused on ROI over impact. It has been a topic of debate for years in the agile community that rather than measuring outputs or utilization, one should measure outcomes. In my experience, outputs/utilization measured in an absolute number of hours or any time unit may have NO direct relation to intellectual outcomes. A higher utilization may also yield depreciation in the form of burn-outs or partial failures due to excessive load/stress on individuals.

When we focus on collective outcomes, it drives collaboration, cooperation, and teamwork. Successful organizations will find it a continuous endeavor and a critical mandate to work as a team (not individuals), leveraging collective strengths to deliver collective outcomes.

[Update 5/06/2020]:
A majority of leaders are still focused on remote worker productivity. There are many reports of remote worker productivity, which was also a concern prior to COVID-19 and covered as part of the State of Remote Work 2020 report. It is time we adopt a collective outcome-driven approach towards productivity. As a leader, enabling remote work is one part, while making it sustainable needs more than productivity measures.

3. Speed to Value Over Speed to Market

In these times of stress, going faster isn’t the universal answer. Leaders must focus on anticipation and responsiveness along with the perceived opportunity value. Defining value is hard — leaders should carefully define components that make up the value. The components that create value are different for different companies ranging from competitiveness, risk reduction, compliance or sustainability, or other business drivers. When leaders define and manage priorities in the new era, they also need to consider the greater good of society over the traditional capitalist mindset.

[Update 5/06/2020]:
I received a few questions and emails around the Speed to Value part. I found a golden nugget from Bill George (Harvard Business School Professor), explaining the new purpose behind the “Creating Shared Value” aspects of capitalism. It is great to see how the new purpose is shifting towards becoming more inclusive for all different stakeholders (employees, customers, suppliers, communities, and shareholders).

4. Empathy and Trust Over Command and Control

During the current crisis and in the post-crisis era, empathy and trust would define the success of leaders. Without empathy, there is no trust which directly impacts working relationships. Between layoffs, lockdowns, and health worries, everyone is going through a different set of challenges. Leaders who continue to use authority and command to push people in these circumstances may lose respect. A truly nimble mindset that encourages people to be at their best while balancing their essential needs is really critical for now and beyond. A sustainable work culture, driven deeply by empathy and trust, would promote unconditional loyalty.

[Update 5/06/2020]:
‘Empathy and trust’ is one the most popular topics in management and leadership circles during this time. Everyone has a part to a play, throughout the journey. It’s not a one-off action.
Some of the resources I found useful are listed here:

  1. Remote Onboarding and Working with Remote Customers.
  2. Hiring a fully Remote Team.
  3. Steps to Support remote members.
  4. Emotional Intelligence in Remote Environment.
  5. Susan David, Ph.D.’s “Emotional Pyramid of Needs.”

Why We Need Another Manifesto

The Agile Manifesto (2001) at the time of writing had the primary focus to find better ways of developing software. Over the years, Agile adoption has continued to expand, not only within IT, but also beyond IT, in different organizational functions such as HR, finance, marketing, and so on. The values and principles of Agile remain timeless. However, the application of these values and principles must be revisited.

We’re experiencing an unprecedented reality. As companies and leaders go through discovering and defining the new normal, we need a nimble yet resilient mindset to support different ways of working for everyone — be it software development, business operations, or mission-critical service operations. That’s the promise of the new manifesto.

Universal Applicability

The Manifesto for Sustainable Agile brings inclusiveness for everyone into the new normal. Its application is not limited to any particular domain, function, industry, team, or business model. These core values can be universally applied to any and all of the below compositions:

  1. Domains of Work.
  2. Types of Team Compositions.
  3. Industries.
  4. Technology Functions.
  5. Business Functions.
  6. Business Models.
  7. Individuals.

Contribute to the Manifesto

I believe the best way to get the best possible version of anything is through a series of “inspect and adapt” cycles based on feedback from the community at large. As a true believer of collective outcome over individual utilization, I would like to capture insights and best practices from the global community so that the manifesto can become a living document.

To that end, the Manifesto for Sustainable Agile is open source and is released under the CC4-BY-SA license. Join the Sustainable Agile Community today to support and join the movement for future of work.

Please also comment and reach out to me directly via email or Twitter to provide your input. Let us make this new era a collaborative endeavor.

This manifesto is an attempt to reimagine the intent of agility for everyone with a universal applicability in the new normal.

A black and white poster for the manifesto can be found here.