Archive for the 'Geeks On PHP' Category

Hey all, I know the release schedule for the Geeks on PHP podcast has been erratic and unpredictable lately. We are currently in the process of revamping the format of the show including me taking over as host and the possibility of adding someone else as co-host. Stephen’s responsibilities with the New Brew Thursday podcast have increased exponentially which is the underlying reason behind the changes going on with Geeks on PHP.
I have a couple people in mind for co-hosts but would love to get feedback from our readers/listeners about what you would like to get out of the show. If any of you are interested in doing a guest spot please get in touch with me either by Email or on Twitter.
I will keep everybody updated as things progress but for now I just wanted to make people aware of what is going on and also that the show is not dead.
Thanks for listening and please don’t hesitate to comment, email or otherwise — your involvement is highly encouraged!
Sincerely,
This week we dive into the debate that has raged since the first database went online, MySQL or PostgreSQL ..

Stephen is a MySQL guy, while Nick is a PostgreSQL guy, and together they share the pros and cons of both, and why the debate that has raged is not likely valid anymore.
Also, subscribe to us on iTunes and leave us your comments: [ Launch iTunes ]
Follow us on Twitter :
Stephen : http://www.twitter.com/darthweef
Nick : http://www.twitter.com/niczak
At the heart of every redundant thing you do, is a loop.
Even the greeks knew it. When Sisyphus pissed off the gods, they stuck him in a while loop
while($gods == “pissed”) {
$sisyphus = “Roll rock up a hill”;
}
Granted the greek gods were a bit tempermental, but like the greeks, your application will execute these types of statements to output data, count, and do all sorts of things that are even, at times, incredibly futile and redundant. Also like gods, while loops can be tempermental, and when hastily constructed can leave Sisyphus pushing his rock for all of eternity.

Wondering who Sisyphus is ? http://en.wikipedia.org/wiki/Sisyphus
PHP Manual on Control Structures: http://us2.php.net/manual/en/language.control-structures.php
Also, subscribe to us on iTunes and leave us your comments: [ Launch iTunes ]
Follow us on Twitter :
Stephen : http://www.twitter.com/darthweef
Nick : http://www.twitter.com/niczak
At the heart of everything you do, all day long every day, is an if/then conditional.
When you decide to leave the house, this is what your brain does :
If ( $raining == “Yes” ) {
$take_an_umbrella = “Yes”;
} else {
$take_an_umbrella = “No”;
}
Granted the brain is far more complicated, but like the brain, your application will execute these types of statements to process inputs, decide on which functions to execute, and overall allow more then one scenario to occur with your application. Also like your brain, you if/then statements and other conditions will also get more and more complicated, but today we deal with the basics.

If/else VS Switch:
The switch statement is similar to a series of IF statements on the same expression. In many occasions, you may want to compare the same variable (or expression) with many different values, and execute a different piece of code depending on which value it equals to. This is exactly what the switch statement is for.
if($test == “foo”)
// do stuff
else if($test == “bar”)
// do other stuff
else if($test == “foo bar”)
// do other other stuff
else
// do something totally different
switch($test)
{
case “foo”:
// do stuff
break;
case “bar”:
// do other stuff
break;
case “foo bar”:
// do other other stuff
break;
default:
// do something totally different
break;
}
Visit the PHP Manual on operators.
Be sure to subscribe via iTunes and leave us your feedback there as well, we’d love to hear from you! Click here to subscribe!
Enjoy :
This week we dive into Frameworks, and suggest some good coding tools such as TextWrangler, and BBEdit. We also talk a little about SVN repositories and why you should use them.
We want to hear from you … so contact us :
Twitter:
Nicholas Kreidberg : http://www.twitter.com/niczak
Stephen Johnson : http://www.twitter.com/darthweef
Rate and Review us on iTunes!

Here are the notes, which are basically just links to download the stuff we talked about.
Links to popular Mac Editors:
TextMate: http://macromates.com/
TextWrangler: http://www.barebones.com/products/TextWrangler/
Coda: http://www.panic.com/coda/
Links to popular Win Editors:
NotePad+: http://notepad-plus.sourceforge.net/uk/site.htm
PsPad: http://www.pspad.com/
ConText: http://www.contexteditor.org/
Links to popular *nix Editors:
Eclipse: http://www.eclipse.org/
Vim: http://www.vim.org/
gEdit: http://projects.gnome.org/gedit/
Subversion complete reference guide:
http://svnbook.red-bean.com/ (Entire book online)
Frameworks:
CakePHP: http://cakephp.org/
CodeIgniter: http://codeigniter.com/
Zend: http://framework.zend.com/
Thanks for listening, and Stay Geeky.
This week we delve into best practices for beginners , should you psuedo code, how much time to spend on design, etc …

We talk alot from this great list of 30 Best Practices for Beginning PHP Developers:
http://net.tutsplus.com/tutorials/php/30-php-best-practices-for-beginners/
Definitely check that out, as well as Paper Prototyping by Carolyn Snyder – http://www.paperprototyping.com/
Subscribe to us on iTunes & let us know how we are doing by rating and leaving a comment. :
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336
You can also follow us both on Twitter :
Stephen : http://www.twitter.com/darthweef
Nicholas : http://www.twitter.com/niczak
This episode we delve into data types and arrays! We discuss the life & death need to document your code, and bemoan our own experiences working with bad code.
We include a few “best practice” discussion topics in this weeks episode as well, but you can look forward to an even more in-depth discussion on best practices both before, and during your development cycle.

For our discussion on data types we talk about casting and converting data types, so here is a little code that you can check out to see how you would accomplish both tasks.
data type casting :
http://www.fortheloveofgeeks.com/downloads/data_cast.txt
data type converting :
http://www.fortheloveofgeeks.com/downloads/data_types_convert.txt
During our array discussion Nick mentioned this code for the show notes found here :
http://www.fortheloveofgeeks.com/downloads/array.txt
Subscribe to us on iTunes & let us know how we are doing by rating and leaving a comment. :
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336
You can also follow us both on Twitter :
Stephen : http://www.twitter.com/darthweef
Nicholas : http://www.twitter.com/niczak
Enjoy the show !
On this weeks episode Stephen and Nicholas talk a little Comic Con, and do a versus run on PHP topics.
Also, Stephen’s dogs insist on joining the show, but they don’t add anything of value to the topics.
For our comic con discussion, if you want to see Stephen’s Flickr stream of photos go here : [ ComiCon Flickr ]
We start the PHP portion of our show with Static Vs. Dynamic and then Server Dynamic vs. Client Dynamic, with some caveats on Client Side scripting.
We also toss a little discussion of Form Validation and Form Sanitation, and Nick gives us some code to use for quick and easy Sanitation of form data. You can get that here : [ Code Snippet ]
We also hit on the overall capabilities and advantages of PHP and do a quick and dirty rundown of PHP vs. ASP.
If you want to set up your own LAMP (Linux, Apache, MySQL, PHP) server check out this great walk-through : [ How-To ]
Enjoy the show, and tell us how we’re doing in the comments.
Also, visit us on iTunes and subscribe here : [ Launch iTunes ]
Enjoy the show!

In this weeks episode, Stephen and Nicholas introduce themselves, their history with PHP, and the exciting future for this podcast.

We love validation … and will take criticism. So let us know what you think in the comments.