2021-02-17
1574
#vanilla javascript
Matthew Swensen
33999
Feb 17, 2021 â‹… 5 min read

How polymorphic JavaScript functions affect performance

Matthew Swensen Principal software engineer and open source enthusiast.

Recent posts:

Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 â‹… 7 min read
Using Aoi Js To Build A Bot For Discord

Using aoi.js to build a bot on Discord

Explore how the aoi.js library makes it easy to create Discord bots with useful functionalities for frontend applications.

Rahul Padalkar
Apr 17, 2024 â‹… 9 min read
Web Components Adoption Guide: Overview, Examples, And Alternatives

Web Components adoption guide: Overview, examples, and alternatives

Evaluate Web Components, a set of standards that allow you to create custom HTML tags for more reusable, manageable code.

Elijah Asaolu
Apr 16, 2024 â‹… 11 min read
Using Aws Lambda And Aws Cloudfront To Optimize Image Handling

Using AWS Lambda and CloudFront to optimize image handling

Leverage services like AWS Lambda, CloudFront, and S3 to handle images more effectively, optimizing performance and providing a better UX.

Nitish Sharma
Apr 12, 2024 â‹… 12 min read
View all posts

One Reply to "How polymorphic JavaScript functions affect performance"

  1. The overloading of a function is only one type of polymorphism. Javascript does not support overloading. One this function breaks SOLID principles on so many different levels. Two this function should never have made it past code review. Polymorphism is a good thing. It allows robust, reusable and maintainable code. You cannot write bad code much less in one example to discredit an entire paradigm. Good writing, but monomorphic functions are not the future. By creating a one to one mapping between types and return statements we eliminate robustness in the code base and increase the amount of code we have to write. Without polymorphism we don’t have templates, or generics. Code becomes static. Hence useless beyond the current use case.

Leave a Reply