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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:33:06+00:00 2026-06-04T23:33:06+00:00

Sorry for the mouthful of a title! Basically, I’m writing some code at the

  • 0

Sorry for the mouthful of a title!

Basically, I’m writing some code at the moment and it includes a chatroom. I’m wondering how best to handle people joining and leaving.

I’m doing this in HTML and Javascript and wondering whether it is ‘better’ to, when someone leaves or joins, to send the entire updated list of people to everyone else, or to only send the names of the person joining or leaving.

Basically, let’s say someone leaves a chat room of 10 people. (The rooms will usually have 10 or less people). Is it more wise for the server to send the updated list of 9 people to all other clients and just remove every item from the listbox and repopulate it, or should a message just be sent to everyone saying “this person joined/left” and then every client can update their listbox of users accordingly.

As far as I know, in Javascript, you can’t just go to an item in a listbox and remove it. You have to loop through the entire listbox and upon finding the desired item, remove it. This being the case, I imagine in my situation it may be better to send the entire updated list because there usually won’t be any more than 10 people in a room and it’s safer and users can’t get desynched from one another through strange connectivity issues. Is this indeed the case?

  • 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-04T23:33:08+00:00Added an answer on June 4, 2026 at 11:33 pm

    This decision is completely implementation-dependent.

    From a basic point of view, sending a full list is more bullet-proof in order to keep the list’s consistency, as well as easier to maintain and implement.

    Sending only the changes to the client’s browser will provide less bandwidth usage on both ends and suffice if well implemented.

    However, if the bandwidth isn’t an issue and your project is a small-medium scope one, I’d go with the first option which is much easier to implement and maintain – unless you’re looking for a challenge or making an application for a huge number of users, then go for the second option.

    Ultimately, the decision relies on the programmer’s conscience.

    edit: As this doesn’t relate directly to code, maybe this question be more suitable for Programmers?

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

Sidebar

Related Questions

Sorry, I don't know how express my question, i have some code in C#
Sorry for the bad title - I simply do not know what to call
Sorry if this is a noob question, but All my code is error-free and
(sorry about the long title) I have a custom object Person, which in turn
Sorry for the non-descript title, but I'm having a hard way with words right
Sorry for the bad title but it's a little complicated to get across in
Sorry the title is not very descriptive but it is a tricky problem to
Sorry I'm new here and my code will probably not be properly displayed... how
Sorry if the title is not clear enough, I have <a> elements with the
sorry if the title is worded oddly, not really sure how to say it.

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.