Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:22:19+00:00 2026-05-28T05:22:19+00:00

If my site doesn’t require any sort of optimization and my object structure is

  • 0

If my site doesn’t require any sort of optimization and my object structure is fairly flat and so there is no need for inheritance, should I be using prototypes at all:

MyObject.prototype.<something>

I refer to this question Javascript when to use prototypes and various writings by John Resig who seems to focus on the performance values of prototype.

I find using the module pattern to define objects and their functions easier to read and manage and as michielvoo mentions, premature optimization tends to cause more harm than good.

Are there any other benefits or uses cases for prototype?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:22:20+00:00Added an answer on May 28, 2026 at 5:22 am

    It’s a code organization pattern.

    There are two good ways to share methods across objects

    var oneWay = Object.create(bagOfMethods);
    // some value of extend that is sensible
    var otherWay = extend({}, bagOfMethods);
    

    The only real advantage prototypes gives is that the link between oneWay and bagOfMethods is live.

    Having a live link allows really powerful extensions and monkey patching.

    An example is Object.prototype.methodNowLivesOnAllInstances = function () { };

    This is a way of doing “asynchronous” programming, you can extend the “class” without worrying whether all instances get the new method.

    A note on the modular pattern, it’s bloated and not needed. Use a module builder like modul8 or browserify instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to go around a site using java programmatically but the site doesn't
I went to the webkit.org and, honestly saying, the site doesn't provide any tutorial
I have a swf file on my site and it doesn't work on Iphone/Ipad
I'm trying to test this out on my site but it doesn't quite work
The jQuery ajax script below doesn't work on my site if url is without
i'm testing a flash site with Charles Proxy. It doesn't appear to be throttling
How to find out if site is the first item in history? This doesn't
Does anyone know any site or book that presents problems like python challenge ,
The sharepoint site doesn't allow anonymous access and uses forms authentication, however I have
This site doesn't return anything when I try to parse it using CURL. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.