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

  • Home
  • SEARCH
  • 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 7401393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:27:21+00:00 2026-05-29T04:27:21+00:00

Whenever there is dilemma to do a particular task, which can be accomplished either

  • 0

Whenever there is dilemma to do a particular task, which can be accomplished either by client side code or by using a server code, which should be preferred?

For example:

I can iterate through a javascript object and construct a string and then send it to server, or should i send the javascript object and process it in the server?

My views: whenever I come across this situation I use the client side code as it reduces the computation load on server.

What has to be done in such a situation? Which is the right approach?

  • 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-29T04:27:21+00:00Added an answer on May 29, 2026 at 4:27 am

    (This answer assumes a web programming context)

    I personally put a lot of front-end logic in Javascript running on the client side, because it makes things very responsive, even for people with a slow connection. This also means that some functionality continues working even if the user goes offline. I find some programmers use AJAX for things which don’t reallly require communication with the server at all.

    When using this technique, if possible, I find it helpful to embed all the data which the front-end Javascript may need in the page, so it doesn’t have to go back and request more data from the server using an AJAX call. (In general, whenever data is being communicated over a high-latency channel, you want to send it in big chunks so the client doesn’t have to keep constantly coming back for more. The same applies to DB queries: you can often increase performance by pulling back all the data you might need with a single query, rather than making numerous fine-grained queries. Even if you don’t end up using all of that data, performance will still usually be better.)

    One caution: unless you are very disciplined to keep things organized, Javascript which updates the UI by dynamically generating HTML in response to user actions can become very hairy. If the Javascript is also dynamically generated using another language (running on the server side), things can get downright frightening.

    Testability is also important in any app. If you are using something like Selenium, testing a combination client/server web app may not be a problem, but if you aren’t, testing server-side code may be easier.

    As others have noted, you must also make sure that you don’t compromise security. Don’t expect that people will only invoke your server-side code in the way you provide for. View all the types of requests your server handles as forming an “API” which people may invoke with any arguments and in any order.

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

Sidebar

Related Questions

How can I write regular expression in which whenever there is 0000 there should
Is there a way to run some custom Javascript whenever a client-side ASP.NET validator
Is there anyway to have a client side small database that syncs with server
I don't want to change the java code whenever there is addition of tag
Is there a down side? I feel almost dependent on it now. Whenever a
I want to alert the user whenever there's an AJAX error. You can do
I've got a widget which will update itself whenever there's a configuration change (such
I have the requirement that whenever there is a model get's added/changed/deleted, it should
I am trying to parse some data using nsxmlparser, whenever there is a &(ampersand)
I'm using cakephp and whenever there comes a session based flash message, there comes

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.