iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-25-2009, 07:45 AM
WebProWorld New Member
 
Join Date: Mar 2009
Posts: 13
arnoldsmithh RepRank 0
Default Is PHP a powerful tool?

PHP, one of the most powerful Server side web technology, is spreading in web development circle like a forest fire. You can find trillions of PHP webpages over the internet.
PHP evolves from C language, and provides the same functionality as the C.
The great advantage of PHP over other web development technologies is that it is easy to learn, easy to manage and provide rapid development.

please feel free to share your thoughts regarding PHP and other web technolgies you like.
Reply With Quote
  #2 (permalink)  
Old 03-25-2009, 09:33 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

That are facts that most of WPW's members already know.

That it is so easy to learn, also makes it vulnerable.

"The problem is that PHP is just too easy. It tempts you to try out your ideas, and flatters you with good results. You write much of your code straight into your Web pages, because PHP is designed to support that. You add the heavier code to functions in library files, and before you know it you have a working Web application.

You are well on your way to ruin. You don't realize this, of course, because your site looks fantastic. It performs well, your clients are happy, and your users are spending money."


Matt Zandstra (2004): "PHP 5, Objects, Patterns, and Practice". Apress ISBN 1-59059-380-4
Reply With Quote
  #3 (permalink)  
Old 03-25-2009, 01:33 PM
bobitza's Avatar
WebProWorld Veteran
 
Join Date: Jan 2004
Location: Canada
Posts: 300
bobitza RepRank 2bobitza RepRank 2
Default Re: Is PHP a powerful tool?

I believe that the "pure OOP" approach started in PHP 5 will fuel PHP growth as the preferred web programming language.
__________________
Open Web Directory
Reply With Quote
  #4 (permalink)  
Old 03-26-2009, 05:30 AM
Easywebdev's Avatar
WebProWorld Veteran
 
Join Date: Apr 2004
Posts: 310
Easywebdev RepRank 1
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by arnoldsmithh View Post
PHP, one of the most powerful Server side web technology, is spreading in web development circle like a forest fire. You can find trillions of PHP webpages over the internet.
PHP evolves from C language, and provides the same functionality as the C.
The great advantage of PHP over other web development technologies is that it is easy to learn, easy to manage and provide rapid development.

please feel free to share your thoughts regarding PHP and other web technolgies you like.


opensocialfactory.com
PHP did not evolve from the C language. C is a compiled language. Php is an interpreted language which is written in C, as is Perl, Ruby etc. Completely different thing.

PHP is easy to learn but the language itself is not a RAD tool. PHP frameworks like codeigniter, cakePHP, symfony, the zend framework etc all aid in Rapid Application Development.

Quote:
Originally Posted by bobitza
I believe that the "pure OOP" approach started in PHP 5 will fuel PHP growth as the preferred web programming language.
I have been developing with php for almost 8 years now and am almost ready to drop it and buy a few python books due to some of the idiotic changes coming in 5.3 regarding the implementation of namespaces.

The php group decided that the namespace seperator would be the backslash \ due to a collision with the intended seperator :: and static class function/constant scope.

A thoroughly ridiculous idea which has the php community up in arms. The other is something that may not yet come to pass but is scheduled is that when using any namespace then php functions/classes/constants must be prefixed with the namespace seperator to signify their global access (ie, $iterator = new \ArrayIterator; throw new \Exception etc.) Ridiculous.

I fear the PHP ship is heading for the rocks, whether they can turn it around or not I'm not sure. PHP 5.3 with these features just reached RC1 status and should be available soon.

I really hope that for php 6 they totally drop all backward compatibility and redo the language to be fully namespaced and consistent.

I would like to see namespaced functions such as String::cat, Array::Iterator etc that all take parameters in a consistant manner.

As things stand some functions take parameters in a needle/haystack manner whole others in the same category "think strings" take a haystack/needle set of parameters.

