On Frameworks, RoR & PHP

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

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

Post by alex.barylski »

ev0l wrote:There are things you can do in Smalltalk that you can not do in PHP. The inverse is not true. In my book that makes Smalltalk more powerful. Don't get me wrong I still use and enjoying using PHP but PHP is not and will never be as influential as Smalltalk.
There are things you can do in C++ that you cannot do in any other language also, but people still use PHP (wisely so) for quick web application development.

As for PHP not being influential. I think you used the wrong word.

I enjoyed reading your "sell" on SmallTalk. However when I searched for SmallTalk IDE's or similar, all I got was links to mostly academic sites???
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Oh please, enough with the Smalltalk adulation. Just take a look where Smalltalk rates (keep going down ... further ... further):

http://www.tiobe.com/tpci.htm

If you look at the bottom of the list there are many other languages that are also worthy of your historic adoration: Pascal, Prolog, Logo, Forth, APL ...

Get a grip on reality. C/C++ and its derivatives Java, PHP and Perl dominate with the new wave of Python and Ruby keeping them honest.
(#10850)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

arborint wrote:Oh please, enough with the Smalltalk adulation. Just take a look where Smalltalk rates (keep going down ... further ... further):

http://www.tiobe.com/tpci.htm

If you look at the bottom of the list there are many other languages that are also worthy of your historic adoration: Pascal, Prolog, Logo, Forth, APL ...

Get a grip on reality. C/C++ and its derivatives Java, PHP and Perl dominate with the new wave of Python and Ruby keeping them honest.
No offense, but you are in no position talk to about his being "adulate" towards smalltalk, when you expound Fowler and his principles and practices with that same kind of enthusiasm or zeal. ;)

As far as Web Development is concerned, I don't think Perl, Java or Ruby hold a candle to PHP or ASP. In desktop development it'sstill C++ that reins king. Java is merely a academic toy. :D

I can count the number of applications written in Java which are in common use on two hands:

1) Limewire
2) ...

Ok, one hand, with one finger. :P

I'm kidding of course, there are several more, such as Eclipse (which is a pig) and other various development tools, UML apps, etc...

Web Development = PHP or ASP if you need Windows
Desktop Development = C/C++/C#

Look at the numbers, there is no comparison, those are the clear winners in their respected categories.

Cheers :)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Hockey, the discussion is about concepts, not implementations. If you can't contribute on that level, don't.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

patrikG wrote:
Jenk wrote:That still bounds back to the same point.
It doesn't. You're missing some of the finer points.

1. What is so "right" about Smalltalk that makes it the alpha & omega?
2. Does PHP's user-base have anything to do with the direction PHP is developing?
3. Why is PHP bound to go down the Smalltalk route - esp. reg. question 2?

To make it clear: this is not a Smalltalk vs. PHP question. It's simply a question about language-inherent features, the "natural" environments of the languages etc.
To say "Smalltalk's got it right" is a clear opinion, but you'll need to add some facts to that as to why PHP is bound to down that route (question 3).
You are right, it's not a smalltalk vs php (or any language vs another language) but it's hard to detract from it when this stemmed from a seaside (smalltalk) framework based php framework.

1. Many reasons. A lot of features we see in upcoming versions of PHP, Java, etc. have been in Smalltalk for decades.
2. Yes, a lot of it. If not all of it.
3. This beckons back to right vs. wrong. Perhaps right vs wrong is the incorrect phrase.. how about "Works well vs Works, but not as well as it could" or "Well suited vs not entirely there yet." See my answer for Q 1, too. :)

An example of where things are headed.. PHP5 saw the introduction of the new object model, a vast improvement over the previous. PHP6 looks to have an even greater object model than in PHP5. Clearly, people want OO - Smalltalk is the apitomy of OO languages. There is absolutely, 100% nothing in Smalltalk that isn't an object. There is not such thing as an Operator or Keyword, either - they too are messages (methods) of the object. Even methods are objects, attached to the actual object.

Reflection in Java (and later, PHP) which has been implemented in the recent years, and many agree is a very powerful tool, is to allow the dynamic forming of objects - Smalltalk is based on this principle.

It's sad to see people bringing up ratings.. if I wanted to, I could point out that falling back onto ratings is a last resort because you can't produce anything more constructive - but I won't :p

