Question about same stuff on multiple pages

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 941 Views - Last Post: 08 August 2014 - 08:35 AM

#16 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,876
  • Joined: 12-December 12

Re: Question about same stuff on multiple pages

Posted 08 August 2014 - 02:12 AM

That is sort-of correct but it also sounds like you are now guessing rather than reading-up on the subject.

Server-side scripting :wikipedia

The fact that the script might be executed faster is irrelevant. Your description suggests that there is a choice as to whether to run a script on the server, or on the client. This is not the case: client and server-side scripts run in different environments and serve different purposes. Continue your research.
Was This Post Helpful? 0
  • +
  • -

#17 ge∅  Icon User is online

  • D.I.C Addict

Reputation: 78
  • View blog
  • Posts: 555
  • Joined: 21-November 13

Re: Question about same stuff on multiple pages

Posted 08 August 2014 - 07:08 AM

I don't think it's true. You always kind of have the choice.

There are some general rules indeed: typically, when security matters, you do critical stuff on the server side. When you have a lot of users and when server load matters, you do as much as you can on the client side. Sometimes it's accessibility, compatibility, SEO, maintainability, speed, etc. that matters. There is always a good reason to choose to do or store things on the server side or on the client side. I don't think it's irrelevant to mention it.

For example, not so long ago, when you had to crop and downscale an image, you could only do it on the server side and it was slow (download time, image processing time, etc.). Now you can do it with Canvas and the File API: it is not available for everyone (you need an up to date browser), but it's more user friendly, it's faster and it saves CPU and memory on your server. You can either implement both solutions and have the server-side version work as a fallback, but it's more work, do it the old way on the server side, or make the functionality available only for the happy few. The choice is yours.

This post has been edited by ge∅: 08 August 2014 - 07:10 AM

Was This Post Helpful? 0
  • +
  • -

#18 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,876
  • Joined: 12-December 12

Re: Question about same stuff on multiple pages

Posted 08 August 2014 - 07:45 AM

Fair comment ;)

It is especially true nowadays, with a number of different technologies, that the distinction between client and server-side is less clear-cut than it was. However, for a beginner, I think it is important to emphasize that client and server provide different environments, and work in different ways. Once they have understood this then, as they progress further, they will discover where the two can overlap.
Was This Post Helpful? 0
  • +
  • -

#19 ge∅  Icon User is online

  • D.I.C Addict

Reputation: 78
  • View blog
  • Posts: 555
  • Joined: 21-November 13

Re: Question about same stuff on multiple pages

Posted 08 August 2014 - 08:09 AM

Agreed. When I was learning PHP, I used to tell myself there were two different stories happening in two different worlds at two different moments with no connections between the two except the HTTP requests.

Now you can execute the same JS script on the server side and on the client side at the same time. Good luck to beginners :P
Was This Post Helpful? 0
  • +
  • -

#20 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,876
  • Joined: 12-December 12

Re: Question about same stuff on multiple pages

Posted 08 August 2014 - 08:35 AM

I thought they were adjacent rooms, with no windows but a small door ;)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2