5.3 was supposed to be the version that brought php up to enterprise standard. I have read the php internals and the transcript of the IRC chat that led to the use of \ and am thoroughly disappointed in the direction things are going. I hope that with the current furore across programming forums/blogs that Rasmus Lerdorf steps in and says put namespaces back to 6.0 until they iron out the current problems with the namespace seperator and reserve namespace names such as PHP, String, Array etc for internal use.

Pushing this forward in 5.3 is a huge mistake that is sending excellent developers to other languages.
__________________
"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
"The secret to creativity is knowing how to hide your sources" - Albert Einstein.

Last edited by Easywebdev; 03-26-2009 at 06:07 AM.
Reply With Quote
  #5 (permalink)  
Old 03-26-2009, 07:16 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

The original poster may mean that PHP use C syntax like { } etc.

Regarding namespace syntax in PHP. Can you not make your own definition to go around the problem?

Personally I should like to see a thighter integration between PHP and C++. Embarcadero, the new owner of Delphi and C++Builder may do that since Delphi is very integrated with PHP as far as I can see.

My favourite combination in 2009:

JavaScript for client side scripting.

PHP for server side scripting.

C / C++ for compiled code.
Reply With Quote
  #6 (permalink)  
Old 03-26-2009, 11:44 AM
bobitza's Avatar
WebProWorld Veteran
 
Join Date: Jan 2004
Location: Canada
Posts: 300
bobitza RepRank 2bobitza RepRank 2
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by kgun View Post
You are well on your way to ruin. You don't realize this, of course, because your site looks fantastic. It performs well, your clients are happy, and your users are spending money.
kgun, I'm not sure I'm getting the right idea here. Care to elaborate on your quote?

Quote:
Originally Posted by Easywebdev View Post
... the idiotic changes coming in 5.3 regarding the implementation of namespaces. The php group decided that the namespace seperator would be the backslash \ due to a collision with the intended seperator :: and static class function/constant scope.
5.0 is as far as I went I "converted" from Java about 1 year ago (no C/C++ background whatsoever) and finding 5.0 and the OOP approach + web/mysql related methods really made me think the PHP can be THE future of web programming. I'm not familiar with namespaces, what exactly are they and where are they used? Are they the same thing as '->' for objects?
__________________
Open Web Directory
Reply With Quote
  #7 (permalink)  
Old 03-26-2009, 06:51 PM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by bobitza View Post
kgun, I'm not sure I'm getting the right idea here. Care to elaborate on your quote?
I think you shall not take the statement literally, but with a grain of salt. As I interpret the statement:
  1. Plan your site: U.S. Department of Health and Human Services: Usability
  2. Take a little time to learn code reuse (OOP and design patterns) before you jump on the PHP bandwagon.
  3. At least to get an idea of what is possible with PHP.
A cynic would say that it is ads for his book.

Quote:
Originally Posted by bobitza View Post
I'm not familiar with namespaces, what exactly are they and where are they used? Are they the same thing as '->' for objects?
No.
  1. -> is the indirection operator.
  2. Namespaces, the simple explanation is, a mechanism to avoid name collisions. Example: You use an external library in your applications. If that library has classes with that same name as your own library, you can have name collisions. Name spaces are used to avoid such collisions. Look up the PDF document in the last link in my signature for more about name spaces in C++ and a central reference.

Last edited by kgun; 03-26-2009 at 06:58 PM.
Reply With Quote
  #8 (permalink)  
Old 03-30-2009, 09:23 AM
WebProWorld New Member
 
Join Date: Mar 2009
Posts: 13
arnoldsmithh RepRank 0
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by bobitza View Post
I believe that the "pure OOP" approach started in PHP 5 will fuel PHP growth as the preferred web programming language.
Yeah i agreed php growth is preffered as web programming language. Thanks for your views on this.
Reply With Quote
  #9 (permalink)  
Old 04-17-2009, 12:18 PM
WebProWorld Member
 
Join Date: Apr 2009
Location: Tokyo
Posts: 26
nayes84 RepRank 0
Default Re: Is PHP a powerful tool?

