What can PHP not do for you? and if PHP is regenerative....

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Xu Wei Jie
Forum Newbie
Posts: 6
Joined: Sat Oct 11, 2008 6:09 am

What can PHP not do for you? and if PHP is regenerative....

Post by Xu Wei Jie »

Hi all,

I am a student from the National University of Singapore. I want to know more about what kind of complexity all of you faces when developing PHP systems or infrastructures.

PHP is an extensible language. However, it does have its limitations and moreover like any other languages, we face issues like code complexity, maintainability and re usability.

I wish to poll problems and case studies faced by the PHP community when developing intricate and complicated systems that involves a high amount of "lines of code".

What are the things PHP cannot offer you?
What would you think PHP can do better?
If PHP were to have regenerative mechanisms within it that helps to reduce code complexity, would you use it?
How would you think it will benefit you?

weijie
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: What can PHP not do for you? and if PHP is regenerative....

Post by alex.barylski »

I want to know more about what kind of complexity all of you faces when developing PHP systems or infrastructures.
Countless.

1. Internationalization
2. Accessibility
3. Security
4. State

And so on...
PHP is an extensible language. However, it does have its limitations and moreover like any other languages, we face issues like code complexity, maintainability and re usability
Frameworks. I have used every well known framework known in the PHP community and even some lesser known ones. They are not all created equal and which one you use depends a lot on your experience, requirements and personal programming style.
I wish to poll problems and case studies faced by the PHP community when developing intricate and complicated systems that involves a high amount of "lines of code".
Best tip I can offer any developer...DRY KISS as opposed to WET KICK

WET = Waste Every Thing
KICK = Komplexity Is Crucial Kinda

I made those up just now...pretty good eh? :P
What are the things PHP cannot offer you?
Coffee.

Seriously though...PHP con do pretty much everything any other language can (with the exception being C as a systems language). The real quesiton is...do you really want to use PHP to develop full scale desktop applications when it's real power is in expediant web development?

Use the proper tool for the job...this has been reiterated on these forums at least a billion times.
What would you think PHP can do better?
A few things...but nothing beats programmer best practices. More tools to check the code for errors. Static and dynamic analysis tools to find errors in logic.
If PHP were to have regenerative mechanisms within it that helps to reduce code complexity, would you use it?
Define regenerative. I would use anything that made sense. If by regenerative functionality you mean self-changing code. Then no.

PHP is designed for web applications where the logic is usually (and should be) known at the time of development. You can use dynamic/polymorphic techniques for flexibility without relying of code that improves it self. I think that technology is a long way away.
Xu Wei Jie
Forum Newbie
Posts: 6
Joined: Sat Oct 11, 2008 6:09 am

Re: What can PHP not do for you? and if PHP is regenerative....

Post by Xu Wei Jie »

I define regenerative as code that are duplicated all over the place and those that may have similar semantics. If there is a template which we can use over and over again to generate lines of code than having to maintain the same piece of code that could be scattered everywhere, would you want to use that template?

I am more interested in finding a particular case study/system that is developed on PHP and exhibits the limitations of PHP not being able to provide better maintainance of code, reusability and makes code highly complex in nature.

weijie
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: What can PHP not do for you? and if PHP is regenerative....

Post by omniuni »

Well, PHP directly can not do a lot of things, but tons of frameworks exist to fill that gap.

If you are looking for a case study, I would look for something requiring complex math.

-OmniUni
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: What can PHP not do for you? and if PHP is regenerative....

Post by onion2k »

PCSpectra wrote:I made those up just now...pretty good eh? :P
No.

Was that meant to be rhetorical? :twisted:
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: What can PHP not do for you? and if PHP is regenerative....

Post by alex.barylski »

If there is a template which we can use over and over again to generate lines of code than having to maintain the same piece of code that could be scattered everywhere, would you want to use that template?
I use templates all the time...there are several techniques one can use...

1. Copy/Paste programming
2. Functions/Libraries
3. Classes/Frameworks

What other templates are you refering to?
I am more interested in finding a particular case study/system that is developed on PHP and exhibits the limitations of PHP not being able to provide better maintainance of code, reusability and makes code highly complex in nature.
I think you'd be better off exploring the limitations of developers. Experience has taught me that a skilled developer can write code (sometimes magnitudes) faster, more bug free and with less lines, DRY & KISS.

It would be nice to have tools which statically analyized source code and found lines which were not called (dead code) and segments of code which were semantically similar and offered to refactor those lines into a method or function...

It is a lot of work I've tried. Would make for an interesting masters/doctorate thesis though, have fun and good luck and keep me posted. :)
Was that meant to be rhetorical?
Hahaha...it's early moring here and I haven't slept yet...my eyes are weary. When I first read that...I thought you asked:

