TECH

February 24, 2025

Browser Market Share 2025: What Is The Most Popular Web Browser?

While creating web applications and websites, compatibility with prominent web browsers is very important. Yet, given the extensive variety of browsers available globally, it is not always easy to decide which ones to support.

Choosing the right browsers in advance is important, but it is just as important to test cross-browser compatibility after development. Ensuring your website works smoothly across different browsers improves the user experience (UX) and increases your business potential for success.

To be able to make wise decisions, staying up-to-date with the latest browser market share data is necessary. In this article, we present to you the newest global web browser market share statistics by StatCounter, a leading web traffic analytics website, to provide you with the update.

What You’ll Learn in This Article

  • Latest Browser Market Share (as of January 2025)
    • Desktop + Mobile
    • Desktop
    • Mobile
  •  Browser Market Share Trends Over the Past Decade (2015–2024)
    • Desktop + Mobile
    • Desktop
    • Mobile

Understanding not only the latest browser market share but also the long-term trends from the past decade can help predict future developments in the browser landscape.

Overall Browser Market Share (Desktop + Mobile) in January 2025

First, let’s start with the global browser market share across both desktop and mobile platforms as of January 2025.

Global Browser Market Share January 2025

Browser

Market Share

Chrome

67.1%

Safari

18.0%

Edge

5.2%

Firefox

2.5%

Samsung Internet

2.2%

Opera

2.1%

UC Browser

0.8%

Android

0.6%

Yandex Browser

0.4%

360 Safe Browser

0.3%

QQ Browser

0.3%

Coc Coc

0.1%

Whale Browser

0.1%

IE

0.1%

Mozilla

0.04%

Instabridge

0.03%

Sogou Explorer

0.03%

Ecosia

0.02%

KaiOS

0.02%

Puffin

0.02%

Edge Legacy

0.02%

Unknown

0.01%

According to StatCounter's January 2025 data, Google Chrome continues to dominate the global browser market with a huge 67.1% market share. That's more than three times the market share of the second-most popular browser.

At second position is Apple's Safari with an 18.0% market share, capturing nearly one-fifth of the global market. At third is Microsoft Edge with 5.2%.
These three browsers Chrome, Safari, and Edge have a total market share of 90.2% of the global market, which makes them the leading browsers used across the world in 2025.

At fourth position is Firefox (2.5%), followed by Samsung Internet (2.2%) and Opera (2.1%).

Why Is Chrome So Dominant?

Chrome's extreme domination of the market share is warranted on some significant grounds:

  • Seamless Google integration: As a Google product, Chrome is tightly integrated with Gmail, Google Docs, Google Drive, etc., and therefore one of the best for home and office use.
  • Fast page loading rates: Chrome is also fast-based, offering a smooth browsing experience.
  • Huge extension ecosystem: Chrome Web Store is a huge repository of extensions, making it easier to use and more productive.
  • Cross-platform compatibility: Chrome can be used on Windows, macOS, Android, and iOS, so it is easy to use across various devices.

Let's move on to the desktop and mobile browser market share breakdown next.

Desktop Browser Market Share in January 2025

Now let's have a closer look at the desktop browser market share in January 2025.

Global Browser Market Share (Desktop) January 2025

Browser

Market Share (Desktop)

Chrome

65.8%

Edge

13.8%

Safari

8.8%

Firefox

6.3%

Opera

2.9%

360 Safe Browser

0.8%

Yandex Browser

0.6%

IE

0.3%

QQ Browser

0.2%

Coc Coc

0.1%

Mozilla

0.1%

Sogou Explorer

0.1%

Whale Browser

0.1%

Edge Legacy

0.04%

UC Browser

0.02%

Other

0.05%

Chrome Reigns Supreme, but Edge has Serious Market Share

Even in the desktop browser market, Google Chrome rules supreme with 65.8% of the market. But the second-placed browser is unlike the overall market share list.

Unlike in the combined (desktop + mobile) category—where Microsoft Edge holds only 5.2%—Edge secures 13.8% of the desktop market, making it the second most popular desktop browser in 2025.

Meanwhile, Safari ranks third with 8.8%, significantly lower than its 18.0% share in the overall market. This suggests that Safari’s strength primarily comes from its dominance in the mobile segment, where Apple devices are prevalent.

The Five Key Desktop Browsers

Following the first three, Firefox holds fourth place (6.3%), followed by Opera at 2.9%.

Notably, Chrome, Edge, Safari, Firefox, and Opera collectively hold 97.6% of the desktop market share, and in reality, essentially all desktop activity happens within these five browsers.

What This Means for Web Development

For companies and web developers, cross-browser support is a must. With these desktop browser market share statistics as the basis, the top desktop web development priority would be Safari, Chrome, Edge, and Firefox. And including Opera in the tests for compatibility would mean covering nearly all of the desktop user base.

Mobile Browser Market Share in January 2025

Now, let's see the mobile browser market share as of January 2025.

Global Browser Market Share (Mobile) January 2025

Browser

Market Share (Mobile)

Chrome

68.3%

Safari

22.7%

Samsung Internet

3.6%

Opera

1.7%

UC Browser

1.3%

Firefox

0.5%

Edge

0.5%

Android

0.4%

QQ Browser

0.3%

Yandex Browser

0.3%

Whale Browser

0.1%

Coc Coc

0.1%

Instabridge

0.1%

KaiOS

0.03%

Ecosia

0.03%

Puffin

0.02%

Unknown

0.02%

Phoenix

0.01%

Other

0.02%

Chrome is Still the Champion of Mobile Browsing

As in the overall and desktop browser market share, Google Chrome is the clear champion of mobile browsing. Chrome has 68.3% of the mobile browser market, meaning it is used by around 70% of mobile users worldwide.

One of Chrome’s defining characteristics is its consistency across platforms. While other browsers exhibit significant differences between desktop and mobile market share, Chrome maintains a near 70% share across both platforms.

Safari’s Strength in Mobile: A Reflection of iPhone Popularity

Ranking second in the mobile segment, Safari holds a 22.7% market share, which is significantly higher than its 8.8% share in the desktop market—nearly 2.5 times more.

This sharp growth is indicative of the widespread use of iPhones across the globe, as Safari is the default browser for all Apple products. The mobile space is highly polarized, with Chrome and Safari accounting for 91.0% of the whole mobile browser market.

The Rest of the Mobile Browser Market

Outside of Safari and Chrome, the remaining market share of other mobile browsers shrinks significantly. Samsung Internet comes in third with 3.6%, on the strength of preinstallation on Samsung devices. Opera follows at fourth position with 1.7%. While these browsers still maintain some traction in the mobile space, their market share is still relatively low compared to the virtual monopoly of Safari and Chrome.

Browser Market Share Trends (2015–2024)

Now, let us examine the browser market share trends of the past decade (2015–2024), categorized into three segments:

  • Overall Market Share (Desktop + Mobile)
  • Desktop Market Share
  • Mobile Market Share

Analyzing the past decade's shifts in market share, we can set meaningful observations on the long-term browser dominance trends. These historical statistics will also help us predict how browser market share is likely to evolve post-2025 and in future years.

Overall Browser Market Share Trends (2015–2024)

Now, let's see what has been the trend in the global browser market share in the last decade (2015–2024).

Global Browser Market Share 2015 - 2024

Browser

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

Chrome

44.9%

49.1%

54.0%

59.1%

63.3%

64.6%

64.5%

64.8%

63.9%

65.8%

Safari

13.1%

13.3%

14.5%

14.4%

15.9%

17.8%

18.9%

18.9%

19.8%

18.2%

Firefox

10.5%

8.0%

6.2%

5.2%

4.6%

4.2%

3.6%

3.4%

3.0%

2.8%

UC Browser

5.4%

7.8%

8.3%

6.7%

3.3%

1.7%

1.2%

0.9%

0.9%

0.9%

IE

11.2%

6.3%

4.0%

3.0%

2.2%

1.4%

0.6%

0.4%

0.2%

0.2%

Opera

5.0%

5.5%

