PHP compared to other languages...
View Single Post
01-18-2008, 01:41 PM
Join Date: Jan 2008
Why did you make a poll? This is talk
.com, does it surprise you that everybody will vote for PHP?
I have heard a lot of good things about Python (namspaces,OO, et al). As I am still young is it worthwhile to get acquainted with say, Python?
Yes it is. You should be acquainted with more than one language, or you will forever be a PHPer and will never be able be able to think outside the PHP mindset. I learned Ruby on Rails 2 years ago, and the RoR mindset of thinking has had effect on my PHP code as well - for the better.
That said, Python *is* a good language. The language fundamentals are much more solid than PHP's. PHP is more or less hacked together.
Another question, what is this obsession with OOP?
Because it's the only way to write maintainable code in large projects.
but, most of the classes that I had come across (at say phpclasses.org) could be implemented with just plain functions.
It's not about doing new things that you were not able to do before.
has proven that any turing-equivalent machine can emulate another. PHP, Ruby, Python or whatever, and even C and assembly, are all turing-complete languages. There's nothing that you cannot do in one that you can in another, as far as computational theory is concerned.
OOP is important because it increases
. Writing hundreds of functions is cute, and it works, but when you look at your code again after a year, you might ask yourself what function is supposed to do what, and how everything is supposed to fit together in the big picture. What if you need to extend your application beyond its original intended purpose? If it consists of a bunch of loose functions, you'll be in maintenance hell.
OOP allows you to
real-world entities in terms of classes. This allows your code to reflect the real world instead of exposing implementation details all over the place. It allows you to split your code into multiple smaller, simple subsystems, rather than lumping everything together in a big spaghetti boil. As someone who has programmed for almost 10 years, I'd have to say OOP is an invaluable tool for any serious developer.
The Following User Says Thank You to FooBarWidget For This Useful Post:
View Public Profile
Send a private message to FooBarWidget
Find More Posts by FooBarWidget