Which language should I use out of javascript or php?
-
Hi,
It is my intention to build a site shop for a photographer but I have no idea which would be the next appropriate language to focus on learning to get the job done out of Javascript or PHP.
What with other work commitments, I don't have the time to learn enough of both languages before the intended date of the site going live at the beginning of December.
I'm hoping that if I give you an outline of the kind of functionality I want you will be able to point me in the appropriate direction:
The photographer in question has a vast number of images they wish to sell as singles, or in sets of three for a reduced price in comparison to buying singles.
The images will be displayed in categories, each of which has the potential to run into a number of pages.
Customers are to be free to choose any image from any page of any category to make up their purchases.
I don't currently want to build a login and members capacity so that session data (the selections made) can be stored and come back to at a later date.
For now I want to be be able to allow customers to, on a single session basis, select as many images as they wish and then preview their selection prior to adding their final choice/s to a basket ready to check out.
I also want to be able to ensure that if there is a session in which a customer previews their choice, sees they have eight images selected, for example, and want to choose one more - in order to benefit from the set of three price, that they can go back to continue shopping without loosing the selections they had made prior to going to the preview page.
In terms of the shopping basket I cam across a paypal specific script that can be incorporated into html without the need to therefore build a php and mysql basket into the site.
I anticipate that I will have to use radio buttons or check boxes for customers to be able to make their selections prior to previewing them. But is it possible, or feasible for a form to span all the category pages and their sub pages?
Thanks in anticipation of you consideration and response
-
Hi,
It is my intention to build a site shop for a photographer but I have no idea which would be the next appropriate language to focus on learning to get the job done out of Javascript or PHP.
What with other work commitments, I don't have the time to learn enough of both languages before the intended date of the site going live at the beginning of December.
I'm hoping that if I give you an outline of the kind of functionality I want you will be able to point me in the appropriate direction:
The photographer in question has a vast number of images they wish to sell as singles, or in sets of three for a reduced price in comparison to buying singles.
The images will be displayed in categories, each of which has the potential to run into a number of pages.
Customers are to be free to choose any image from any page of any category to make up their purchases.
I don't currently want to build a login and members capacity so that session data (the selections made) can be stored and come back to at a later date.
For now I want to be be able to allow customers to, on a single session basis, select as many images as they wish and then preview their selection prior to adding their final choice/s to a basket ready to check out.
I also want to be able to ensure that if there is a session in which a customer previews their choice, sees they have eight images selected, for example, and want to choose one more - in order to benefit from the set of three price, that they can go back to continue shopping without loosing the selections they had made prior to going to the preview page.
In terms of the shopping basket I cam across a paypal specific script that can be incorporated into html without the need to therefore build a php and mysql basket into the site.
I anticipate that I will have to use radio buttons or check boxes for customers to be able to make their selections prior to previewing them. But is it possible, or feasible for a form to span all the category pages and their sub pages?
Thanks in anticipation of you consideration and response
Member 15952980 wrote:
to get the job done out of Javascript or PHP.
You probably need both: PHP runs in the server to do the backend work, while Javascript runs in the browser to manage the actual presentation (and data capture, etc.) of the web page. You might be better looking into something like Wordpress which has many templates that you can adapt to your own needs.
-
Member 15952980 wrote:
to get the job done out of Javascript or PHP.
You probably need both: PHP runs in the server to do the backend work, while Javascript runs in the browser to manage the actual presentation (and data capture, etc.) of the web page. You might be better looking into something like Wordpress which has many templates that you can adapt to your own needs.
Thankyou Richard. Reguarding using Wordpress, I'm confident with HTML and CSS and was hoping to hand code the whole site to avoid generating lots of code I don't understand, and therefore wouldn't be able to debug more easily. Are you familiar with Wordpress? (I've never used it but know it is avaialable as part of the hosting package I purchased for a HTML site I built) If so do you envisage it being buggy within the context of the functionality I want?
-
Thankyou Richard. Reguarding using Wordpress, I'm confident with HTML and CSS and was hoping to hand code the whole site to avoid generating lots of code I don't understand, and therefore wouldn't be able to debug more easily. Are you familiar with Wordpress? (I've never used it but know it is avaialable as part of the hosting package I purchased for a HTML site I built) If so do you envisage it being buggy within the context of the functionality I want?
Member 15952980 wrote:
If so do you envisage it being buggy within the context of the functionality I want?
I have not used Wordpress myself, but I know it is in wide use. As to whether it would be buggy, there is only one way to answer such a question.
-
Member 15952980 wrote:
If so do you envisage it being buggy within the context of the functionality I want?
I have not used Wordpress myself, but I know it is in wide use. As to whether it would be buggy, there is only one way to answer such a question.
Fair point. It may well be my best bet for now given the timeframe I have to work to.
-
Hi,
It is my intention to build a site shop for a photographer but I have no idea which would be the next appropriate language to focus on learning to get the job done out of Javascript or PHP.
What with other work commitments, I don't have the time to learn enough of both languages before the intended date of the site going live at the beginning of December.
I'm hoping that if I give you an outline of the kind of functionality I want you will be able to point me in the appropriate direction:
The photographer in question has a vast number of images they wish to sell as singles, or in sets of three for a reduced price in comparison to buying singles.
The images will be displayed in categories, each of which has the potential to run into a number of pages.
Customers are to be free to choose any image from any page of any category to make up their purchases.
I don't currently want to build a login and members capacity so that session data (the selections made) can be stored and come back to at a later date.
For now I want to be be able to allow customers to, on a single session basis, select as many images as they wish and then preview their selection prior to adding their final choice/s to a basket ready to check out.
I also want to be able to ensure that if there is a session in which a customer previews their choice, sees they have eight images selected, for example, and want to choose one more - in order to benefit from the set of three price, that they can go back to continue shopping without loosing the selections they had made prior to going to the preview page.
In terms of the shopping basket I cam across a paypal specific script that can be incorporated into html without the need to therefore build a php and mysql basket into the site.
I anticipate that I will have to use radio buttons or check boxes for customers to be able to make their selections prior to previewing them. But is it possible, or feasible for a form to span all the category pages and their sub pages?
Thanks in anticipation of you consideration and response
Given the choice between JavaScript and PHP, master JavsScript and also use Node for the backend work. It'll take you further these days.
Jeremy Falcon
-
Given the choice between JavaScript and PHP, master JavsScript and also use Node for the backend work. It'll take you further these days.
Jeremy Falcon
Thanks for insight. I've never heard of Node before and just read a basic introduction about what it can do on W3 schools... I notice that Node work in partnership with mysql as php does. Mysql is my intended progression after php or Node.js So does using Node mean you can skip learing php altogether? Also, considering it is javascript based, are the server side scripts run entirely on the server as with php? Or are there client and server security concerns that put using it at disadvantage compared to using an entirely server side language such as php?
-
Thanks for insight. I've never heard of Node before and just read a basic introduction about what it can do on W3 schools... I notice that Node work in partnership with mysql as php does. Mysql is my intended progression after php or Node.js So does using Node mean you can skip learing php altogether? Also, considering it is javascript based, are the server side scripts run entirely on the server as with php? Or are there client and server security concerns that put using it at disadvantage compared to using an entirely server side language such as php?
Member 15952980 wrote:
So does using Node mean you can skip learing php altogether?
Yes
Member 15952980 wrote:
Also, considering it is javascript based, are the server side scripts run entirely on the server as with php?
Yes. One of the main advantages to Node too, is that you can have what's called an isomorphic application. Which is a fancy of way of saying you can run the same code on both the client and server. Stuff that accesses the DOM will be client only, but for algorithmic type routines it's the same code.
Member 15952980 wrote:
Or are there client and server security concerns that put using it at disadvantage compared to using an entirely server side language such as php?
No security concerns that PHP wouldn't also suffer. The main considerations are performance and available libraries. Google has put a lot of work into V8 (the JS engine Node is built on), so it's not nearly as slow as people would think. PHP can pre-compile into bytecode to speed up parsing prior to execution, but V8 also JITs in real time to native code in memory. Don't get me wrong, V8 will never be as fast as C/C++ or Rust and it's single threaded. But when compared to things like PHP, it does pretty well. [PHP vs Node js - Which programs are fastest?](https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/php.html) PHP has a ton of built in functionality, like say for editing PDF files. Node doesn't. Fortunately, the community is huge for Node so finding a package to do most stuff is rarely a problem. In fact, it's so huge the real problem will be knowing which packages to avoid. I say this as a dude who used to love PHP. I'll always have a fond soft spot for it, but times change.
Jeremy Falcon
-
Member 15952980 wrote:
So does using Node mean you can skip learing php altogether?
Yes
Member 15952980 wrote:
Also, considering it is javascript based, are the server side scripts run entirely on the server as with php?
Yes. One of the main advantages to Node too, is that you can have what's called an isomorphic application. Which is a fancy of way of saying you can run the same code on both the client and server. Stuff that accesses the DOM will be client only, but for algorithmic type routines it's the same code.
Member 15952980 wrote:
Or are there client and server security concerns that put using it at disadvantage compared to using an entirely server side language such as php?
No security concerns that PHP wouldn't also suffer. The main considerations are performance and available libraries. Google has put a lot of work into V8 (the JS engine Node is built on), so it's not nearly as slow as people would think. PHP can pre-compile into bytecode to speed up parsing prior to execution, but V8 also JITs in real time to native code in memory. Don't get me wrong, V8 will never be as fast as C/C++ or Rust and it's single threaded. But when compared to things like PHP, it does pretty well. [PHP vs Node js - Which programs are fastest?](https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/php.html) PHP has a ton of built in functionality, like say for editing PDF files. Node doesn't. Fortunately, the community is huge for Node so finding a package to do most stuff is rarely a problem. In fact, it's so huge the real problem will be knowing which packages to avoid. I say this as a dude who used to love PHP. I'll always have a fond soft spot for it, but times change.
Jeremy Falcon
Thank you very much Jeremy for taking the time to answer my questions and concerns. I did do a course on PHP years ago, just before the laucnch of Node.js, and figured it would be easiest to just go back to learning that from scratch. But as you say times change. You mention that PHP has a ton of functionality that Node doesn't.... My limited knowledge of php did leave me wanting to go forwards with certain capabilities. In a personal capacity I would like to build a music database. Would I be able to use Node, in conjuntion with mysql to: - make directories (to, for example, store uploaded mp3 files) - make pages (to, for example, print html code to make a html document) Thanks in advance for your consideration
-
Thank you very much Jeremy for taking the time to answer my questions and concerns. I did do a course on PHP years ago, just before the laucnch of Node.js, and figured it would be easiest to just go back to learning that from scratch. But as you say times change. You mention that PHP has a ton of functionality that Node doesn't.... My limited knowledge of php did leave me wanting to go forwards with certain capabilities. In a personal capacity I would like to build a music database. Would I be able to use Node, in conjuntion with mysql to: - make directories (to, for example, store uploaded mp3 files) - make pages (to, for example, print html code to make a html document) Thanks in advance for your consideration
You'll be just fine in Node. It offers a bunch of modules to access things like the file system... on the server side. And there are plenty of ways to connect to a DB such as MySQL.
Jeremy Falcon