Your SlideShare is downloading. ×
PHP Hacking: The battle between great ideas and not-so-great code
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

PHP Hacking: The battle between great ideas and not-so-great code


Published on

A talk I gave to the Milwaukee PHP User Group in January 2011.

A talk I gave to the Milwaukee PHP User Group in January 2011.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide
  • \n
  • Are there any developers here tonight?\nAny programmers here?\n
  • \n
  • Any Hackers?\n
  • That describes me...\n
  • That doesn’t describes me... in fact, I think that’s a “cracker”\n
  • Here’s a few definitions of Hacker I can identify with...\n
  • I’m actually a Perl Hacker... I started using BASIC around 1980, and was out of programming until about 1993. I tried to learn Perl by reading about it but it didn’t stick. (And this was MacPerl at the time!) I was using UserTalk Frontier at the time, which had this weird internal scripting language, and I did a lot of stuff in that. Eventually I started using Linux web servers and a guy I knew at work got me started in Perl. When I found my code was running about 20 times faster, I started using Perl.\n
  • I never really got into Java... I never really liked Sun too much, and I couldn’t get into Java. Even though the open source text editor I’ve used for the last 6 years has been written in Java. I did write some BeanShell scripts. Nowadays I’m working with the Arduino and Processing, which is as close to Java as I get.\n
  • This is your typical Java developer. An attractive looking woman with a nondescript laptop who lays on the floor with no shoes on. She’s having so much damn fun, I really want to get into Java. I actually do know an attractive woman who is reading a Java book, and when I asked why, she said to learn how to build web sites. I sort of shook my head... Rogers Cadenhead wrote it.\n
  • Dot Net. Dear God.... As someone who has always hated Microsoft, and probably always will, I’m not about to touch Dot Net. I got burned by ASP and other Microsoft technologies, and I avoid Mono like, well Mono, and I’m not doing Dot Net.\n
  • This is your typical Dot Net developer.\n
  • Rails. I should probably say “Ruby on Rails” but 90% of the time I hear the word “Ruby” it’s followed by “on Rails” anyway. Rails or Ruby, or whatever, is something I should really look into, but I haven’t. I will someday... unless I don’t. I worked with a developer once who decided he’d learn Rails by writing a client application in Rails. He ended up scrapping the whole thing and re-writing it in PHP over a weekend. \n
  • OK, seriously... if this didn’t have the names on the photo, I would have thought this was a fashion shoot for American Apparel or something. Maybe the Gap? I don’t know... Really? These guys are behind Rails? They look like male models... Did they coordinate their wardrobes? Are you allowed to be a Rails dude if you’re not good looking?\n
  • This was my first introduction to PHP... I knew a lot of Perl hackers who started building web sites with PHP. We did a lot of complaining about how PHP did something wrong, or was missing something we used in Perl... But you know what? PHP is OK... it’s gotten much better over the years. Remember PHP3? Don’t get me started... Hey, at least it isn’t ColdFusion! Actually, speaking of ColdFusion, the biggest mistake I ever made at one of my old jobs was going along with the boss’s decision to use ColdFusion instead of PHP because “it was already installed.” I tried numerous times to get the application re-written in PHP, but it never happened.\n
  • It’s a bit of Culture Shock really... After years of using a language, you get used to it, and know how it works, and not just the “language” but the people who use it, and develop it, and how it gets used, and the community, and all the surrounding bits that have nothing to do with code... That was my struggle with PHP. Culture is what the real difference is between Drupal and Joomla, or Apple and Microsoft, or the U.S. and Canada.\n
  • Back when your RSS Aggregator was made by friends of yours instead of big corporations, a guy named Steve Minutillo released Feed on Feeds. I installed it on my own server and hacked the crap out of it. I added all these features I wanted to see in an aggregator. This is probably when I realized how awesome PHP was.\n
  • I wrote this for the company I worked for at the time... I based it on Feed on Feeds to some degree. That was the application that I learned how to write PHP applications from. Chances are I did it all wrong, and continue to do it all wrong... but I don’t sort of don’t care.\n
  • Back in 2004 or 2005 or something like that, used to have downtime (this is before Yahoo! acquired it) so I wrote some code to synchronize data between and any other service using the API... People actually used it!\n
  • This past summer I had to build a store locator for a web site... Google had sample code that did most of the work, and I added a bunch of site-specific features. It’s pretty unremarkable, but I’m glad the sample was written in PHP.\n
  • This started out as a simple project to play with HTML5, CSS3, and the <audio> tag. I ended up writing it in PHP because I figured learning a new language on top of all that was too much. I think I finished it around 4AM one night. It works. I also ended up putting a bunch of easter eggs into it later just for Tom Henrich. \n
  • This is similar to the delisync thing. It uses the API to pull all of my data out, store it in MySQL, and then display it on my own site. It’s a complete mirror of my data running on my own server. I also ended up putting this on GitHub thanks to Matt Gauger. Now I’m waiting patiently for someone to make it 100 times better so I can upgrade. If it doesn’t happen... oh well. I’m really a fan of PHP letting me experiment and exercise my ideas than anything else... Oddly enough a Perl guy said he wished it was written in Perl so he could hack at it. You just can’t win...\n
  • Hack... \n
  • Hack... \n
  • \n
  • Transcript

    • 1. PHP Hacking The battle between great ideas and not-so-great codePete Prodoehl
    • 2. PHP: Hypertext PreprocessorPHP: Hypertext Preprocessor
    • 3. Developer“Software development isthe act of working toproduce/create software.”
    • 4. Programmer“Computer programming isthe process of writing, testing,debugging/troubleshooting, andmaintaining the source code ofcomputer programs.”
    • 5. Hacker“Someone who plays golf poorly.” hmmm...
    • 6. Hacker“A programmer who breaks intocomputer systems in order to stealor change or destroy informationas a form of cyber-terrorism.” uhhh...
    • 7. Hacker1. A person who enjoys exploring the details of programmable systems and how tostretch their capabilities, as opposed to most users, who prefer to learn only theminimum necessary.2. One who programs enthusiastically (even obsessively) or who enjoys programmingrather than just theorizing about programming.3. A person capable of appreciating hack value.4. A person who is good at programming quickly.5. An expert at a particular program, or one who frequently does work using it or onit; as in ‘a UNIX hacker.’6. An expert or enthusiast of any kind. One might be an astronomy hacker, forexample.7. One who enjoys the intellectual challenge of creatively overcoming orcircumventing limitations. From “The Jargon File”
    • 8. PERL
    • 9. PHP“It’s like PERL, but for building web sites,and... not as good...”
    • 10. CultureKellan Elliott-McCrea“The hardest part in working withlanguages I’m less familiar with (python,and php for example) rather then thoseI’m more comfortable with (perl or java)is not syntax questions, its culture.”
    • 11. Feed on FeedsAn open source web-based aggregator.In 2004, I hacked theliving crap out of it...
    • 12. CategorizeA tool to categorize articles.In 2004, I wrote it formy employer...
    • 13. delisyncA tool to sync your data.Open APIs are a goodthing... exploit them!
    • 14. LocatorA store locator using Google Maps.90% example code10% my own code
    • 15. Evil-O-MatorJust another silly hack...90% silly10% PHP
    • 16. HeardA tool to mirror your data.Open APIs are (still) Hu b! G itgood... exploit them! on Now
    • 17. MAKE COOL SHIT!
    • 18. HACK!
    • 19. Thank YouFind me on the Internet! Blog: Email: Twitter: @raster