having fun with code

Performance matters

I just read this on an email from a Google’s Closure developer:

Adding runtime checks for invalid usage is something we have policy against. It adds to the code size as well as to the runtime cost.

I totally agree. Developers should be responsible for their usage of APIs or third party libraries, while these should focus on working as efficient as possible given the correct parameters. Being Javascript a non-strongly-typed language, checking the parameters passed to every function are right at runtime would be a huge overkill.

Related Posts:

2 Comments to Performance matters

  1. May 17, 2010 at 23:00 | Permalink

    Still, a good idea would be to provide a debug version which logs errors (e.g: firebug), so developers can use it during development, to know they are not doing anything wrong.

    Of course, I agree is not a good idea to use it in production/live site.

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Additional comments powered by BackType

About the blog

This is a blog about development, focused mainly on Javascript but also other languages like python, shell scripts and more.

About the author

Eneko Alonso is a software engineer and UI developer with more than eight years of experience in software and web development. He lives in San Luis Obispo, California and works at LEVEL Studios.

Contact Info

Contact Info

PromoteJS

JavaScript JS Documentation