3.8%

3.5%

2.6%

2.0%

2.2%

2.2%

2.7%

2.3%

Android

6.3%

4.0%

2.4%

1.5%

0.9%

0.5%

0.6%

0.7%

0.6%

0.5%

Samsung
Internet

0.0%

2.3%

3.3%

2.8%

3.5%

3.4%

3.1%

2.8%

2.5%

2.5%

Edge

0.0%

0.0%

0.0%

0.0%

0.0%

1.5%

3.6%

4.2%

5.0%

5.2%

Edge Legacy

0.3%

1.4%

1.9%

2.0%

2.1%

1.4%

0.2%

0.1%

0.1%

0.0%

Other

3.4%

2.4%

1.8%

1.9%

1.7%

1.6%

1.4%

1.6%

1.4%

1.6%

Chrome's Market Share Growth: Ten Years of Domination

In 2025, it is still the undisputed leader in the world browser market, but looking back, Chrome's reign was already evident in 2015 when it had a share of 44.9%—almost half of the world market.

From 2015 to 2019, Chrome's market share grew at a steady rate of 4–5% per year, reaching 63.3% by 2019. Although its growth slowed after 2020, Chrome has maintained a stronghold of around 65%, solidifying its position as the most widely used web browser worldwide.

Safari’s Steady Growth and IE’s Decline

Safari held the second-largest market share of the world's browsers at 13.1% in 2015, followed closely by Internet Explorer (11.2%) and Firefox (10.5%). But over the past decade, the browser world has transformed beyond recognition, with some of them making gains while others lost their hold.

Safari gradually increased its share of the market, from 13.1% in 2015 to 18.2% in 2024. Such consistent increase has placed it at number two in usage, with an enormous gap from other browsers.

On the other hand, Internet Explorer fell, mostly due to Microsoft's transition to Edge and Edge Legacy. As IE commanded 11.2% market share in 2015, its market share gradually eroded, and it retained just 0.2% in 2024. However, its successor, Edge, managed to gain some traction in the market, holding 5.2% share by 2024.

Similarly, Firefox, with a good 10.5% market share in 2015, has been gradually going down the slope over the years. Its market share plummeted to a low of 2.8% in 2024, a sign of its declining position in the browser market.

The Rise of Chrome and Safari as Market Leaders

Looking back at the past decade, Chrome has continued to tighten its hold, growing from 44.9% in 2015 to nearly 70% by 2024. Meanwhile, Safari—while far behind Chrome—has steadily gained traction, solidifying itself as the world's second most popular browser.

Meanwhile, Internet Explorer and Firefox, which both had more than 10% market share each in the past, have seen their influence fade significantly. While Edge did pick up some speed, it still lags far behind the two Tech giants.

What to Expect in the Coming Years

According to these trends, it is likely that the "two-browser dominance" of Safari and Chrome will continue in the short term. However, Chrome's large market share shows that, instead of a duopoly, the market is rather a "Chrome-dominated landscape". Although Edge has gradually gained share, it is still a far third, so it is not likely to challenge the top two in the near future.

Desktop Browser Market Share Trends (2015–2024)

The dominant players in the desktop browser market share have yet to change over the course of the past decade from 2015 to 2024; however, some small rotations were witnessed within major browsers aside from Chrome.

Browser

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

Chrome

54.4%

61.2%

63.4%

68.0%

70.0%

68.7%

67.3%

66.4%

64.6%

65.3%

Firefox

17.5%

15.5%

13.9%

11.0%

9.5%

8.7%

7.9%

7.8%

6.3%

6.7%

IE

18.9%

12.1%

9.0%

6.6%

4.9%

3.0%

1.5%

0.9%

0.5%

0.4%

Safari

5.1%

4.8%

5.5%

5.4%

6.8%

9.0%

9.9%

9.3%

11.9%

8.9%

Edge

0.0%

0.0%

0.0%

0.0%

0.0%

3.2%

8.5%

10.4%

10.9%

13.2%

Opera

1.8%

1.9%

2.1%

2.4%

2.4%

2.4%

2.7%

3.0%

3.9%

3.0%

Edge Legacy

0.5%

2.6%

3.9%

4.2%

4.5%

2.8%

0.3%

0.2%

0.1%

0.1%

Other

1.9%

2.0%

2.2%

2.4%

1.9%

2.2%

2.0%

1.9%

1.8%

2.5%

Chrome’s Continued Dominance in the Desktop Market

Since 2015, Chrome was the widely adopted browser on the desktop market. At the beginning of the decade, its dominance started when it took, at a minimum, 54.4% of the pie and all others lagged behind. For the few years after that, this dominance only got bigger, hitting the peak of 70.0% in 2019. Then, after those all-time high numbers, the market share of Chrome saw a slight decline and stabilized at around 65% by 2024.

Despite this modest dip, Chrome is still the clear leader in the desktop browser market, having outdone its competitors for over a decade.

The Decline of Internet Explorer and the Emergence of Edge

As of 2015, Internet Explorer was the second most used desktop browser, holding 18.9% of the market share. Microsoft's move towards dropping IE for Edge and Edge Legacy, though, saw the legacy browser gradually lose ground. By 2024, IE's market share fell to 0.4%, technically marking the death of its existence in the market.

At the same time, Microsoft's Edge gradually became popular over the last decade. Although it did not exist in 2015, the browser began to grow its market share in 2020 up to 13.2% by 2024 and becoming second only to Chrome.

Firefox’s Gradual Decline and Safari’s Growth

Firefox, with a respectable 17.5% market share in 2015, saw a steady decline over the years. In 2024, it had dwindled to a paltry 6.7%, dropping out of the big players' category. A once-trendy second option to Chrome, Firefox has gradually lost ground to some other browsers, particularly Edge and Safari.

Safari, on the other hand, has shown steady growth. Initially holding 5.1% in 2015, it gradually increased its market share, peaking at 11.9% in 2023 before settling at 8.9% in 2024. Safari’s presence in the desktop market remains far smaller than in the mobile segment, but its growth suggests that Apple's expanding ecosystem continues to attract users.

The Outlook for the Desktop Browser Market

In the future, the desktop browser market will be led by Chrome, with Edge and Safari holding strong second positions to it. While Edge has been consistently increasing, it is still far from putting an end to Chrome's reign.

As Firefox and Internet Explorer fade into the background, the desktop browser market has now reduced to a three-horse race, with Chrome leading the pack, followed by Edge and Safari. Unless there is a sudden change in user behavior or technological advancements to shake up the current stability, this trend is likely to continue.

Mobile Browser Market Share Trends (2015–2024)

The market for mobile browsers has greatly evolved in the last decade with some of the browsers gaining power and others losing market share.

Browser

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

Chrome

33.6%

38.4%

48.9%

54.2%

60.1%

62.5%

63.3%

64.4%

64.1%

66.7%

Safari

18.8%

17.9%

18.1%

18.8%

20.8%

24.1%

24.8%

24.8%

25.4%

23.3%

UC Browser

15.1%

17.6%

15.6%

12.3%

6.2%

3.2%

2.1%

1.4%

1.6%

1.5%

Opera

11.0%

10.2%

5.6%

4.8%

2.9%

1.7%

2.0%

1.8%

1.9%

2.0%

Samsung
Internet

0.0%

5.4%

6.4%

5.5%

6.9%

6.5%

5.7%

4.9%

4.5%

4.1%

Android

15.4%

7.3%

3.5%

2.0%

1.0%

0.4%

0.5%

0.7%

0.7%

0.4%

Other

6.0%

3.3%

2.0%

2.5%

2.2%

1.7%

1.6%

2.1%

1.8%

2.0%

Chrome’s Rapid Growth and Mobile Market Dominance

Back in 2015, Chrome was already the most-used mobile browser but at a mere 33.6%, or one-third of the entire market share. Competition was much tougher: Safari was getting away with 18.8% of it, the Android Browser with 15.4%, UC Browser with 15.1%, and Opera with 11.0%. While Chrome was on top, there was no dominant browser: nearly everyone listed had some market presence.