php is one of the languages I like the most.
php got C style with shell and perl language flexibility

for example in C, casting variables of different type is troublesome and debugging segmentation fault is pain in the ass on the other hand php casting is seamless and NO segmentation faults while having almost the same C style
Reply With Quote
  #10 (permalink)  
Old 05-08-2009, 04:05 AM
WebProWorld Pro
 
Join Date: Dec 2007
Location: Pullman, WA (from CA)
Posts: 136
a53mp RepRank 2
Default Re: Is PHP a powerful tool?

As long as it's not ASP I am happy.
Reply With Quote
  #11 (permalink)  
Old 05-08-2009, 08:43 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

As long as asp functions for other people, they may be happy.
Reply With Quote
  #12 (permalink)  
Old 05-20-2009, 04:11 PM
WebProWorld Member
 
Join Date: May 2009
Posts: 44
Dr Britt Borden MD RepRank 0
Default Re: Is PHP a powerful tool?

Yes, PHP is a powerful tool; I know I am going to make some enemies here, but you should also look at ASP.NET 3.5. If you are not a full time professional programmer then you are best to choose between the two. Again, I know that this is a religious issue with some people (Microsoft is the Anti-Christ), but all I am saying is look at both and then decide what you want to do. Microsoft Visual Web Developer is a powerful tool, and it is free (you could I think actually use Microsoft Visual Web Developerwith PHP, but I am not sure about this).
__________________
The site for Food Science Jobs seekers. | Dr Britt Borden web site.
Reply With Quote
  #13 (permalink)  
Old 05-21-2009, 09:25 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

Related WPW thread: Observe what is written in post #2.

Visual C++ application
Reply With Quote
  #14 (permalink)  
Old 08-13-2009, 07:07 PM
WebProWorld Member
 
Join Date: May 2006
Posts: 33
Chiefos RepRank 1
Default

Its just one of several languages, and one that (like most other languages) has some serious flaws. Ive been a php, Java, CSharp/VB developer and I am now looking quite interestedly at Ruby. Ive on Web, Mobile and Desktop apps and I honestly think that only by look around at what others are doing can you really improve.

The number 1 reason I would pick php would be if I were building a content heavy website and needed a CMS. Php has thousands of them out there.

I myself very, very rarely build such things anymore (as there is very little challenge in such a thing). But if I would have to if I had stuck solely to php developer, as those are the only real jobs you can get in my area as a php guy.
Reply With Quote
  #15 (permalink)  
Old 08-13-2009, 07:34 PM
Uncle Dog's Avatar
WebProWorld Pro
 
Join Date: Apr 2008
Location: Scotland
Posts: 235
Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5
Default Re: Is PHP a powerful tool?

only
Quote:
Originally Posted by Chiefos View Post
reason I would pick php would be if I were building a content heavy website and needed a CMS.
That's because, in that instance, it's the right tool for the job. I love php, doesn't mean I LOVE php.
Reply With Quote
  #16 (permalink)  
Old 08-13-2009, 09:34 PM
Doc's Avatar
Doc Doc is online now
WebProWorld Veteran
WebProWorld MVP
 
Join Date: Jun 2009
Location: Baja California
Posts: 669
Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by bobitza View Post
...really made me think the PHP can be THE future of web programming.
As someone that recently started trying to learn PHP myself, I can understand that impression. However, I'd point out that sometime in the not too distant past, someone else probably felt the same way about basic, machine or COBOL.

In my opinion, there IS no language that is the future of web programming, at least that any of us has yet seen. The industry is still so young, in relative terms, that we can expect to see new and better mousetraps, for many years to come. My suggestion is to not get too attached to one, as you could find yourself left behind.

From someone that STILL has a fond place in his heart, for machine.
__________________
If I ever stop learning, let the wolves have my carcass.
http://doccampbell.wordpress.com/
http://cleanstreamwaterconditioning.com
http://carforums-online.com
Reply With Quote
  #17 (permalink)  
