Jump to content

I need a piece of advice about my future development


Truman

Recommended Posts

I month ago I started learning javascript. A couple of days ago I started attending WordPress course ( I want to become a freelancer - WP developer).A lecturer on this course told me that if I want to be WP expert it is better for me to learn PHP because templates are made with that language.Now, I'm a bit confused. Should my priority be javascript or php?I would appreciate opinions...

  • Like 1
Link to comment
Share on other sites

PHP is used to access data from database where WP content is saved, and also for template to change design from 1, 2, or 3 column layout, to add remove sections depending on requirement, contact forms etc so it is vital to learn php above JavaScript, as JavaScript is used mainly to enhance the site and make it more user friendly.

  • Like 1
Link to comment
Share on other sites

Try and understand the design concept of MVC, or (Model-View-Controller). its a design pattern used in many software applications but is a very solid choice for most website applications.

Model - Stores all the internal data that the application uses. e.g. the database for websites.

View - What the end-user sees, experiences, and interacts with. e.g. the webpage in their browser.

Controller - The internal software application that "controls" the information flow between the model and View. e.g. the server

 

This mindset helps define the responsibilities of each section of the application:

The View is responsible in making a nice and friendly interface for the user and translating the inputs the user sends into actual requests the Controller can understand.

The Controller is the Brain of the application, it takes the requests from the user and considers what requests can or should be fulfilled and communicates to the Model.

The Model is simply raw data (database) full of information who's entire job is to grab or store massive amounts of data as efficiently as possible return any responses back to the controller.

The Controller then filters the data returned and passes it back as a smaller chunk of information to the view

Finally the View takes this chunk of information and arranges it in a way that makes it easier for the end-user to understand.

 

notice that the Model and the View do not talk directly to each other, they must go through the controller. the view shouldn't reach the model for security reasons. like-wise the model shouldn't reach to the view because its not supposed to worry about the context of the information its generating. The controller is the proxy, translator, operator, or ambassador, whichever makes best sense to you.

 

So how does this apply to your question?

 

Javascript is pretty laid back and lightweight and uses an interpreter to run the code. This enables it the flexibility desired to run on most platforms and remain stable, but is usually slower than its counterparts. as such Javascript is usually best used in the View section of the web application (the user's browsers) since the end user will be running on a huge array of operating systems, from PC to Phone, or even console, where its flexibility can be taken advantage of, and speed isn't an issue.

 

PHP is a little more strict but faster than Javascript. It has a lot of control (not as much as C++, but then again you don't need as much as C++) and is strong enough to process a decent amount of logic effectively. So you typically see either it or Java used as a server-side language for servers that may need to process thousands of requests a minute.

 

SQL or Oracle are all about grabbing and storing data FAST, and less about figuring out what to do with the data which would greatly slow them down. so these languages are not designed to have the same level of flexibility as the other languages because it needs to search billions of rows of data, gather it, and return it as fast as possible. and so make great choices for Model sections of applications.

 

 

My advice is that it would benefit you to learn both, it would only help your resume, and simply understand the roles that each language works best in. Your priority depends on which section of the MVC pattern you feel is most important to your current project (they're not always weighted the same for all websites).

  • Like 1
Link to comment
Share on other sites

Wordpress does not use MVC, you can get plugin or get a Wordpress that has been set up to use MVC framework (zend I believe). Although its good to know about the MVC architecture, its not needed for basic Wordpress theme, until you have mastered php coding used in function.php, the creation of specific theme pages and coding used to communicate to Wordpress to retrieve required data to show in specific layout area within Wordpress.

  • Like 1
Link to comment
Share on other sites

Templates are built to server script languages such as PHP, ASP.NET depending if they use linux apache, or windows IIS server.Wordpress uses PHP, page.php is the main template page, the default page and other pages created, which are different to default are shown within this template page and are selected when creating page or post.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...