However, in the next decade, Chrome took a giant leap upward, largely as a result of being the default web browser across Android devices. Chrome, being the default browser of Android, gradually supplanted the Android Browser and saw a steady decline in its market share.

In 2024, Chrome almost double-upped its market share, at 66.7%, penetrating almost 70% of the mobile browser market share.

Safari’s Growth as Apple’s Default Browser

Safari has also experienced steady growth as the default browser on iPhones. While its market share was 18.8% in 2015, it peaked at 25.4% in 2023 before slightly declining to 23.3% in 2024. This reflects the continued popularity of iPhones worldwide, solidifying Safari as the second-most used mobile browser.

The Decline of UC Browser, Opera, and Android Browser

While some browsers have grown significantly over the past decade, others that once held a strong presence in the mobile market have experienced sharp declines.

UC Browser, which was at 15.1% market share in 2015, has plummeted to a mere 1.5% in 2024—a staggering fall of nearly 90%. Similarly, Opera, at 11.0% in 2015, has lost considerable market presence too. But whereas UC Browser has plummeted, Opera has stabilized at around 2.0% in 2024, retaining a minuscule but consistent user base.

The other drastic shift has been the near complete disappearance of the Android Browser. From a clear runner-up position with 15.4% market share in 2015, it has been completely displaced by Chrome and has shrunk to just 0.4% in 2024.

Whereas Samsung Internet, though less well-known than Chrome or Safari, has managed to maintain a stable if niche user base. Whereas it still holds 4.1% in 2024, it has continued to fall from its peak of 6.9% in 2019, showing its declining share in the saturated mobile browser market.

A Unique Two-Browser Dominance: Safari and Chrome

Chrome and Safari together hold nearly 90% of the mobile browser market share in 2024. This is a radical shift from 2015, when a number of browsers shared the market more equally.

In the future, absent any new entrant, Chrome will likely dominate the market, and Safari will stay at number two based on Apple's ecosystem. Other browsers, including Edge, Opera, and Samsung Internet, will be niche players in the mobile browser market.

Conclusion

The browser landscape has undergone a tremendous transformation in the past decade, with Google Chrome still dominating both the desktop and mobile browsers. Safari has continued to be the second-most popular browser, particularly in the case of mobile browsers, while Edge has continued to gain its share in the desktop market. Meanwhile, erstwhile giants like Internet Explorer, Firefox, UC Browser, and Opera have lost a great deal of ground, reflecting shifting user preferences and industry trends.

Something to note is that the browser market share figures quoted in this article are worldwide. Market share distribution varies significantly by region and country, depending on device choice, operating system adoption, and regional browser policies. For instance, while Chrome and Safari are dominant globally, there may be more utilization of other browsers such as Samsung Internet or regional browsers in some regions.

If you want to refine your web development and testing strategy for browser market share within a country or region of interest, our expert professionals at ISB Vietnam are here to provide the necessary help. Contact us now and have your web applications tailored for the appropriate audience with the most relevant browser compatibility.

View More
OFFSHOREOUTSOURCINGTECH

February 19, 2025

Pros and Cons of Onshore and Offshore Development: Choosing the Right Model for Your Business Growth

While businesses continue to desire growth and better operational efficiency through the use of IT, they often struggle to balance the critical challenges of resource management, cost control, and talent acquisition. To tackle these challenges, many companies resort to onshore and offshore development models. Each of the two models brings its various benefits and potential drawbacks. However, picking the right one is not easy.

This article will discuss the advantages and disadvantages of onshore versus offshore development, taking insights from the knowledge offered by ISB Vietnam, Who has extensive experience with both models. This guide gives key insights into the best outsourcing approach for your business. Whether your priority is saving cost, optimize communication, or unlock access to unique talent, you’ll be equipped to make an informed decision.

What Is Onshoring and Offshoring?

Now let us consider the concepts of onshoring and offshoring and how they differ.

Onshoring is the outsourcing of business operation, like software development, within the same nation in which the client business is located. Through this method, companies are able to take advantage of local skills with the benefits of easier communication, compliance with regulations, and control of operations.

Offshoring, however, refers to outsourcing tasks to a foreign country, typically to destinations where labor is cheaper and high-skilled workers are readily available. It is prevalent in the IT services and software development industry because the businesses can take advantage of cost advantage, availability of a greater talent pool, and nimble scaling.

Main Differences between Onshore and Offshore

Though both models enhance business efficacy through outsourcing, they are diverse in the dimension of cost considerations, location differentiation, communication timeframe, scalability, and compliance requirements.

Onshore development gives businesses the ability to ensure local compliance, real-time collaboration, and cultural matching, but usually with a higher cost. In contrast, offshoring allows businesses to save up costs and avail themselves of a much larger talent pool, but it may brings upon challenges related to communication, time zones, and legal complications.

To delve deeper into the difference between onshore and offshore, look up our article.

Onshore vs. Offshore: Definition, Differences, and Key Considerations

Advantages of Onshoring

Smooth Communication

A great benefit of onshoring is that one gets to work with a team that shares the same language and culture. Without any language barriers, communication is easier, with less possibility of misunderstandings and misinterpretations. This is particularly valuable for complex projects where constant interaction is necessary, with precise instructions and frequent updates being necessary.

Easier Compliance with Laws and Regulations

Because onshoring maintains operations within the home nation, companies are in full compliance with domestic laws and regulations. Compliance with data protection legislation, intellectual property legislation, and labor law is simpler because no effort needs to be made to interpret foreign legal systems. This gives a feeling of security, especially for companies in sectors where compliance is the most important consideration. For any legal issue, businesses can depend on home country law, minimizing uncertainty along with possible risks associated with international legal variations.

Ability to Hold Face-to-Face Meetings

Proximity is also among the greatest advantages of onshoring since it allows businesses to conduct face-to-face communication whenever necessary. This can be particularly useful when there are crises, and on-site visits and personal troubleshooting can be arranged without loss of time. Companies that prefer personal interaction with their employees might find onshoring a preferable alternative since it allows for better collaboration, enhanced relationship-building, and quicker problem-solving.

Disadvantages of Onshoring

Higher Costs

Perhaps the most significant disadvantage of onshoring is cost. Software developers and IT professionals in industrialized nations receive high salaries, which greatly adds to labor expenses. Office rent and the cost of business operations also are likely to be higher than in offshore destinations. Consequently, organizations on a shoestring budget might find it difficult to get projects done within budget limits by utilizing purely onshore talent.

Limited Talent Access

As onshoring limits hiring to domestic markets, organizations might not be able to recruit experts in some areas. New technologies like artificial intelligence, blockchain, and cybersecurity need highly skilled experts, but the availability of such experts is typically less than the demand. This talent shortage increases salaries, and hiring becomes more competitive and expensive. Large companies with deep pockets may have access to the top talent, and small and medium-sized businesses are left with limited options for recruiting qualified software developers.

Challenges in Scaling

Scaling development teams in an onshore model is difficult, especially for fast-growing companies. Compared to offshore models, where companies can scale their workforce rapidly by tapping into international talent pools, onshoring restricts scalability to the quantity of local professionals in the market. Recruiting fresh talent in demanding markets is time-consuming, and companies cannot scale projects up or reallocate resources rapidly as required. Companies planning long-term growth must carefully consider whether onshoring can support their growth strategy.

Advantages of Offshoring

 

Cost Saving

A great benefit of offshoring is being able to lower business and project expenses significantly, mainly in areas of labor and operational expenses. By outsourcing to nations with lower labor expenses compared to advanced countries, organizations can obtain more resources for the same budget, enabling them to attain higher output without having to sacrifice development quality. Most companies opt for offshoring mainly due to this reason since it is a relatively inexpensive method of adding great software development capacity.

For instance, as per the 2025 Global Software Outsourcing Rates and Trends Guide released by Accelerance, hourly rates of software developers differ based on location.

ROLE

Latin America

Eastern Europe

South Asia

Southeast Asia

Junior Developer

$20 - $70

$30 - $49