Old 08-14-2009, 12:25 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,629
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by Doc View Post
As someone that recently started trying to learn PHP myself, I can understand that impression. However, I'd point out that sometime in the not too distant past, someone else probably felt the same way about basic, machine or COBOL.
You know, that reminds me of coding sites about twelve years ago in Perl, and hearing about this upstart new markup language called Personal Home Pages. Like most developers back then, I figured there was no reason to learn a fad web page markup language when the native scripting language of Linux was so much more powerful. That, and us "true" developers all knew a non-standard, interpreted markup language like PHP could never catch on.




I miss Perl.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #18 (permalink)  
Old 08-14-2009, 08:41 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

Here

A walk in the garden part 1.

PHP 6 on the radar.

are two thread that give you an idea of what PHP id today and what it will be tomorrow. As far as I know name spaces will be introduced in PHP 6. A very important element IMO.

In addition I think the problem with object return value will be solved in php 6.

Example: http://stackoverflow.com/questions/9...t-return-value

Last edited by kgun; 08-14-2009 at 08:48 AM.
Reply With Quote
  #19 (permalink)  
Old 08-14-2009, 10:21 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,629
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Is PHP a powerful tool?

Well, I think the stackoverflow post goes more toward overloading, which as far as I can tell is not planned to ever become a feature of PHP. It would be nice to be able to override operators, but I don't think they are designed as functions the way they are in languages like Java.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #20 (permalink)  
Old 08-14-2009, 01:17 PM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by wige View Post
Well, I think the stackoverflow post goes more toward overloading, which as far as I can tell is not planned to ever become a feature of PHP.
You are correct. I was fast on that search.

Quote:
Originally Posted by wige View Post
It would be nice to be able to override operators, but I don't think they are designed as functions the way they are in languages like Java.
You know that C++ (Builder Professional) is my favorite platform for advanced programming. I don't know a language that implements true polymorphism and generics better than C++. C++ Builder has generalized patterns to binary components that you can drop on a form and edit via the object inspector.

That said, I know that your favorite language is Java. I have looked at it and like C# it seems like simplified C++. Polymorhism, like overloading may be implemented different in different languages.

Did you Google

php overloading

or more generally

php polymorphism
Reply With Quote
  #21 (permalink)  
Old 08-14-2009, 01:45 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,629
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Is PHP a powerful tool?

The issue when it comes to operator overloading as I understand it, is that in certain languages that have been designed around object-oriented programming, operators aren't actually operators. For instance, $a + $b does not literally translate to "add the value of a to the value of b" when the program compiles. Instead, "+" is actually a shortcut to a method of object integer, pointing to the __addition function. Because of this, you have a literal base function that you can inherit and then override.

PHP and languages that were not built for object oriented programming actually use the operators as-is, treating the variables as primitives. From what I can tell, it would take a complete rewrite of PHP from the ground up, turning the variables from primitives into objects, in order for operator overloading to work. Since PHP was built with the idea of typeless variables, such a rewrite might break all prior code, since variables would now need to be declared with a type. If such a change were made, it would probably be akin to the shift from C to C++.
__________________
The best way to learn anything, is to question everything.

Last edited by wige; 08-14-2009 at 02:50 PM.
Reply With Quote
  #22 (permalink)  
Old 08-14-2009, 02:44 PM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by wige View Post
The issue when it comes to operator overloading as I understand it, is that in certain languages that have been designed around object-oriented programming, operators aren't actually operators. For instance, $a + $b does not literally translate to "add the value of a to the value of b" when the program compiles. Instead, "+" is actually a shortcut to a method of object integer, pointing to the __addition function. Because of this, you have a literal base function that you can inherit and then override.
As I understand operator overloading, it checks the underlying data type and implements the correct way to add the terms.

Example:
You can overload the + operator to add complex numbers and strings, in theory any data type that you want to add together.

