Archive for the ‘PHP’ Category

Server-side vs. Client-side Programming Languages

Wednesday, May 31st, 2006

More and more web designers are interested in taking the jump into learning how to build database driven websites.

These days, the language of choice is PHP (with some adventurous nerds jumping into Ruby,) because it is easy to use, easy to learn and is very popular.

Regardless of what technology/programming language (PHP, ASP, JSP, Cold Fusion) you use to build database driven websites, there are some (common) basic concepts that have to be understood before you can move forward.

In the following video tutorial, I explain to the difference between server-side programming (PHP, ASP etc ..) vs. client-side programming – JavaScript, VB Script etc …

Video: Server-side programming vs. Client-side programming

PS: after you watch this video, you may want to take it to the next level and actually learn PHP.

Stefan Mischook

PHP vs. Ruby

Tuesday, May 9th, 2006

With all the buzz about Ruby these days (because of the web application framework ‘Ruby on Rails’) Zend (the people who manage PHP) are feeling the pressure.

Nerd Note: a ‘web application framework’ makes creating databased driven websites much easier because the framework takes care of a lot of the ‘dirty’ work that you would normally have to build yourself.

As far as Zend is concerned, PHP is not getting its’ fair share of attention even though PHP is:

  • Much more available than Ruby – in terms of hosting.
  • PHP is a widely used and a proven language with big sites like Yahoo, Digg and Flickr using it.
  • PHP is easy to use and easy to learn.

As I mentioned above, Ruby’s recent rise has been largely due to the web application framework ‘Ruby on Rails’. So in response to this, Zend has developed their own framework called: Zend Framework.

Along with the Zend Framework, comes a nifty new web site. From the press release:

Future of Web Application Design Is Here and Looking Good

Varien, a web design and development firm, has redesigned the Web site for Zend Technologies’ PHP framework. Varien completed the redesign as part of an effort to reposition PHP as the cleanest and most simple programming language.

Los Angeles, CA—April 20, 2006—Varien has completed redesigning the Zend Technologies’ new PHP Framework Web site in an effort to make the Framework more accessible. The Framework is a powerful new tool for Web developers, providing a simple, standardized way to create powerful web applications using PHP.

The redesign was part of a broader effort to reposition PHP, which included designing a new logo for the Framework. By repositioning PHP Zend hopes to make the Framework and PHP more appealing to current Web developers and less intimidating to those looking to get into Web development.

“Here you have PHP, a programming language that runs Flickr, Wikipedia, Digg, and even Yahoo, and yet Ruby has become synonymous with the new Web,” said Ben Blumenfeld, the Design Director at Varien. “Hopefully this redesign makes Web designers and entrepreneurs take another look at PHP. With Zend’s Framework, PHP is now simpler, faster and more powerful than it has ever been.”

PHP usage has grown tremendously since PHP4 was released in 2000. However, PHP has recently lost some of its mindshare to the heavily touted Ruby on Rails, despite a huge gap in actual usage. (TIOBE programming community index)

The Zend Framework aims to provide a high-quality, commercial-friendly and open-source based solution for programming in PHP. Zend is excited about the Framework’s usability and knows the site redesign will help developers get the most out of the new technology.

“The coolness fact is also important in initially attracting Web developers and is complementary to the technology. The new look of our Web site enables us to build a more appealing perception of the Zend Framework,” said Andi Gutmans, the vice president of technology at Zend.

The Framework can be found at framework.zend.com. The redesign allows users to download the framework from the front page and highlights projects created using PHP in a section on the front page.

-

WILL RUBY CONTINUE TO EAT AWAY AT PHP’S MIND SHARE?

This is the $64 000 question. But we have to consider one point: Ruby has capability that is widely used in Rails that PHP simply does not have; so can a PHP framework be as effective as Rails?

Nerd-minds want to know!

Stefan Mischook

Java’s dirty little secret: Java web hosting is fragile.

Wednesday, April 5th, 2006

PHP vs Java - is Java really more stable?

When people think of Java, they think of some mighty indestructible language/environment that never goes down – well at least less than other platforms like PHP or .NET.

REALITY CHECK

After running my own servers for 6 years (IIS with Resin) with few troubles, I moved hosting to outside sources. I had to go through several hosting companies before I found one that could even run my simple POJO based applications!

Now after a year has passed, my experience with shared Java hosting can be summarized:

  • Tomcat seems to go down at least once every 7-14 days.
  • Contrast this to PHP – never goes down.

FINAL COMMENTS

The Java community tends to dismiss PHP as some scrappy scripting language that can’t be counted on … I must confess, I used to think that too.

Now after a year of using both Java based and PHP based applications, I have personally found PHP to be much more stable and reliable. I am actually nervous that my Java applications (and Tomcat) will fail regularly and am moving to migrate everything to PHP.

I have no axe to grind, just speaking the truth based on my experience.

Stefan Mischook (The Web Design Heretic)

Book Review: PHP Hacks

Wednesday, April 5th, 2006

PHP Hacks is essentially a collection of ‘bite-size’ PHP scripts that you can easily drop into your websites.

Besides being able to use the hacks straight away in your projects, the PHP code/hacks are clearly explained making them good tutorials for learning how you might do something in PHP.