$25 - $35

$16 - $44

Intermediate Developer

$30 - $115

$45 - $66

$30 - $45

$20 - $48

Senior Developer

$40 - $125

$55 - $86

$35 - $50

$25 - $51

Lead Developer

$42 - $125

$65 - $93

$38 - $50

$33 - $55

Source: 2025 Global Software Outsourcing Rates and Trends Guide | Accelerance

As evident from the table above, hourly rates for software developers differ by region. The average hourly rate for a software developer in South Asia and Southeast Asia is in the range of approximately $20 to $50, and these two regions are the most cost-saving for outsourcing software development. Eastern Europe is in the middle range, and Latin America is the highest among the offshore regions listed.

While varying by region, offshore development costs are still significantly lower than in Western countries, providing a cost-effective alternative for companies wanting to save their software development expenditure.

With the leverage of offshoring, companies can engage skilled developers at significantly lower rates than employing domestically, providing an attractive solution for companies wanting to maximize their return on investment while being able to maintain high-quality development.

Access to World Talent and Specialized Expertise

Offshoring allows companies to access a global pool of international talent, making it convenient for them to employ experts in new or niche technologies. Companies that find it difficult to find professionals locally owing to a shortage of talent can utilize offshoring to recruit highly skilled software developers in emerging and niche areas like AI, blockchain, cybersecurity, and legacy programming languages. It is especially helpful for companies looking for specialists with uncommon skill sets that are hard to locate in their native country.

Scalability and Flexibility

Offshoring provides a very good level of scalability, which enables companies to scale up or down team size with ease in accordance with project demands. As opposed to onshore hiring, which is usually backed by time-consuming processes of hiring and expensive labor, offshoring enables companies to scale development teams quickly without investing high costs. Such flexibility is particularly worth it for companies engaged in large development projects or businesses with fluctuating workloads, where being able to scale resources for a finite time frame can yield a significant competitive edge.

Development across Time Zones

For businesses with offshore teams located in various time zones, offshoring has the additional advantage of more time available for development. Whereas onshore teams are restricted to normal business hours, offshore teams can still work even after the office hours of the client. The time difference enables quick turnaround of projects since companies can outsource jobs during their business hours and have updates or completed jobs the following morning. Taking advantage of time zone differences can result in enhanced productivity, shorter development cycles, and quicker time-to-market for new features or products.

Disadvantages of Offshoring


Potential communication challenges

Communication challenges brought on by linguistic and cultural boundaries are common issues with offshore. Working with groups that don't have the same first language or business procedures might lead to misunderstandings. However, with the right preparation and expertise, these difficulties can be lessened. Many organizations get around these problems by establishing clear communication channels early on and collaborating with offshore companies that have a lot of expertise dealing with clients from other countries.

Regulatory and Legal Aspects

Offshoring is outsourcing work to a foreign nation, thus businesses must deal with variations in labor laws, data protection laws, intellectual property rights, etc. Even though it might be difficult to comply with foreign standards, businesses can reduce risks by conducting adequate research and drafting appropriate legal agreements.

Possible Increase in Management Effort

Because labor expenses are reduced, offshore can result in large cost savings, but in certain situations, it can also result in more project management work. Effective coordination is essential for managing offshore teams, especially when it comes to progress tracking and remote team management. It could take more time and money to ensure seamless collaboration across time zones and workplace cultures.
However, by carefully choosing a trustworthy offshore partner, using project management and communication tools, and carrying out frequent progress checks, businesses can reduce the risk of higher management costs. Businesses can manage offshore teams efficiently and affordably if they have the proper plans in place.

Offshore or Onshore: Which Approach Is Better?

Both onshore and offshore development have benefits and drawbacks, as was previously mentioned, and the best option will rely on project specifications and business goals. If cutting costs is your main goal, offshore development might be a better choice. However, onshoring might be the better option if regulatory compliance and easy communication are important considerations.
In order to assist companies in making an informed choice, we have listed the main situations in which onshore or offshore development is most appropriate as well as a different hybrid strategy that combines the advantages of both models.

When Should You Choose Onshore Development?

When Real-Time and In-Person Communication Is Essential

Onshoring is ideal for projects that require seamless communication and direct collaboration. Because there are no language or cultural differences, it is possible to communicate freely without the chance of misunderstanding. It is also useful for projects which need to be coordinated in real time and with the ability to make decisions quickly due to the absence of time zone differences. Also, the project coordination can be further enhanced by the fact that face to face meetings can be easily set up.

When Strict Compliance with National Laws and Regulations Is Required

Some sectors including finance, government services, data security among others are highly regulated by the country. In such a case, onshoring is more often preferred as it guarantees adherence to data protection laws, labor laws and industry standards of the country. Also, onshore teams can deal with interactions with regulatory bodies and audits better and more effectively, thus reducing compliance risks.

When Should You Choose Offshore Development?


When Cutting Costs Is a High Priority

The ability to drastically cut costs is one of the main reason why so many companies choose offshore development. Hiring developers in areas with lower labor costs can have a significant positive financial impact because software development salaries make up a large portion of project expenses. This is particularly valid for long-term, large-scale projects, where offshore outsourcing offers consistent cost savings. It is also a desirable choice for new and small companies that have a tight budget and need to create products.

When to Hire Highly Qualified Personnel Rapidly

Offshoring gives companies access to a worldwide talent pool, enabling them to locate experts in cutting-edge domains like artificial intelligence, blockchain, data science, etc. This is especially helpful when hiring speed is a crucial consideration or when domestic talent is in short supply. Offshore outsourcing can help businesses that want to rapidly add highly qualified individuals to their development teams.

When the Task Is Properly Suitable for Remote Work

Software development, QA testing, and customer support are a few business operations that can be effectively managed remotely and don't require physical presence. Offshore teams can produce excellent results at low operating costs if they have the proper management structure and collaboration tools.

When Organizing a Prolonged Maintenance or Development Project

Long-term projects benefit greatly from offshoring since it enables companies to obtain development resources without regard to location. Communication problems frequently go away as offshore teams get more accustomed to the client's procedures and demands. In long-term relationships, this may result in increased productivity and efficiency. Because of this, offshoring becomes more and more cost-effective over time, making it a more attractive option for long-term projects.

Consider a Hybrid strategy: The Best of Both Worlds

Nowadays, a lot of businesses are using a hybrid development strategy that combines the best features of both onshore and offshore development instead of only deciding between the two. A typical hybrid strategy is outsourcing some development phases to an offshore team while maintaining key activities in-house.

For instance, in order to reduce costs without sacrificing quality, requirement analysis and high-level system design may be carried out onshore while the actual development and testing are managed offshore. With this structure, businesses can use offshore scalability for execution while maintaining control over key decision-making processes.

Another strategy is to scale up full-fledged development overseas while developing Minimum Viable Product (MVP) and prototypes onshore.

Businesses may use the flexibility and cost-effectiveness of offshore development while maintaining quality control through onshore management by implementing a hybrid strategy. This approach is becoming a more and more common choice for software development projects as it enables businesses to expand effectively, manage spending, and reduce risks.

Conclusion

Both onshore and offshore development present unique benefits; however, choosing the appropriate strategy involves detailed assessment of various factors including cost, scalability, technical requirements, communication efficiency and regulatory compliance. Businesses must evaluate these elements thoroughly to ascertain the most fitting model for their particular needs.

In numerous instances, a hybrid approach—which strategically merges onshore and offshore resources—can yield the optimal balance between quality, cost efficiency and operational flexibility.

By retaining core tasks such as requirement analysis, system architecture and project management onshore while outsourcing development and testing to offshore teams, companies can enhance their software development processes without sacrificing control over critical project aspects.

Although understanding the strengths and limitations of both onshore and offshore models is essential, it allows businesses to make informed decisions based on project scope, budget and long-term objectives. This strategic leveraging of resources can significantly bolster operational efficiency, expedite project timelines and fortify a company's competitive edge in the market.

About ISB Vietnam