As ev0l points out, Smalltalk has lacked in PR. Most Smalltalker's are happy with it that way though. Smalltalk did not have a company the size of Sun behind them, pushing it onto everyone who bought Sun hardware. Think Microsoft vs Linux/Unix. Same jam. The "better" is not necessarily the literal better. ;)
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Hockey wrote:I enjoyed reading your "sell" on SmallTalk. However when I searched for SmallTalk IDE's or similar, all I got was links to mostly academic sites???
That would be because Smalltalk is an Image (not jpeg/gif images, but images ala ghost images etc.) distribution, not a file-based distribution. :)

Squeak Smalltalk has a VM which is hand over fist the best DE I have ever used. The ability to examine objects in real time, even change values and so forth whilst the application is running is a god send. The "debug" tool uses real-time interaction, with full callback state, I can place a break point into my code, then if I need to, step back as many points as a I like, change a value, then step through and view the results, go back change it, try again etc. etc.

Anyway.. this is going off topic, sorry.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

patrikG wrote:Hockey, the discussion is about concepts, not implementations. If you can't contribute on that level, don't.
Oh silly me...I must have forgotten. :P
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Hockey wrote:No offense, but you are in no position talk to about his being "adulate" towards smalltalk, when you expound Fowler and his principles and practices with that same kind of enthusiasm or zeal. ;)
I thought that I got to pick and choose what I like and you lot had to be completely consistent! ;) Though you aught to know that Fowler was involved in probably the high-water mark of Smalltalk projects and moved on...

You actually make an important point. One of my great disappointments is that PHP does no get the attention from the leading writers/thinkers. The fact that many jumped from Java to Python/Ruby means that PHP has not benefited from the expert commentary that helps mold languages. On the other hand, it forces PHP to earn its knowledge. Good evidence are all the things that Zend learned doing ZF and quickly got into 5.1+. PHP6 will benefit as well. If you look at ZF 1.0 you can see how challenged they are by sophisticated design concepts. In some way I think that learning at the school of hard knocks is a strength of PHP's though.
Hockey wrote:As far as Web Development is concerned, I don't think Perl, Java or Ruby hold a candle to PHP or ASP. In desktop development it'sstill C++ that reins king. Java is merely a academic toy. :D

I can count the number of applications written in Java which are in common use on two hands:

1) Limewire
2) ...

Ok, one hand, with one finger. :P

I'm kidding of course, there are several more, such as Eclipse (which is a pig) and other various development tools, UML apps, etc...

Web Development = PHP or ASP if you need Windows
Desktop Development = C/C++/C#

Look at the numbers, there is no comparison, those are the clear winners in their respected categories.

Cheers :)
I think you overlook a few little next generation applications like Google that are done in Java. ;) Middleware drive much of what you see on the web ... and a lot of it is in Java.
(#10850)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I think we covered Smalltalk...

So is there interest in a design discussion of what I called Post-ZF/RoR frameworks and the comparison of dispatched vs callback style frameworks? Perhaps hacking some demonstration code?
(#10850)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

arborint wrote:
Hockey wrote:No offense, but you are in no position talk to about his being "adulate" towards smalltalk, when you expound Fowler and his principles and practices with that same kind of enthusiasm or zeal. ;)
I thought that I got to pick and choose what I like and you lot had to be completely consistent! ;) Though you aught to know that Fowler was involved in probably the high-water mark of Smalltalk projects and moved on...

You actually make an important point. One of my great disappointments is that PHP does no get the attention from the leading writers/thinkers. The fact that many jumped from Java to Python/Ruby means that PHP has not benefited from the expert commentary that helps mold languages. On the other hand, it forces PHP to earn its knowledge. Good evidence are all the things that Zend learned doing ZF and quickly got into 5.1+. PHP6 will benefit as well. If you look at ZF 1.0 you can see how challenged they are by sophisticated design concepts. In some way I think that learning at the school of hard knocks is a strength of PHP's though.
Hockey wrote:As far as Web Development is concerned, I don't think Perl, Java or Ruby hold a candle to PHP or ASP. In desktop development it'sstill C++ that reins king. Java is merely a academic toy. :D

I can count the number of applications written in Java which are in common use on two hands:

1) Limewire
2) ...

Ok, one hand, with one finger. :P

I'm kidding of course, there are several more, such as Eclipse (which is a pig) and other various development tools, UML apps, etc...

Web Development = PHP or ASP if you need Windows
Desktop Development = C/C++/C#

Look at the numbers, there is no comparison, those are the clear winners in their respected categories.

Cheers :)
I think you overlook a few little next generation applications like Google that are done in Java. ;) Middleware drive much of what you see on the web ... and a lot of it is in Java.
Touche. I did over look the portable device market. My own phone is powered by Java. :P

