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 8350139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:13:22+00:00 2026-06-09T08:13:22+00:00

Where I was working as an intern, working on a JavaScript front end project

  • 0

Where I was working as an intern, working on a JavaScript front end project with Backbone.JS, I was using those getters and setters as provided by the framework (Backbone) but was asked to define my own to make it clear whats public/private. I was more for using those provided by the backbone. Whats the better practice or recommended method here?

Then recently, I was developing my own ExpressJS/Mongoose app, I started off thinking I define a Todo model then a Todos collection that exposes functions like byId, byList etc, but then I was thinking perhaps I should just use those provided by Mongoose?

The advantage of using the provided getters/setters will be

  • Less code, less bugs
  • standard way of getting/setting. Instead of 2 (from framework + custom)
  • Another developer will just need to learn the framework instead of my custom code to understand whats happening

Cons:

  • a little longer code
  • less sense of whats private whats not, but I think this is not very important … esp in a dynamic language

Again, whats recommended here?

  • 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-06-09T08:13:24+00:00Added an answer on June 9, 2026 at 8:13 am

    If the framework allows it to you, write your own getters/setters only when you have to modify the behaviour of the default getters/setters.

    There’s no reason to write them if not needed, IMHO.

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

Sidebar

Related Questions

Working on a small game using an HTML5 canvas, and javascript. And it's working
I am a Software intern working on a large project in C++, & I
Ok, so I have a project I'm working on: http://www.d2burke.com/exp/intern/ BaseURL is set to:
I'm working on my new project but I can't figure out how to add
since monday, i'm working as an intern in a company (final year at college)
Working on the problems on Project Euler to try to learn Clojure. I'm on
I am working on a project where I have to import a DLL file
I am working on an application suite comprising of multiple Automation servers written using
as opposed to writing your own library. We're working on a project here that
I have java project with building rpm by maven. Required create noarch packets, but

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.