At ISB Vietnam, a leading offshore software development outsourcing company in Vietnam, we’ve spent over 20 years helping companies worldwide navigate their IT requirements—offering not just skilled developers but also the high quality standards and language support that global projects demand.

Reach out to us if you are considering an offshoring strategy or seeking advice from a reliable partner to meet your organization's specific project needs. We would be delighted to showcase our expertise and resources.

Contact us today to explore potential collaboration opportunities and discover how we can contribute to your success.

 

 


 Related Posts

Top Software Outsourcing Companies in 2025: Find the Best Partner for Your Business

Why Outsource App Development? Key Benefits, Hidden Costs, and How to Get It Right

View More
OUTSOURCINGTECH

February 19, 2025

Onshore vs. Offshore: Definition, Differences, and Key Considerations

As businesses grow, they often face challenges and struggle with a lack of skilled workers, IT expertise, and industry experience. These gaps can hinder and slow operations down or make it harder to stay competitive in today’s digital world.

To bridge these gaps, businesses usually base their strategy on one of two basic models: onshore and offshore development. To put it in simple terms, onshore development refers to outsourcing software development or forming a development team based within the same country as the company, whereas offshore development means developing software or building development teams from other countries. Each strategy has its unique advantages and challenges, and the best choice will always depend on the nature of the work, considering factors such as cost, efficiency, quality control, and compliance.

This article will explore the definitions, meanings, and key differences between onshore and offshore development, with insights from ISB Vietnam, a company experienced in both models. By the end, you’ll have a better understanding of these approaches, helping you make more informed decisions.

 

What Is Onshoring? Definition and Meaning

Onshoring refers to the process of outsourcing business operations, predominantly software development and business process outsourcing (BPO), within the client company’s home country. The practice of software development through onshore outsourcing is called onshore development. Unlike offshoring, where hiring comes from other countries, onshoring provides the ability to leverage local talent with the built-in benefit of the company retaining operational control in its home country.

 

Main Benefits of Onshoring

The major advantage of onshoring is that language and cultural barriers are practically non-existent since it's all done within the same country. This eliminates miscommunication problems sometimes encountered in offshore development.

In addition, time-zone differences can be negligible or completely territory-free, allowing agile collaboration among teams. This comes especially handy when projects require constant updates, quick feedback, or rapid iterations.

Also, very relevant is compliance with local laws and regulations. Since all business activities happen under the same jurisdiction, corporations can ensure compliance with data protection laws, industry regulations, and corporate governance policies, etc. while reducing other legal and compliance risks.

 

What Is Offshoring? Definition and Meaning

Offshoring is the practice of outsourcing business processes to a foreign country, often to reduce costs, access specialized talent, or increase business scalability. Offshoring is the opposite of onshoring—while onshoring keeps operations domestic, offshoring leverages resources abroad. Similarly, when software development is carried out through offshore outsourcing, it is known as offshore development. This approach is widely used in software development and IT services, where companies seek cost-effective solutions without compromising on quality.

 

Main Benefits of Offshoring

The major reason for offshoring is to lower costs. When companies outsource work out to regions where labor costs and overhead are low, they can greatly save on labor and operational costs while sustaining high productivity.

A further benefit is access to a large skilled professional base. Some countries specialize in IT and software development and provide highly skilled personnel at very attractive rates. For example, Vietnam is gradually developing into one of the leading offshore development centers due to the rapidly expanding pool of IT candidates, cost-effectiveness, and strong technical know-how.

Vietnam has a huge and constantly growing pool of IT professionals, with over 500,000 already working in the IT sector and more than 50,000 students enrolling in computer science majors and it-related fields each year. This guarantees a vast, rich talent pool that clients can choose from as they seek solutions for software development and related services.

For more details on Vietnam's IT workforce and IT market trends, check out the following resources:

Key insights and trends for software developers in Vietnam 2024–2025

Vietnam’s IT Market Landscape 2024–2025: Why Vietnam Leads in IT Outsourcing and Offshore Software Development

 

Onshore vs. Offshore: Key Differences and Considerations

Onshore and offshore development vary quite a lot in the context of costs, the place of providing services, communication supports, flexibility, and legal considerations. Understanding these differences will help businesses to opt for the most suitable model regarding software development or outsourcing. Below, we have touched the two models according to several important considerations.

 

Onshore_vs_Offshore

 

Location

  • Onshore: A client and the outsourcing provider are located in a similar country. Their proximity makes collaboration seamless, and in-person meetings can be possible as per need.
  • Offshore: The outsourcing provider is in another country, which is often selected to save costs on labor or to find specialized talents. Offshore development is a popular choice for businesses looking to reduce expenses while maintaining high-quality service.

 

Cost

  • Onshore: Hiring within a country normally comes with higher labor costs such as salaries, office space, and operational expenses. This form of outsourcing is more expensive due to the higher labor rates for IT professionals in developed nations.
  • Offshore: Outsourcing to lower-labor-cost countries allows multiplying cost savings while still hiring well-trained professionals. Offshore companies are even more attractive for companies that are looking to gain maximum efficiency while maintaining a limited budget.

 

Communication

  • Onshore: Since both the client and the development team speak the same language while being culturally more or less alike, communication becomes smoother, hence the ability to avoid misunderstandings. Besides, there are little or no time zone distinctions, allowing real-time collaboration.
  • Offshore: The language barrier and cultural differences between clients and development teams can sometimes lead to challenges in communication, while working across multiple time zones can interrupt the constant flow of information. However, the time zone difference can also work in a company's favor by keeping the work going outside regular working hours and thus, completing a project faster.

 

Flexibility and Scalability

  • Onshore: The pool of available talent is limited to the domestic market, which could create problems in any quick scale-ups or finding specific skills on short notice. In-country team expansion is costly and may take time.
  • Offshore: By offshoring, organizations can exploit a global talent pool, enabling businesses to scale up or down rapidly according to project needs. This added flexibility is of particular advantage in large software development projects where specialized skills are necessary.

 

Legal and Regulatory Compliance

  • Onshore: Since all operations are conducted in the same country, local laws and regulations are applied, thus posing fewer legal risks. In the event of any contract disputes, these can be handled under local law.
  • Offshore: Companies are bound to comply with the laws and regulations of the provider's country, which may differ from those in their home country. Accordingly, compliance requirements can be more complex than their onshore counterparts. Nevertheless, by rounding up relevant factors such as intellectual property protection or labor laws well in advance, businesses effectively manage these workings and mitigate any corresponding risks.

 

Conclusion

Several key factors influence the decision between onshore and offshore development: cost, communication, scalability, and regulatory compliance.

Onshoring implies seamless collaboration, better compliance with the relevant local laws, and real-time interactions, making onshore development the right choice for businesses that need to monitor their projects closely and ensure continuous compliance with standards. Offshoring favors cost advantages, access to global talent, and scalability and thus can be ideal for companies aiming for high expertise and cost-effectiveness.

Both approaches have their respective advantages and disadvantages, and the establishment of one over the other is up to what the business considers first in that sense. In some cases, a hybrid approach—using both onshore and offshore development—may be one way to achieve a balance in terms of cost, quality, and efficiency.

A formal understanding of the differences between onshore and offshore development would allow a business to make informed decisions in accord with their growth strategies and mission.

The advantages and disadvantages of onshore and offshore development are explained in detail in the article below, so please take a look at this article as well.

Pros and Cons of Onshore and Offshore Development: Choosing the Right Model for Your Business Growth

 

About ISB Vietnam

At ISB Vietnam, a leading offshore software development outsourcing company in Vietnam, we’ve spent over 20 years helping companies worldwide navigate their IT requirements—offering not just skilled developers but also the high quality standards and language support that global projects demand.

If considering offshoring strategy or looking for a trusted partner to meet specifications for your organization's needs, we would like to show you our resources and expertise.

Contact us to find ways how to collaborate for your success or something.

 

Frequently Asked Questions (FAQ)

 

What is the origin of the terms Onshore and Offshore?