SOME TOPICS/HACKS THAT STAND OUT:

  • Creating a shopping cart.
  • Using AJAX with JSON – a php library that makes working with AJAX easy.
  • PEAR hacks like Net-Geo to find out state and city locations of people.
  • A good examination of PHP design patterns.

Not exactly for beginners, but if you have an understanding of basic PHP you will be OK and you will learn a lot. This book is also good for programmers (from other languages) who want to get a good idea of what tools, libraries are available in the PHP world.

Another good book from O’reilly.

Why the Java community dismisses PHP.

Monday, December 19th, 2005

More and more there are grumblings in the Java community – the language is showing its age and Java nerds are starting to look elsewhere … slowly.

In their search though, I have found that Java nerds tend to ignore or dismiss PHP … instead they look to Python and marginal languages like Ruby as the potential alternative.

WHAT’S THE DEAL?

I have to ask myself, why are Java nerds ignoring one of the most popular languages in the world? Why are they ignoring a technology endorsed by IBM, Oracle and used by Yahoo?

I think much of it comes down to Java elitism and false perceptions about PHP, it comes down to these points:

  • PHP is a scripting language that is easy to learn – Java elitism has a natural dislike for anything easy.
  • PHP has a procedural history that makes Java users snicker – despite PHP5’s full blown OO feature set.
  • PHP syntax can be a little inconsistent at times – this is true.

On the flip side, Java users seem to ignore some very important facts about PHP:

  • PHP is ubiquitous. It’s hard to NOT find a host that supports PHP.
  • PHP is fast and scalable – Yahoo proves that.
  • PHP easy learn, easy to write and is fairly concise.
  • PHP has a huge community where there are plenty of open source tools available.
  • PHP can be maintainable: there are database abstraction frameworks (PEAR DB), there are templating frameworks, MVC and other frameworks so that you can build maintainable scalable applications in PHP.

One argument you hear from the Java camp is that PHP is a web application only language … pratically speaking. This is indeed the case but what about Java? Most Java projects are web applications, Java on the desktop is but a small fraction of the Java work being done.

Ok, you have cell phone and other small device work, but the fact of that matter is that most Java projects are web applications.

Beyond Java

Bruce Tate wrote an excellent book (‘Beyond Java’) criticising Java and speculating on what the next big language will be. Not surprisingly, he spent little time on PHP.

Not to take anything away from the book, it’s really good. Nonetheless, from the perspective of someone who wants to make a living, it only makes sense to strongly consider a language that is so well established and easy to work with.

WHAT AM I DOING?

I think for the time being, when it comes to small and medium sized web applications, PHP can’t be beat. I have hung up my Java-shoes and now look to PHP for any new projects.

Stefan Mischook

The future of programming.

Wednesday, November 16th, 2005

For the last several years, when asked about what programming language that I thought people should jump into, I would automatically make Java my first choice – things are changing now.

There is growing appreciation for flexible dynamic scripting languages (like PHP, Python) over strongly-typed compiled languages like Java.

Why?

I see two big reasons why people are looking to the scripting languages as a viable alternative to Java:

  1. Speed of development.
  2. Ease of use.

There is no argument (among sane people,) that you can build applications in a scripting language in a fraction of the time that it takes to build the same application in Java.

The Java zealots would argue:

  1. Scripting code will not be maintainable.
  2. Scripting code will run too slow

About code maintainability:

The reality is that code maintainability has as much to-do with the programmer as it does with the language – you can write crappy Java that is not easy to maintain or extend … I’ve seen it more than once – maybe even 3 times!

:)

The same thing can be said of scripting languages …

Another interesting point, is that you can usually write an application with far less code than you would in Java – many times we are talking 1/4 to 1/5 the code! A thousand lines of code is much easier to maintain than 5000!

About speed of code execution:

Again, many times that comes down to the programmers skill. Having said that, the evidence shows that for many applications, the scripting languages out there run more than fast enough.

Anecdote: PHP seems to be fast enough for Yahoo.

The old argument that Java people used when defending Java’s speed (relative to C++ ) can be applied to scripting languages: computers are really fast these days … as such the difference in execution speed (most of the time) is negligible.

Java’s ever increasing complexity- benefits the few at the expense of the many:

It seems to me that the Java community has made the platform more and more complex (in favor of huge projects,) at the expense of productivity of small to medium sized projects. The problem is, that the vast majority of the projects out there are small and medium sized.

Conclusion

I’ve written most of my software in Java over the last several years, I like Java. But these days I don’t look to Java anymore because it just takes too much time to get anything done. Even small Java applications have a lot of overhead in just setting up – xml descriptors, frameworks etc. I’m not even going to get into the verbosity of the code itself …

These days I look to PHP to write my web apps – it’s just too easy and fast to ignore. PHP has got some baggage from its’ roots of being a ‘web designers language’ but it is fast, has support from big players like IBM and most important , it’s everywhere!

What about Ruby?

Looks very cool, but it is a marginal language – nobody uses it these days. Last I checked, in comes in as the 28th most used language – below COBOL, Python, VB … you get the idea.

Site Map  |  Top of page  go to top of page