[ciapug] Web Professionalism

Carl Olsen carl-olsen at mchsi.com
Wed Nov 30 19:34:56 CST 2005


I'm very familiar with this from using C#.  If you have two subclasses with
the same name, you get an error if you don't prefix them with enough of the
parent classes to make it clear which class you are actually trying to use.
Most of the time, you just import at the top of the page and use the
subclasses wherever you need them in a file.

Carl

-----Original Message-----
From: ciapug-bounces at cialug.org [mailto:ciapug-bounces at cialug.org] On Behalf
Of Tony Bibbs
Sent: Wednesday, November 30, 2005 9:42 AM
To: carl-olsen at mchsi.com
Cc: ciapug at cialug.org
Subject: Re: [ciapug] Web Professionalism

To be clear the agrument on syntax I was eluding to was for the import.

Thus

import net.geeklog.mvcnphp.views;

versus

import net:::geeklog:::mvcnphp:::views;

You would do the import only once at the top of the file where you need 
the package and then start using the classes you've imported.  Imports 
are similar to include's except you are able to import an entire library 
in one call versus a single file.  Also, using this sort of a thing 
you'll be able to make use of, say, a class called User that is used in 
two different classes without getting a ton of errors.

-Tony

Carl Olsen wrote:
> I've only looked at PEAR briefly.
> 
> I see what you mean about the search and replace, so that makes me feel
> better about it.
> 
> Right now, I have to type a "-" and a ">" to do a method call or fetch a
> property.  I'd much rather type a "." since that's a key I'm much more
> familiar with.  I can usually hit the "." key without looking at the
> keyboard.  "Three colons" doesn't sound like much fun to me.
> 
> Carl
> 
> -----Original Message-----
> From: Tony Bibbs [mailto:tony at tonybibbs.com] 
> Sent: Tuesday, November 29, 2005 8:56 AM
> To: carl-olsen at mchsi.com; ciapug at cialug.org
> Subject: Re: [ciapug] Web Professionalism
> 
> 
> 
> Carl Olsen wrote:
> 
>>I'm hoping they get that fixed before too much code gets written that way.
> 
> 
> Have you seen PEAR?  That's all they use (for better or worse).  The PHP 
> DEV's seem to not look at namespaces as a big issue.  In fact, I believe 
> the phrase that rings in my head is "syntactic sugar".
> 
> Anyway, the good thing about doing it this way is when/if namespace 
> support is implemented, you will only have to do search/replace.
> 
> FWIW, there's been a lot of recent discussion about this on php-dev. 
> Sounds like they maybe getting more serious about it because they are 
> arguing about what to use as the separator (e.g. '.' versus ':::', etc).
> 
> --Tony
> 
_______________________________________________
ciapug mailing list
ciapug at cialug.org
http://cialug.org/mailman/listinfo/ciapug



More information about the ciapug mailing list