The origin of offshore is from marine, energy, and drilling industries, where it translates to “far from the shore” or “away from the coast”. It is often referred to in connection with "offshore drilling" (oil extraction at sea), "offshore fishing" (deep-sea fishing), and "offshore wind power" (wind farms in the ocean).

Over the years, the term started to be adopted into business: outsourcing operations into distant countries from their place of origin mainly for cost-cutting reasons. "Offshore" in this sense basically described business or development performed outside a company’s country, generally in low-cost zones. On the opposite, when operations are carried round within their home countries, they would be termed "Onshore."

 

What are the major features of offshore development in Vietnam?

Vietnam is one of the leading offshore development centers around the globe, attracting businesses worldwide.

One of the biggest advantages of Vietnam is the number of IT professionals and the labor cost-effective provision. There are about 560,000 IT professionals working in the tech industry at present. Every year, between 55,000 and 60,000 students enroll in IT-related fields. Furthermore, the average hourly rate of a software developer in Vietnam lies between $20 and $40, which is very cost-effective.

The Vietnamese government supports the development of IT talent at high national priority, with investments in tech education and the industry. This means that in coming years, offshore development in Vietnam is likely to be among the fastest-expanding ones worldwide.

For more insights into Vietnam’s IT workforce and outsourcing trends, refer to the following resources:

Key insights and trends for software developers in Vietnam 2024–2025

Vietnam’s IT Market Landscape 2024–2025: Why Vietnam Leads in IT Outsourcing and Offshore Software Development

Top Software Outsourcing Companies in 2025: Find the Best Partner for Your Business

Why Outsource App Development? Key Benefits, Hidden Costs, and How to Get It Right

View More
TECH

January 24, 2025

Using SVC classifier of Scikit-learn library for image classification

Support Vector Classifier (SVC) is part of the Support Vector Machines (SVM) family, which are supervised learning models used for classification and regression analysis.

View More
TECH

January 24, 2025

INTRODUCTION TO JSON VALIDATOR WITH JSON SCHEMA

Validating data is an important process. It helps to ensure that applications operate smoothly. One powerful tool for this purpose is the JSON Schema Validator.

In this post, I will introduce you to the fundamentals of using JSON Schema to validate your data, helping you ensure your JSON data structure follows the specified requirements.

What is JSON Schema?

JSON Schema is a declarative language for defining structure and constraints for JSON data.

JSON Schema will also be considered as a design document for input data as it is declared to define the rules, structure and constraints for input data.

What is JSON Schema Validator?

JSON Schema Validators are tools that implement the JSON Schema specification.

JSON schema validator help to check whether the input JSON data complies with the rules and structure defined in the created JSON Schema.

Try it out!

Step 1: Create a JSON Schema

To understand how to define a JSON schema, refer to the link bellow

 https://json-schema.org/understanding-json-schema/reference

In this post, I will create a simple JSON Schema for employee information as bellow

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Employee Schema",
    "type": "object",  
    "additionalProperties": false,
    "properties": {
      "name": {
        "type": "string",
        "description": "Full name of the employee"
      },
      "dateOfBirth": {
        "type": "string",
        "format": "date"
      },
      "age": {
        "type": "integer",
        "minimum": 18,
        "maximum": 65,
        "description": "Age of the employee, must be between 18 and 65"
      },
      "employee_id": {
        "type": "string",
        "pattern": "^[A-Z]{2}[0-9]{4}$",
        "description": "Employee ID in the format of two uppercase letters followed by four digits"
      },
      "department": {
        "type": "string",
        "enum": [ "HR", "Engineering", "Sales", "Marketing", "Finance"],
        "description": "Department the employee belongs to"
      },
      "email": {
        "type": "string",
        "format": "email",
        "description": "Employee's email address"
      },
      "country": {
        "type": "string",
        "const": "VietNam",
        "description": "Employee's country",
        "$comment": "Only for Vietnamese employees"
      }
    },
    "required": ["name", "age", "employee_id", "department", "email", "country", "dateOfBirth"
    ]
  }

 

Step 2: Prepare JSON Data

Prepare your JSON Instance with valid data (valid_data.json)

{
  "name": "Nguyen Van An",
  "dateOfBirth": "1994-01-15",
  "age": 30,
  "employee_id": "SL0221",
  "department": "Sales",
  "email": "annv@compa.com",
  "country": "VietNam"
}

 

Step 3: Install Ajv JSON schema validator

Ajv is used by a large number of JavaScript applications and libraries in all JavaScript environments - Node.js, browser, Electron apps, WeChat mini-apps etc. It allows implementing complex data validation logic via declarative schemas for your JSON data, without writing code.

Install AJV JSON schema validator using npm

npm install ajv  

 

Step 4: Validate JSON Data with Javascript

Now, try it with JavaScript (validate.js)      

const Ajv = require("ajv");
const ajv = new Ajv();

// Define date format
ajv.addFormat("date", { type:"string", validate: (dateString) =>{ return /^\d{4}-\d{2}-\d{2}$/.test(dateString) && !isNaN(new Date(dateString).getTime()); } });

// Define email format
ajv.addFormat("email", { type:"string", validate: (email) => { const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return emailRegex.test(email); } });

// Load JSON Schema
const schema = require("../schema.json");

// Load JSON Data
const data = require("../valid_data.json");

// Compile schema
const validate = ajv.compile(schema);

// Validate data
const valid = validate(data);

if (valid) {
  console.log("★★★ JSON data is valid! ★★★");
} else {
  console.log("-+-+ JSON data is invalid +-+-");
  //for display the validate.errors
  //console.log("JSON data is invalid:", validate.errors);
}

 

Directory structure

src/
├─ validate.js
valid_data.json
schema.json

 

Execute the javascript source code to validate the valid_data.json

Validation Result is valid data with valid_data.json


Now, I try to create an invalid_data.json with invalid data

{
  "name": "Nguyen Van An",
  "age": 14,
  "employee_id": "SL0221",
  "department": "Sales",
  "email": "annvcompa.com",
  "country": "Japan",
  "dateOfBirth": "2010-11"
}

 

Load it with javascript

// Load JSON Data
//const data = require("../valid_data.json");
const data = require("../invalid_data.json");

 

Directory structure

src/
├─ validate.js
valid_data.json
schema.json
invalid_data.json

 

Execute validate.js file

Validation Result is invalid data with invalid_data.json

To check error details, use the website https://www.jsonschemavalidator.net/

 

When to use a JSON Schema validator?

If you need to validate JSON data in your application, JSON Schema provides a standardized way to check the structure and content of the data. This is especially useful for ensuring data integrity and consistency.

 

Conclusion

By defining clear rules and constraints, JSON Schema not only minimizes errors but also enhances reliability and consistency in your applications.

JSON Schema validator helps you ensure that JSON data is structured and validated correctly.

Take the time to research and implement JSON Schema validator in your projects. You'll find that managing and validating data becomes easier and more efficient than ever before.

 

References

https://json-schema.org/overview/what-is-jsonschema

https://ajv.js.org

https://www.jsonschemavalidator.net

https://json-schema.org/understanding-json-schema/reference

https://json-schema.org/img/json_schema.svg

https://hailbytes.com/wp-content/uploads/2022/02/JSON_SchemaTitle_Image.png

View More
TECH

January 24, 2025

Easily improve performance when rendering a list of large data in Angular

As we know, Angular is one of the most popular Frontend frameworks/libraries along with ReactJS and VueJS.

There are currently many projects developing based on Angular, including those at IVC.

Therefore, the Angular user community is very large, which is very helpful in solving problems encountered when developing with Angular.

You will always receive many useful answers from others in the community.

During the process of working with Angular, I also encountered some problems related to performance.

So, in this post, I want to share with you a problem that we often do not consider when working with Angular, which is rendering a list of large data but still ensuring the response time of the website.

1. What is Angular?

Angular is an open-source frontend JavaScript framework developed by Google and commonly used for building large-scale enterprise applications.

Based on TypeScript but also supports JavaScript.

To understand more about Angular, you can refer here: https://v16.angular.io/docs

2. Rendering a list of large data in Angular

