LPH
Well-known member
As you probably know, I'm just learning PHP. So bare with me. My evenings are filled with watching video tutorials from Lynda, reading books, websites, and code snippets from others, as well as trying out samples on a local install.
Today, I was proud to install my first PHP framework. CodeIgniter was chosen because it was free and the first one to look like it had good docs.
Once CI was installed then I changed some configurations to work with WordPress as well as my PHP project. Next, multiple database configuration needs to be done.
For now, I was practicing PDO statements.
The first lines of code done in Coda 2 by hand were over 35 lines (the old mysql_connect methods) - with plenty of comments to make sure I'd remember later what was happening.
Today, that same code was put into CI and sits at 17 lines - mainly extra lines so I could read it. The actual code is only 5 statements.
Not bad for a novice.
What is your best code efficiency? When you look to make code more efficient, do you follow a plan of attack - look for obvious ways - or do you just read through until you see something that can be done better?
Today, I was proud to install my first PHP framework. CodeIgniter was chosen because it was free and the first one to look like it had good docs.
Once CI was installed then I changed some configurations to work with WordPress as well as my PHP project. Next, multiple database configuration needs to be done.
For now, I was practicing PDO statements.
The first lines of code done in Coda 2 by hand were over 35 lines (the old mysql_connect methods) - with plenty of comments to make sure I'd remember later what was happening.
Today, that same code was put into CI and sits at 17 lines - mainly extra lines so I could read it. The actual code is only 5 statements.
Not bad for a novice.
What is your best code efficiency? When you look to make code more efficient, do you follow a plan of attack - look for obvious ways - or do you just read through until you see something that can be done better?