In defense of being premature

A case study [informed rant] on premature optimization with JavaScript anonymous functions

The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming.

Example

Find all users that are assigned to cards with the label “DESIGN” of my personal workspace boards; or have a “MEMBER” or “ADMIN” permission on any board in my workspace called “DESIGN”; or are owners of any of the boards in my workspace called “DESIGN”. Eliminate duplicates by id.

v1
v2

Make it every minute on average and ship it.

v3
memory usage in MB
this.children = parentData.children.map((_childData) =>
new ChildVM(_childData)
)

Conclusion

Addendum: Example Methodology

execution time in milliseconds

--

--

Software Engineer 👨‍💻 | Wannabe Writer ✍️ | History Buff 🏺 | Worldbuilder 🌍

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Petar Kovačević

Software Engineer 👨‍💻 | Wannabe Writer ✍️ | History Buff 🏺 | Worldbuilder 🌍