To render a list in Angular, we can use the *ngFor directive. The *ngFor is Angular's repeater directive. It repeats the host element for each element in a list.

That's the easiest way to render a list in Angular. However, this method is only really useful in cases where you need to render a list of data that is not too large.

If you have a list of data that is too large, ensuring the response time of the website must be a top priority.

At this time, if you still use the above rendering method, it will take a lot of time to process and render to the UI, which is not good for the user experience.

So, how to render in case the data is too large?

3. Solution

To render a list of large data, we have many ways in Angular, such as implementing paging, lazy-loading...

However, in this post, we just focus on the lazy-loading solution.

Lazy-loading, simply put, is a solution to split data to render many times until the last element in the list is rendered.

If you have a list of data with a length of 10,000 elements.

You can split it and render 50 elements per time.

At this time, the website only needs the amount of resources to render 50 elements instead of 10,000 elements.

This will greatly improve the response time of the website.

4. Implementation

Firstly, we need to specify a custom TrackByFunction to compute the identity of items in an iterable.

If a custom TrackByFunction is not provided, the *ngFor directive will use the item's object identity as the key.

This means that when you push more data to the original data list, it will re-render almost all the data in the data list even though there are many similar elements.

Therefore, we need to customize a TrackByFunction to compute the identity of items in an iterable.

This means that when the server needs to render more data from the original list, it only needs to render the newly added elements. This helps reduce the resource load as well as the response time of the website.

A TrackByFunction usually looks like this:

Apply it to the *ngFor directive:

Next, split the data from the original list, and push a part of the data to the rendering list (state variable).

Each time the renderListLazy() method is called, it will push new elements to the original list, 50 elements at a time.

Your task is to choose when to call the renderListLazy() method again, such as when the user scrolls to the end of the displayed data list, or when the user clicks a trigger button.

5. Experimental results

Here are the experimental results when I compared the basic rendering method and the lazy rendering method, let's observe.

With the normal rendering method, when I rendered a list of 100,000 elements.

It takes ~7.5 s, it's very poor.

With the lazy rendering method, when I also rendered a list of 100,000 elements.

With lazy rendering, it takes ~9.75 ms, it's so fast.

Through the above test, we have seen the superiority of lazy-loading, with data of 100,000 elements, lazy-loading is ~780 times faster than normal-loading.

Moreover, the performance will be more different when the number of elements of the list increases.

6. Conclusion

Through this post, I have introduced a simple technique for optimizing rendering large data lists in Angular.

Hope it is useful for you and will be applied to future projects.

Thank you for reading!


[Reference Source]

https://v16.angular.io/docs

https://angular.dev/api/core/TrackByFunction?tab=description

https://www.pexels.com/photo/hand-holding-shield-shaped-red-sticker-11035543/ (image)

 

View More
TECH

January 24, 2025

Creating a magical effect for your website with Three.js: Transforming tiny circles into a beautiful image

Three.js is a flexible JavaScript library that makes using WebGL easier and more intuitive. It lets developers create detailed 3D graphics for the web without having to deal with the complex details and low-level API of WebGL. Three.js has a variety of features, such as tools for controlling 3D objects, materials, lighting, cameras, and animations. It is created with user-friendly APIs, comprehensive documentation, and a big user base, making it not just simple for beginners to learn and use but also powerful enough for advanced projects. Three.js is a good option for creating eye-catching visual effects, interactive 3D experiences, or just simple animations.

In this blog post, I will share my approach to creating a magical effect where tiny circles (particles) rearrange themselves to form a PNG image.

View More
TECH

January 24, 2025

Vue.js and Laravel: The perfect combination for modern Web Application Development

Vue.js is a powerful JavaScript framework, while PHP Laravel is a popular PHP framework. When combined, you can leverage the strengths of both to create modern, efficient, and maintainable web applications.

1. Introduction to Vue.js and PHP Laravel

Vue.js – Frontend: A flexible and easy-to-learn JavaScript framework, often used to build interactive user interfaces. Vue.js uses Virtual DOM to optimize performance and provides powerful tools like Vue CLI for project management.

PHP Laravel—Backend: A giant in PHP programming, Laravel is a robust and comprehensive PHP framework. It offers many built-in features, such as routing, authentication, and Eloquent ORM for database management.

2. Why Combine Vue.js and Laravel?

  • Easy Maintenance: Vue.js and Laravel have clear and understandable structures, making it easier to maintain and expand applications.
  • Easy Integration: Laravel Mix makes integrating Vue.js into Laravel projects simple and efficient.
  • Large Community Support: Both frameworks have large communities and extensive documentation, making it easy to find support and learn.
  • Rich Ecosystem: With tools like Eloquent ORM, Blade, Artisan...
  • Integrated Security: Provides built-in authentication, encryption, and CSRF protection.
  • High Performance: Vue.js uses Virtual DOM to optimize user interface performance, while Laravel provides powerful tools to manage the backend.

3. Installation and Configuration

  1. Install Composer from getcomposer.org.
  2. Create a new Laravel project:
    composer create-project --prefer-dist laravel/laravel project-name
  3. Run the Laravel application:
    cd project-name php artisan serve

    The application will run at http://localhost:8000

4. Integrating Vue.js into Laravel

  1. Install Laravel Mix:

    Run the following command in the Laravel project directory

    npm install laravel-mix --save-dev
  2. Configure Laravel Mix:

    Create or edit the `webpack.mix.js` file in the root directory of the Laravel project to compile Vue.js files:

  3. Install Vue.js in Laravel

    Install Vue 3 and Vue Loader:

    npm install vue vue-loader

    Install other dependencies:

    npm install
  4. Create a Vue Component

    Create a new Vue component in the `resources/js/components` directory:

  5. Using Vue Component in Laravel

    Update the `resources/js/app.js` file to use the Vue component:

  6. Configure Vite for Vue:
    npm install @vitejs/plugin-vue
  7. Update Blade Template

    welcome.blade.php

             
    
           
  8. Run Laravel Mix

    Run the following command to compile the Vue.js files:

    npm run dev
  9. Output:

5. Example how to Vue and Laravel Work Together

1. Backend (Laravel):

Laravel handles the database, Authentication, API endpoints, and server-side logic.

Example API route for a post application:

Route::get('/login', [LoginController::class, 'index']);
Route::get('/user', [UserController::class, 'index']);
Route::get('/posts', [PostController::class, 'index']);

2. Frontend (Vuejs):

Vue.js fetches data from the Laravel API and dynamically renders it on the page.

Example using Axios:


      async handleGetPostsList() {
        const response = await axios.get('/api/posts');
        console.log('response data: ', response);
    }
  

Conclusion

Vue.js provides an interactive and flexible user interface, while Laravel offers a robust and comprehensive backend platform. Combining Vue.js and PHP Laravel allows you to leverage the strengths of both frameworks to develop modern, efficient, and maintainable web applications.

[Reference]

  1. https://vuejs.org/
  2. https://laravel.com/
  3. https://welcm.uk/blog/best-admin-templates-to-get-you-started-with-laravel-and-vuejs
  4. https://wpwebinfotech.com/blog/how-to-integrate-vuejs-with-laravel/
View More
TECH

January 24, 2025

Anti-Patterns That Every Developer Should Know

Understanding Anti-Patterns in software development

In software development, it's important to write code that is not only functional but also clean, maintainable, and scalable.

However, developers often encounter many challenges while building systems, and in some cases, they may fall into common traps known as anti-patterns.

These are poor programming practices that seem like good solutions at first but, over time, lead to inefficiencies, hard-to-maintain code, or even system failures.

In this article, I want to explore some well-known anti-patterns in software development and provide examples in code to help you understand how to identify and avoid them.

 

1. Hard-code, Magic String and Number

Hard-code means hard-coding some values and some logic that needs to be changed directly into the code, such as database connection, some configuration...

Magic string and magic number means hard-coding a number, a magical string, without clearly stating where that number/string comes from, or what it is...

For example, the code below is both hard coded and uses magic numbers.