Quote:
Originally Posted by wige View Post
PHP and languages that were not built for object oriented programming actually use the operators as-is, treating the variables as primitives. From what I can tell, it would take a complete rewrite of PHP from the ground up, turning the variables from primitives into objects, in order for operator overriding to work. Since PHP was built with the idea of typeless variables, such a rewrite might break all prior code, since variables would now need to be declared with a type. If such a change were made, it would probably be akin to the shift from C to C++.
Is overriding the same as overloading in Java?

The first version of C++ was informally called C with headers.

Now it is much more advanced and has copied or extended much of Simula's OO features.

I don't know enough about the PHP kernel and extensions to conclude how true polymorhism like multiple inheritance will be implemented. PHP interfaces that are in a sense pure abstract classes open for multiple inheritance.

Did you look at the search queries? Now you have another

php overriding
Reply With Quote
  #23 (permalink)  
Old 08-14-2009, 03:59 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,629
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by kgun View Post
As I understand operator overloading, it checks the underlying data type and implements the correct way to add the terms.

Example:
You can overload the + operator to add complex numbers and strings, in theory any data type that you want to add together.
In Java, and as far as I know C++, when you declare an integer for example, you are actually creating an object of type Integer. Thus,

int $a, $b;

is the equivalent of saying

var $a = new Integer();
var $b = new Integer();

As an object of class Integer, $a inherits a method called "add", for which "+" is an alias. As a result,

$c = $a + $b;

is the equivalent of

$c = $a.add($b);

When you overload an operator, all you do is overload the method associated with that operator.

And then I pause my typing to ponder on why I never used this functionality, and I remember, oh yeah, Java doesn't support operator overloading! I'm thinking of C++.

Quote:
Is overriding the same as overloading in Java?
I meant to say overloading, sorry. Fixed it in the original post.

Quote:
The first version of C++ was informally called C with headers.

Now it is much more advanced and has copied or extended much of Simula's OO features.

I don't know enough about the PHP kernel and extensions to conclude how true polymorhism like multiple inheritance will be implemented. PHP interfaces that are in a sense pure abstract classes open for multiple inheritance.

Did you look at the search queries? Now you have another

php overriding
Yeah, I checked those searches out. Lots of references to "not going to happen" although there is an optional PHP library that tries to simulate that type of functionality.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #24 (permalink)  
Old 08-14-2009, 04:42 PM
Uncle Dog's Avatar
WebProWorld Pro
 
Join Date: Apr 2008
Location: Scotland
Posts: 235
Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5
Default Re: Is PHP a powerful tool?

The answer is YES... but the thread is turning into something much more interesting and informative than that.
Reply With Quote
  #25 (permalink)  
Old 08-15-2009, 05:58 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by wige View Post
When you overload an operator, all you do is overload the method associated with that operator.
That is correct in C++ at least.

Quote:
Originally Posted by wige View Post
And then I pause my typing to ponder on why I never used this functionality, and I remember, oh yeah, Java doesn't support operator overloading! I'm thinking of C++.
In a way C++ is the new "portable assembler." This "Overloading classes in PHP 5" article that I have not read may be of interest.

Quote:
Originally Posted by wige View Post
Yeah, I checked those searches out. Lots of references to "not going to happen" although there is an optional PHP library that tries to simulate that type of functionality.
The advantages of php:
  1. Flexible and easy to learn.
  2. Large on line community.
  3. Easy to embed PHP statements in HTML document's.

    HTML Code:
    <body>
            <p>
                <?php  if (condition)     { ?>
                    
                <!-- HTML content to display if condition is true -->
                            
                <?php } else { ?>
                    
                <!-- HTML content to display if condition is false -->
                
                <?php } ?>
            </p>
    </body>
  4. Fast developing to a true object oriented language.
  5. Many libraries and plug ins.
  6. Great as the server language for simple AJAX web applications.
  7. Excellent documentation and manual that can be read as an on line book.
Note:
  1. Name spaces are now implemented in php 5.3.0
  2. PHP 6 snapshots.
  3. PHP 6 - Direction of php (e.g. type hinting for return values).