In desktop development however, I stand my ground. Java definetely won't win in the Windows market. Considering M$ hold the majority of desktop users it's a safe bet C/C++/C# will be around for the next while.

I wonder if Java has the influence it does on mobile devices because of excellent PR. Sure it's cross platform quality is nice, but you can accomplish the same effect in C++ so it's surely not a technical reason... :?
SwizzCodes
Forum Newbie
Posts: 20
Joined: Tue Dec 19, 2006 3:23 pm

Post by SwizzCodes »

arborint wrote:I think we covered Smalltalk...

So is there interest in a design discussion of what I called Post-ZF/RoR frameworks and the comparison of dispatched vs callback style frameworks? Perhaps hacking some demonstration code?
oh yes there is!
I followed the whole discussion here and I've got a whole new view on my own concepts and plans which is awesome, I've learned a lot :)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

SwizzCodes wrote:
arborint wrote:I think we covered Smalltalk...

So is there interest in a design discussion of what I called Post-ZF/RoR frameworks and the comparison of dispatched vs callback style frameworks? Perhaps hacking some demonstration code?
oh yes there is!
I followed the whole discussion here and I've got a whole new view on my own concepts and plans which is awesome, I've learned a lot :)
Ditto. Actually...

I'm interested in hearing your perspective/experiences on the differences between callbacks VS dispatched and their benefits & advantages.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

SwizzCodes wrote:oh yes there is!
I followed the whole discussion here and I've got a whole new view on my own concepts and plans which is awesome, I've learned a lot :)
Great. I suspect both dispatched and callback styles should be supported by the next generation frameworks. And both templated and generated output should be supported as well. I currently support both of the latter, and am interested in learning more about callbacks.

I believe that there is some understanding around here about both dispatching and templating, so it would be helpful if the Seaside and Phaux promoters would educate the rest of us a little on the callback style and programatically generated output. I for one think I could learn a thing or two...
(#10850)
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

callbacks are simply a state of execution on hold until it is called upon.

In Seaside, this allows me to generate a form, and for each input I can assign a callback. Example textinput callback would simply be to assign the value of the input to a variable, for later use - usually in the callback I assign to the form (ergo, the submit action.) where I then use the input's for processing.

An anchor callback can be anything, but usually to display a different component (ergo a different page.)

Programatically generated output has huge advantages. I can generate a view with nothing but a simple <h1> block from one component, but I can also create a view that has dozens of components (which are seperate objects) and still be safe in the knowledge that the final output will still be valid. I could also render any of those mixed-and-matched components individually, and still create valid markup.

I can mix and match any component with the generator and it will render valid markup 100% of the time. No matter which order I render them in. This is not the case in templates. I have to ensure I 'include' sub-templates in their correct places and so forth.

If I do try to render malformed markup, the generator will not let me. Templating will allow me to make as many mistakes as I like.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Jenk wrote:callbacks are simply a state of execution on hold until it is called upon.

In Seaside, this allows me to generate a form, and for each input I can assign a callback. Example textinput callback would simply be to assign the value of the input to a variable, for later use - usually in the callback I assign to the form (ergo, the submit action.) where I then use the input's for processing.

An anchor callback can be anything, but usually to display a different component (ergo a different page.)
This does not sound much different from Input or Form Controllers. Can you give a code example, maybe a login form...
Jenk wrote:Programatically generated output has huge advantages. I can generate a view with nothing but a simple <h1> block from one component, but I can also create a view that has dozens of components (which are seperate objects) and still be safe in the knowledge that the final output will still be valid. I could also render any of those mixed-and-matched components individually, and still create valid markup.
I don't see the advantage of this over hierarchical Views. I can attach anything with a render() method to any element in the tree. It could be a template, a View, a HTML generator, etc. It all gets assembled by the response. If I needed to build everything out of HTML generators I could, or all out of templates as well. Usually it is a mix though.
Jenk wrote:I can mix and match any component with the generator and it will render valid markup 100% of the time. No matter which order I render them in. This is not the case in templates. I have to ensure I 'include' sub-templates in their correct places and so forth.

If I do try to render malformed markup, the generator will not let me. Templating will allow me to make as many mistakes as I like.
You claim "huge advantages" but the main thing you like is "valid markup 100% of the time." In the whole scope of a project that is not that important to me and also not something I have a problem achieving on releases. Typically the stuff with sophisticated markup is the layout that gets defined when the site is designed and does not get changes until the site is redesigned. The content is usually very simple layout-wise, yet that is what changes.
Last edited by Christopher on Sat Jun 30, 2007 10:34 pm, edited 1 time in total.
(#10850)
Post Reply