"Was that meant to be reciprocal"

Seeing as I was talking about DRY and KISS...I was kinda freaked out there for a second as I thought you were hinting at something...hahaha

Sorry my bad...I laughed pretty loud when I realized my mistake...funny stuff... :)
Xu Wei Jie
Forum Newbie
Posts: 6
Joined: Sat Oct 11, 2008 6:09 am

Re: What can PHP not do for you? and if PHP is regenerative....

Post by Xu Wei Jie »

Have a look at this paper.
http://portfolio.lighterday.com/files/urop_report.pdf
(right click and save link as to dl the file)
The url has a bit of problems.

I am not sure what the new language PHP+ can do that PHP can't besides reducing LOC. Thus, I am a bit bewildered.

Let me have your opinions

weijie
Xu Wei Jie
Forum Newbie
Posts: 6
Joined: Sat Oct 11, 2008 6:09 am

Re: What can PHP not do for you? and if PHP is regenerative....

Post by Xu Wei Jie »

OmniUni,

Could you be more specific to explain what PHP cannot do? What are the limitations of its language constructs? Thanks

regards,
weijie
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: What can PHP not do for you? and if PHP is regenerative....

Post by josh »

PCSpectra wrote:It would be nice to have tools which statically analyized source code and found lines which were not called (dead code) and segments of code which were semantically similar and offered to refactor those lines into a method or function...
How would it know the different input boundaries to test? I suppose you could do something like this with xdebug + unit testing + some shell scripts. Wanna write it with me? :lol:
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: What can PHP not do for you? and if PHP is regenerative....

Post by alex.barylski »

I spoke to soon when I said static analysis. It wouldn't really work in PHP being so dynamic, you would need to execute each PHP script and detect stale code that way. I think you can achieve something similar using PHPUnit and code coverage.
Wanna write it with me?
I'd love to as I have lots of interest in that area. Unfortunately that kind of "fun" rarely pays the bills so in addition to work and my own project I have little time to spend on such a task. :(
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: What can PHP not do for you? and if PHP is regenerative....

Post by josh »

I've found investing in my productivity has indirectly helped me pay the bills in the past, but suite yourself :wink:

Looks like phpUNIT uses xdebug
http://www.phpunit.de/pocket_guide/3.2/ ... lysis.html
http://devzone.zend.com/article/2955-Cr ... ith-xdebug
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: What can PHP not do for you? and if PHP is regenerative....

Post by Christopher »

Xu Wei Jie wrote:Have a look at this paper.
http://portfolio.lighterday.com/files/urop_report.pdf
(right click and save link as to dl the file)
The url has a bit of problems.

I am not sure what the new language PHP+ can do that PHP can't besides reducing LOC. Thus, I am a bit bewildered
I looked at the paper. PHP+ is not a language. It is just another badly written little framework.
Xu Wei Jie wrote:Could you be more specific to explain what PHP cannot do? What are the limitations of its language constructs?
Unfortunately that is one of those questions where you would not understand the answer if you need to ask the question.
(#10850)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: What can PHP not do for you? and if PHP is regenerative....

Post by josh »

Xu Wei Jie wrote:Could you be more specific to explain what PHP cannot do? What are the limitations of its language constructs? Thanks
How about user defined operators? uh, they just only recently added anonymous functions.. there's lots of stuff, if you're interested in learning about languages I'd get some books on writing compilers, and study the differences between languages like LISP, C++, Java, Perl, Assembler, Ada, Smalltalk, etc.. Sometimes 2 different languages implement things differently but call them the same thing, or implement the same thing in a different way and call it by a completely different name. For instance is C++ you can have delegate methods ( I believe ), in PHP you'd use a "variable" function name like $function ='echo'; $function('hello world');

Different constructs like name spaces are missing or implemented differently, theres variable typing ( strict or dynamic ), support for interfaces ( which PHP has ), etc...
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: What can PHP not do for you? and if PHP is regenerative....

Post by Eran »

I can't believe I read this paper, or that someone bothered to write it... though it seemed some effort did go into it. Basically PHP+ is a set of code generating scripts based on a concept called Frame Technology, a software engineering approach developed in the late 80's that apparently never gained much traction.
I wonder why...
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: What can PHP not do for you? and if PHP is regenerative....

Post by Christopher »

pytrin wrote:I can't believe I read this paper, or that someone bothered to write it... though it seemed some effort did go into it. Basically PHP+ is a set of code generating scripts based on a concept called Frame Technology, a software engineering approach developed in the late 80's that apparently never gained much traction.
I wonder why...
I just thought it was bad. Pytrin is awesome because he actually determined why it was bad! ;)
(#10850)
Post Reply