Why did you make a poll? This is talk
php.com, does it surprise you that everybody will vote for PHP?
Quote:
|
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.
Quote:
|
Another question, what is this obsession with OOP?
|
Because it's the only way to write maintainable code in large projects.
Quote:
|
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.
Alan Turing 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
code maintainability. 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
model 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.