[PHP] Doubt on why some syntaxis is not used for PHP
I'm gonna guess that there might be some syntaxis problems or something, since I would guess the following make sense to the PHP language. Arrays: Since the + operator already gives the union of two arrays, why isn't the - operator for differences and | for intersections? I would find those to be rather natural and actually easy to implement. Classes: I was also wondering why the static methods of a class use the :: syntaxis. After all, I don't see what's the problem with also using -> for static calls. Just by adding MyClass->staticMethod(), the whole problem of namespaces and :: as separator would seem to be made a bit easier. Just some questions =) I'm not here to say that things are wrong, just wondering why they weren't thought to be the other way. Again, there might be some syntaxis problem with the parser that I haven't thought so far. Regards, Mamsaac
[PHP] I've some doubts if I should go with 5.2 or go already with 5.3 (for a course)
I'm giving a PHP course next semester (3 hours all saturdays for 22 weeks) and I just realized that PHP 5.3 is coming very soon (2 days now!). So, my plans of teaching PHP 5.2 are starting to change, and I think it's a good idea to teach them 5.3 already. While the majority of the students use Windows, I'm aware that a vast amount will be using Ubuntu/Debian (and some use Gentoo, Fedora and Arch) distributions of Linux, so I'm hoping there won't be too many problems on installation. I don't want to waste the entire first class fixing installation problems, because that kills the student's motivation. The course starts on August, but I'm preparing it during the last two weeks of July. You think that installation packages will be bulletproof by then? Or should I just teach 5.2 and wait for another semester before starting on 5.3? I mean, most hosts will remain with PHP 5.2 for the rest of the year, so I'm a bit confused on what I should do. I'm just a university student that wants to spread PHP, for I've been using it for many years now =) Thanks for the advices, Mamsaac
Re: [PHP] I've some doubts if I should go with 5.2 or go already with 5.3 (for a course)
The thing is, that part of the planned course was to develop a small framework, so that they could see the dynamic and OOP posibilities that PHP offers. With PHP 5.3, there are namespaces, which change a lot the design of a framework, as well as true lambdas with closures. So, naturally, the architecture of this minimalistic framework changes and I have plans to write it before the course starts. Why a framework? If you know how an MVC framework is created and how it works, you will most likely get into Zend Framework or CakePHP much faster. Plus, it's a very good way to learn the language. It wouldn't be the first one I've written, so it's not much trouble. That's why I care about PHP 5.3. Now imagine if there were Traits! Anyway, I think I will do as someone mentioned, and teach them 5.2 during the entire course and then at the end show them some of 5.3. -- Forwarded message -- From: Per Jessen To: php-general@lists.php.net Date: Tue, 23 Jun 2009 10:12:55 +0200 Subject: Re: [PHP] I've some doubts if I should go with 5.2 or go already with 5.3 (for a course) Manuel Aude wrote: > I'm giving a PHP course next semester (3 hours all saturdays for 22 > weeks) and I just realized that PHP 5.3 is coming very soon (2 days > now!). So, my plans of teaching PHP 5.2 are starting to change, and I > think it's a good idea to teach them 5.3 already. Does it _really_ matter which one? I can't imagine there are that many revolutionary changes in a dot-release.
Re: [PHP] I've some doubts if I should go with 5.2 or go already with 5.3 (for a course)
Let's put it this way: MVC frameworks with namespaces are going to change a lot. The architecture can be made much cleaner and class names won't have to be so long (Zend_Db_Adapter_Db2_Exception), for instance. The design part of coding is __VERY__ important, and this changes are specially for that. See PHAR extension, which will be enabled now, which allows for easier distribution of software. And closures, which simply have so many uses in design and save you from clustering your code with too many function names. Sure, it doesn't change the language, and it doesn't really break apps that were written in PHP 5.2, but if you're going to design an application, thinking about this options is very useful. Too bad we don't get Traits yet =( Horizontal re-use is very nice. > Robert Cummings wrote: > > > Per Jessen wrote: > >> Manuel Aude wrote: > >> > >>> I'm giving a PHP course next semester (3 hours all saturdays for 22 > >>> weeks) and I just realized that PHP 5.3 is coming very soon (2 days > >>> now!). So, my plans of teaching PHP 5.2 are starting to change, and > >>> I think it's a good idea to teach them 5.3 already. > >> > >> Does it _really_ matter which one? I can't imagine there are that > >> many revolutionary changes in a dot-release. > > > > Given the naming of PHP versions of PHP-x.y.z, I would agree that not > > much changes between versions at the .z level. But at the .y level > > there are usually significant changes. > > > > Coming to a PHP 5.3 near you are the following notable features: > > > > - namespaces > > - closures > > - late static binding > > - garbage collector to handle cyclic references > > - PHAR > > - goto > > I hadn't actually seen/studied the list, but apart from the goto, I > don't consider any of those revolutionary :-) > > > /Per >