Why would you have to choose? Yii is a PHP framework for server side programming and JavaScript is mostly client side programming for the front end. With the rise of Node you can have JavaScript live on the server and in the client space, you can’t do that with PhP. At the end of the day you stick with what you’re familiar with.
yii is the PHP framework so it is back-end programming language. in addition, javascript is client-side programming. it may be, you can compare for backend tools php vs node.js
While Javascript allows server-side-render, the main "goal" of javascript is dynamic sites.
Yii is only server-side;
cons:
a) it uses resources of the server.
pro:
a) it's seo friendly
b) it's more safe.
Yii is not the most popular framework nowadays. I can't hardly see a reason to start with it rather than using Laravel or Symfony which you may find a lot of info about to help your learn it faster
If you are starting in programming, I may prefer to chose the Javascript stack instead of this technologies. You will be able to develop both front end and back end applications using, more or less the same language patterns. But if you go the PHP way, you will need to rely on a front-end programmer to help you or you may end having to learn some frontend language like JS or Dart.
Personally I only love PHP because it's the Wordpress base. And I like Javascript because it is the React base in which WP Gutenberg is based on. Obviously I'm a tremendous fan of WP
i've been in software engineering industry (and currently partially is) for about 10 years and have some experience with almost every major language.
nowadays js is very widely used on both client & server side. i even use it for standalone software sometimes. main bonus here is that you can keep all parts of your product's architecture in one language. it's 2019, not 2009 now (regarding the comments saying that js is to be used as a client-side language).
regarding php - despite that the big chunk of internet is currently running on it, it's a slowly dying language (but surely still useful for years ahead) http://pypl.github.io/PYPL.html
in any case, it's usefull to know multiple languages cause language should be chosen based on your task, not the opposite way. as for purely server side language, i would advise learning Go or python instead of php.
In addition i would advise to checkout GraphqQL - new query-based approach to api architecture (instead of REST) created by facebook. been using it in past few projects https://www.apollographql.com/
The correct question would be comparing Javascript vs PHP.
But Yii Framework is a PHP Framework, nowadays the best frameworks for PHP would be Laravel or CodeIgniter.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.