Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

What track should I focus on? PHP development or Wordpress Development?

Hello Community!

I need to build a wordpress based website that needs to store voucher codes. Then a validated user punches in a code and it compares to existing and valid codes to accept the entry.

I know a bit about wordpress but never dove deep into the backend, that being said, should I invest my time in the PHP development track to learn what i need for this project, or will the wordpress development teach me how to add and compare the required tables?

Thank in Advance

Mark Miller
Mark Miller
45,831 Points

I'm going with WordPress more than PHP. You can click on my face and see my points. I think PHP is out of date, and can be replaced with JavaScript and databases. You should complete the introductory courses on databases, and study JavaScript for interactivity. You may only need arrays for your app. But it becomes "maps" or JSON when the index is not a zero-based integer type. Study Java or JavaScript instead of PHP. I am concerned about the PHP. I think it should be more of a strongly-typed language with higher rules of syntax.

The WordPress Development course includes a PHP for WordPress course. Zac talks briefly about your question, and he says you can go onward with WordPress first, however, you will at some point need to consider going forward in PHP for it. So, I am following that advise, going to PHP only as needed. I am uncomfortable with PHP because it seems messy and unconventional. I recommend you shy away from PHP, unless it proves itself necessary. It is the same as ASP and JSP. I think the developers were not patient enough there. Go with a more strongly-typed language and invest.

3 Answers

Codin - Codesmite
Codin - Codesmite
8,600 Points

If you want to fully understand how wordpress works and have full control without being limited by your understanding of PHP, I would reccomend learning PHP.

Wordpress is built with PHP so a fundamental understanding of PHP is never not a benifet when using it.

I have to strongly disagree with Mark Miller regarding PHP being "out of date".

Fullstack Javascript is a good alternative to PHP/Phython/Ruby etc BUT it has servere limitations on large scale websites, it is very heavy on databases on large scale websites and struggles to handle the same level of database requests as PHP/mySQL, PHP/Mongo or PHP/noSQL stack.

In the company I work at we have a website with an extreme level of user interaction and database queries, we have PHP developers and Node.JS full-stack Javascript developers working in unison, in most cases we have to convert the Javascript to C, because it uses far to many resources, unfortunately some of our applications require Node.JS to function at the highest peformance they can, these are very select applications that peform better with javascript, but we only use it because of the high level requirements for that set application otherwise we wouldn't bother (We are talking hundreds of thousands of users to actually make a difference to the peformance for it to matter).

The bulk of our website is made in PHP with mongoDB and mySQL databases.

There is a very good reason why most large websites use PHP/mySQL and that is database query peformance.

Some top 10 websites that rely on PHP:

Facebook, Wikipedia, Flickr, Yahoo!, iStockPhoto, Tumblr, Wordpress, Mailchimp and many more.

Facebook is in the same situation as our company where they are using multiple different back-end programming languages to get the best peformance, but the majority of the website is built in PHP (or atleast their own hacked rendition of PHP).

One of PHP's downfalls is that it is not a very strict language like Python or Ruby and can be written very badly causing very insecure websites but this isn't soley an issue with the language itself, this is more a developer issue not understandnig what they are doing, it is very easy to avoid these pitfalls with very minor education in PHP. (These are pitfalls you will learn very early on in the PHP tracks here on Teamtreehouse).

This is not due to the developers of PHP being inpatient or messy as Mark has stated, this is due to PHP being a very old language that has gone through many version changes, unfortunately to remain backward compatible it has been unable to remove some older functions that are less secure in older versions. But there has been great improvement in recent versions such as PHP5 and PHP7 to steer developers away from these outdated functions that still remain in the language. PHP is fully OOP (Object Orientated) and works well with all database types.

Over 82% of all websites on the web are developed with PHP. While less then 0.2% are developed with a Javascript back-end.

I think you will find that if you learn PHP you may find yourself not needing premade CMS such as Wordpress because your web development skills and knowledge will be far superior to what you are limited with in Wordpress.

Wordpress isn't really designed for back-end developers it is designed for clients and Webdesigners/Graphic Designers with less programming knowledge to be able to easily manage heavy PHP backend websites without prior knowledge to PHP.

Most developers will only use Wordpress if they are planning on selling the website to a client that needs to manage the website themselves with limited PHP or Web Development knowledge.

The funny thing is, when you get good enough with PHP you find you can easily replicate your own CMS similiar to wordpress but less bloated and more bespoke/relevant to your client.

Now don't get me wrong I am not anti fullstack javacript and I believe the inititiave to use one language across backend and frontend is a good idea (and it is something I have taken the time to learn myself ontop of PHP and Python), but as of the moment I do not believe it peforms as well as it could, and is very situtational.

I believe if you are looking to develop for Wordpress it would not aid you, unlike PHP which Wordpress is built with.

Thanks for both your replies, they really shed some light on what to choose going forward (which, I realised, is a very important step on this medium).

I will go ahead with the php track as Ashley recommended, because it is true that I chose wordpress as the cms to focus on, and learning php seems like the reasonable thing to do.

Eventually I will dive into full stack js, as Mark Miller said, and make the decision based on experience. But for now I need a path to focus on.

Thanks again for your help, Daniel Coelho

Codin - Codesmite
Codin - Codesmite
8,600 Points

I think that is good well thought out choice, and it cant hurt to learn a bit of everything in the long run, I do believe full stack javascript has a huge future in the industry and is already breaking many waves and progressing foward fast as is many other programming languages.

But PHP is definately a wise choice if your end goal is to use Wordpress.

Mark Miller
Mark Miller
45,831 Points

I was only offering what I think. I still feel that the unconventional syntax of PHP may cause bad habits and impatience in programmers. I think the reason why its used in such a high percentage of internet sites is that it offers a handy quick fix without the programmer thinking ahead, plus it offers the functions on the codex website that are all ready to use.

But I remain unwilling to really go there now, because wherever there is backend work called for, I plan to go big with the strong type safety of Java, Ruby, or C# and the common language runtime (.NET framework) in a campaign style of coding. Meanwhile, I'm going with only frontend development for now, while I can see how to communicate with databases without PHP. I've never seen how PHP offers anything that I could ever need. I mean, hosting and data management on the backend is such a big and high-performance arena.

I think they only use PHP for the quick fix this moment, while the real sustainable solution is being architected in strongly typed languages in teams with better vocabulary. The minimum viable product should be found first before production. And you should usually be forced to declare your data types at declaration time, I dare say. I think teamwork and communication is better with strong languages. But I admit, I'm just a beginner, so my advice is not as important as Ashley's for now.

Mark Miller
Mark Miller
45,831 Points

https://en.wikipedia.org/wiki/Common_Language_Runtime

Here, I should have capitalized the Common Language Runtime in my previous message. You should enjoy the learning of all ways, or languages of coding, at your own pace, thanks to the great Treehouse. At the same time, I'm afraid this Microsoft translator is likely to be producing some powerful results for its own team development. I'm not going to ignore that.

https://en.wikipedia.org/wiki/Strong_and_weak_typing

More relevant at hand is the issue of explicit data type declaration and type safety. Read about that, because PHP does not require you to explicitly declare your types. So, the higher programmer is concerned about the computer misunderstanding his or her intentions without the explicit declaration.