#vanilla javascript
Matthew Swensen
Feb 17, 2021 ⋅ 5 min read

How polymorphic JavaScript functions affect performance

Matthew Swensen Principal software engineer and open source enthusiast.

Recent posts:

Build Full-Stack App React Goxygen

Build a full-stack app with React and Goxygen

We show how to use Goxgen to scaffold a full-stack React app. See how to integrate React with Go and modify Goxygen to suit your project requirements.

Clara Ekekenta
Dec 6, 2023 ⋅ 8 min read
Express Js Adoption Guide Overview Examples Alternatives

Express.js adoption guide: Overview, examples, and alternatives

Express.js is a Node.js framework for creating maintainable and fast backend web applications in JavaScript. In the fast-paced world of […]

Antonello Zanini
Dec 6, 2023 ⋅ 17 min read
Nesting web components in vanilla JavaScript

Nesting web components in vanilla JavaScript

Web components are underrated for the performance and ergonomic benefits they provide in vanilla JS. Learn how to nest them in this post.

Mark Conroy
Dec 5, 2023 ⋅ 10 min read
Using Defer In Angular 17 To Implement Lazy Loading

Using defer in Angular 17 to implement lazy loading

Angular’s new defer feature, introduced in Angular 17, can help us optimize the delivery of our apps to end users.

Lewis Cianci
Dec 4, 2023 ⋅ 10 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