Hi guys.

The thing is that I have some experience with other programing languishes like Java and C#. I recently got into php and java script.
The questions is when wold you prefer to use java script functions over php. For example say the random function. I'm aware of the disadvantage of java script that it can be turned off. But is there like a guide line like the browser processes java script faster or something like that?

Thank you for your time.

Recommended Answers

All 2 Replies

Hi guys.

The thing is that I have some experience with other programing languishes like Java and C#. I recently got into php and java script.
The questions is when wold you prefer to use java script functions over php. For example say the random function. I'm aware of the disadvantage of java script that it can be turned off. But is there like a guide line like the browser processes java script faster or something like that?

Thank you for your time.

Generally many things should be faster with javascript, as it can do stuff without contacting the server, but you shouldn't rely on for anything that you want to
make sure is done, as it can be turned off, and also don't want to rely
on it to care about your security, like validating user input.

Even when you use php, you can use javascript for users convenience, with making
sure php is taking care of things that javascript misses.

I'd use javascript function for some math tutorial I guess:) though i even used it to make an interactive app - and i simply prevented users from seeing the app at all if javascript turned off

i think these 2 (js and php) complement each other, and syntax is not too different, so why not learn both?

my way was php first, as it can definitely can get things done, and js second, as an addition and enhancement

Thank you very much. This was very helpful!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.