Last edited by kgun; 08-15-2009 at 07:33 AM.
Reply With Quote
  #26 (permalink)  
Old 08-27-2009, 09:46 AM
WebProWorld Member
 
Join Date: May 2006
Posts: 33
Chiefos RepRank 1
Default Re: Is PHP a powerful tool?

To add to the sideline about operator overloads I really don't see the big advantage. I recently used them in a C# project I am working on but I could have easily added .Add(), .Subtract() overrides to the objects.

With regards to php, as the primitives aren't objects you can still achieve the same functionality with static method calls aka:

$result = OperatorOverloads::Add($myObj, 2);

N.b. Sorry if syntax is wrong its been a while since i've touched php

Of course it gets a bit crazy when you have many operators i.e. (($a + b)/$c * $a) + 100; I can see that this would be painful to write.

Last edited by Chiefos; 08-27-2009 at 09:48 AM.
Reply With Quote
  #27 (permalink)  
Old 08-27-2009, 01:48 PM
TrafficProducer's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,638
TrafficProducer RepRank 3TrafficProducer RepRank 3
Default Re: Is PHP a powerful tool?

If you saw down a tree you use a Chain-Saw if you are sawing a plank of wood you use a hand saw.

use the best tool for the job.... PERL, PHP. ASP, AJAX, Java/JavaScript... and if it is a language HTML.
Reply With Quote
  #28 (permalink)  
Old 08-28-2009, 04:49 PM
Uncle Dog's Avatar
WebProWorld Pro
 
Join Date: Apr 2008
Location: Scotland
Posts: 235
Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5
Default Re: Is PHP a powerful tool?

I spoke too soon.
Reply With Quote
  #29 (permalink)  
Old 08-28-2009, 05:43 PM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by Chiefos View Post
To add to the sideline about operator overloads I really don't see the big advantage. I recently used them in a C# project I am working on but I could have easily added .Add(), .Subtract() overrides to the objects.
I don't agree.

A = An object of type T.
B = An other object of type T.

Overloading the + operator, you can write.

C = A + B (The compiler figures out the underlying type and uses the appropriate + operator).

Overriding is in my view related to inheritance where you override a method (or property) in a child class if the method (property) is public or proteced.

Last edited by kgun; 08-28-2009 at 05:45 PM.
Reply With Quote
  #30 (permalink)  
Old 09-04-2009, 05:07 AM
WebProWorld New Member
 
Join Date: Aug 2009
Posts: 7
fizi RepRank 0
Default Re: Is PHP a powerful tool?

i dont think PHP is a tool to build applications, it is Programming language.
Reply With Quote
  #31 (permalink)  
Old 09-15-2009, 09:50 AM
WebProWorld Member
 
Join Date: May 2006
Posts: 33
Chiefos RepRank 1
Default Re: Is PHP a powerful tool?

kgun - overrides was the wrong choice of word, but I think it was quite obvious what I was getting at.
Reply With Quote
  #32 (permalink)  
Old 09-21-2009, 02:25 PM
WebProWorld Member
 
Join Date: Sep 2009
Posts: 26
mimos RepRank 2mimos RepRank 2
Default Re: Is PHP a powerful tool?

Quote:
Originally Posted by fizi View Post
i dont think PHP is a tool to build applications, it is Programming language.
I agree with that. But as a programming language, php rocks.. It's free and has big support.
__________________
free ebooks
Reply With Quote
  #33 (permalink)  
Old 09-21-2009, 02:40 PM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,610
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default Re: Is PHP a powerful tool?

And it can be combined with PHP Application Development Software | Delphi for PHP and C++ with Python.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Powerful Hello to ALL edollar Introductions 1 08-21-2006 11:11 AM
Powerful SEO Copywriting Garrett Insider Reports 1 02-27-2004 05:04 AM
Powerful search redstarfcs Database Discussion Forum 0 02-26-2004 04:45 PM


All times are GMT -4. The time now is 10:34 AM.



Search Engine Optimization by vBSEO 3.3.0