Solution: This Anti Pattern is easy to handle. Just don't hardcode the config values (but read from the config file or know the environment), separate the magic numbers into separate variables, or write more comments.

The code after the fix is much easier to understand, right?


2. Callback hell

The concept of the callback is certainly not strange to JavaScript coders, especially when processing asynchronous JavaScript functions (like in NodeJS for example).

However, if we overuse callback functions without proper coding methods, our code will become extremely complicated and difficult to read.

 

Solution: to avoid callback hell, there are several approaches that make asynchronous code more manageable and readable. Two common solutions are Promising and Async/Await.

  • Using Promises: A Promise is an object representing the eventual completion (or failure) of an asynchronous operation and its resulting value. Promises allow you to avoid nested callbacks by chaining .then() methods.

  • Using Async/Await: Async/Await is a more modern and cleaner approach to handling asynchronous code. It allows you to write asynchronous code in a synchronous-looking manner, making it much easier to read and maintain.

 

3. God Class/Object

A God Object is an anti-pattern where a single class or object is given too many responsibilities, making it overly complex and difficult to manage.

This is a common mistake among students who are working on projects, or in projects that are too old, and written by inexperienced developers.

Gob Class means a super-huge, Divine Class that can do anything, so it is called God. This mistake occurs when developers put too many features into one class.

Solution:

  • Following the Single Responsibility principle in SOLID, each class should only have 1 Responsibility.
  • Refactor the code gradually, separate the class into smaller classes, and group functions/data that are often used together into a separate class.

 

4. Copy-Paste Programming

Another common anti-pattern is copy-paste programming, where developers duplicate code instead of abstracting common functionality into reusable functions or classes.

This is a pattern of writing code once, the next time you need to use it, copy the old code, and modify it a bit to make it run.

In the long run, this will cause the project's code to swell. The code is repetitive, and when editing or fixing bugs, many places will have to be fixed. If you forget or miss something, you will miss bugs.

Solution:
The simplest way is to separate the code that needs to be used into a separate function, a separate library to use.

 

5. Spaghetti Code

Spaghetti code refers to code that has a tangled and convoluted structure, often because of excessive use of global variables, lack of proper design, the flow is roundabout, extremely difficult to read, and difficult to fix.

The reason could be that the coding team doesn't have a specific design, or the developer is lazy so they code haphazardly. Or because the requirements are constantly changing and overlapping, but the modules and designs are not updated, so they also overlap!

Solution:

  • This is the most difficult Anti Pattern to solve completely! Because it is not only related to the code but also related to the design of the modules in the system
  • The easiest way is to destroy and rewrite when you understand the original logic, but it will take a lot of time and may lack requirements
  • You should gradually refactor the code and separate it into small parts. You can redesign the modules if necessary.


6. Golden Hammer

The Golden Hammer anti-pattern happens when a developer uses a familiar tool or technology to solve every problem, even when it's not the best fit.

For example, a programmer was assigned to develop a website project that required a simple UI and required fast response, with no animation.

However, he chose a UI library that he was familiar with even though it was quite heavy, had many unnecessary configurations, and was difficult to use for beginners.

Using the wrong tool for the job can lead to inefficiency, poor performance, and scalability issues. It's essential to choose the right tool or technology based on the specific needs of the problem.

Solution:

Evaluate the problem carefully and choose the right technology. For instance, if you need to store large amounts of unstructured data, consider using NoSQL databases like MongoDB or Cassandra instead of traditional relational databases.


7. Premature Optimization

Optimizing code is the process of editing/rewriting code to reduce size, limit input/output, increase execution speed, and reduce the amount of hardware needed.

Sometimes, optimizing code too early (not knowing where it runs slowly, and which part to optimize) is completely unnecessary, it also makes the code more complicated, harder to read, and harder to debug.

Solution:

Don't optimize too soon or too quickly. Ask yourself if the code needs or is worth optimizing.


Conclusion

Avoiding anti-patterns is crucial to writing high-quality, maintainable code. By recognizing and addressing issues like God Objects, Spaghetti Code, Lazy Classes, Copy-Paste Programming, and the Golden Hammer, developers can build systems that are easier to maintain and extend over time. As software development practices evolve, it’s essential to constantly improve our approach and learn from past mistakes


[References]
https://dev.to/yogini16/anti-patterns-that-every-developer-should-know-4nph
https://www.freecodecamp.org/news/antipatterns-to-avoid-in-code/
https://medium.com/@christophnissle/anti-patterns-in-software-development-c51957867f27

 

 

 

View More
TECH

January 24, 2025

Consuming Python API Testing with Pytest and Flake8

Testing is indispensable and crucial when developing an API for your application. It ensures that all functionalities works correctly and prevents unexpected errors. In Python, we can combine Pytest for functional testing and the Flake8 is an analysis tool to check the quality of a source code. Today, we will explore how to set up and use these tools effectively for testing an API.

1. What is Pytest?

Pytest is a flexible testing framework that supports fixtures, written in Python, and used for parameterized testing and plugins. It is ideal for API testing, capable of handling both basic and complex test cases.

2. Why write unit tests?

  • Ensure that the returned results are as expected, confirming the correctness of the API.
  • Help detect and identify parts affected by new updates, making maintenance easier.
  • Help discover and fix errors early in the development phase, reducing the risk of serious issues in the production environment.
  • Test individual parts of the API to ensure they function correctly and reliably.

3. Environment Setup

3.1. Install pytest: pip install pytest

3.2. Install flake8: pip install flake8

3.3. Install requests library: pip install requests

3.3. Install flask: pip install flask

3.4. Verify installation:

pytest --version
flake8 --version

4. How to Implement Pytest

4.1. Create an API file: app.py

4.2. Create test cases:

Test Case ID Description Steps Type Expected Result Date
TC001 Call API successful Request to the URL: http://127.0.0.1:5000/division Normal case
status_code: 200
message: "Successful"
result: 1
dd/mm/yyyy
TC002 Missing parameter "value1" Request to the URL: http://127.0.0.1:5000/division Error case
status_code: 400
error: Missing parameters
dd/mm/yyyy
TC003 Missing parameter "value2" Request to the URL: http://127.0.0.1:5000/division Error case
status_code: 400
error: Missing parameters
dd/mm/yyyy
TC004 Parameter value 2 is zero Request to the URL: http://127.0.0.1:5000/division Error case
status_code: 400
error: Invalid parameters
dd/mm/yyyy
more... ... ... ... ... ...

4.3. Create test code:

Create a test file and write your test cases. Your test file should start with test_ or end with _test.py. Here’s an example of a test file: test_app.py

4.4. Execute tests

Open a terminal and run the API: python app.py

Open another terminal and run Pytest: pytest test_app.py -v

4.5. Results

Pytest will display the results of the test cases in the terminal

4.5.1 Fail

4.5.2 Passed all test cases

5. What is flake8 and How to Implement It?

5.1. What is flake8?

Flake8 is a Python linting tool that helps you check your code for common issues and ensures it follows PEP 8 (Python's style guide).

Flake8 checks for:

  • PEP 8 compliance (Python's style guide).
  • Common bugs or code smells.
  • Unused variables or imports.

By integrating flake8, you can ensure that your code is clean, maintainable, and adheres to industry standards.

5.2. Run Flake8 to check for issues in the source code: flake8 app.py

5.3. Result:

Fail

When an error occurs, you can refer to the rules of Flake8 at Flake8 Rules (https://www.flake8rules.com/) to fix the error. This site provides a detailed list of rules, helping you to easily understand and correct issues in the source code according to PEP 8 standards.

Passed

Conclusion

Combining Pytest and Flake8 streamlines code quality assurance. Pytest validates functionality, while Flake8 enforces coding standards, ensuring your code is both robust and well-structured.

Reference

  1. https://docs.pytest.org/en/
  2. https://flake8.pycqa.org/en/latest/
  3. https://www.flake8rules.com/
  4. https://dev.to/coderpad/a-guide-to-database-unit-testing-with-pytest-and-sqlalchemy-1i96
View More
1 2 3 4 5 16