Monday, May 26, 2014

Day 11: Beginning of PHP

Woke up this morning and opened up my email to be notified that I passed my yellow belt exam! When I arrived to class today I received one of these cool stickers to show my accomplishment.


 I just now need to get green, red, and the difficult-to-obtain black belt that only about 15% of students get within the 12-week timeframe.

So after focusing primarily on front-end development with HTML, CSS, and jQuery, it was time for us to learn our first back-end language, PHP. This language has honestly gotten a bad reputation (I don't know exactly why) but all I know is that a lot of people know how to use it and since there are more programmers that are proficient in PHP, the pay is much less than what you'd expect from a developer. Furthermore I heard there are some weird quirks about it but nevertheless it remains a very popular tool.


After watching a bunch of videos talking about PHP and how to use it we first started off with a series of algorithm challenges to make sure that we know what we're doing before moving onto the assignments. The most annoying thing about PHP really is syntax. It's so funky and unique from the others. I've had programming experience primarily in Java, Javascript, and Ruby. PHP is quite different. But I must say, the way you use PHP is mighty impressive.


Here I am embedding PHP directly into the HTML and generating content by extracting data from an array and "echo"ing HTML blocks. This method may look a little ugly but it seriously reduces your code significantly.


Not only can you use PHP to generate HTML, you can pretty much generate anything. On the picture above I'm using PHP inside a CSS stylesheet and allowing the color attribute of the h1 and p tags to be randomly chosen using the rand() function.

We've only started PHP today so there really isn't much to report. It was honestly a pretty exhausting day of learning an entire new language and syntax. A lot of my classmates were also having some brain overload of knowledge. But we all know that we just gotta keep pressing forward.

For the rest of the night I'll be working on the next assignments which are a bunch of sorting algorithms like Radix sort, Selection sort, etc. Coding Dojo wants us to write them in 3 languages: PHP, Ruby, and javascript. Fun stuff!

No comments:

Post a Comment