Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Why dymanic pages as opposed to HTMl?

Quote Reply
Why dymanic pages as opposed to HTMl?
I'm not sure if the UBB still churns out HTML pages, but I remember a time where all threads were static HTML pages. This, they claimed (quite ritely!!) decreased the demand on the server, and produced faster pages, that would also be able to be indexed by search engines (3 very big plus points!).

I was just wondering why GT has decided against this option, and have decided to generate pages, on the fly?

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
Ok, for a site this size, imagine building the pages and how long it would take and how much space it would use up - also you lose some dynamic features and the general interactive feel of the forum. (Which is what it's all about).

Last edited by:

RedRum: Oct 15, 2001, 3:57 AM
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
There's nothing dynamic about the message thread page, execpt for the edit button is disabled after an x amount of time (which is a feature I'm not keen of anyway).

The trade off on server resources would be beneficial, surely? What about search engine indexing?

Why did the UBB switch back?

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
Well I suppose it comes down to personal preference. I'd much prefer a dynamic forum with a little extra server resource usage.

You never know, GT may develop something....

Think about it........all "popular" forums are dynamic....the most unpopular.....UBB (well most unpopular due to things I've heard)

Last edited by:

RedRum: Oct 15, 2001, 4:06 AM
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
UBB most unpopular? Huh? Where do you get your information from? Look at their clientel. They have lost a few customers lately due to the fact that solid free alternatives are coming out. But look at how many of the big boys are still using them. BTW: Please someone explain to me why they use UBB? THe worst piece of forum software ever written, IMO.

And back to the topic; the UBB have now reverted back to dynamic pages. Not sure if this is because they have moved over to PHP driven pages, or what?

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
I said most unpopular from what I've heard from others, not by their customer levels but what people say about the software.....and you even said it yourself!

>>BTW: Please someone explain to me why they use UBB? THe worst piece of forum software ever written, IMO.<<



Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
BTW....your wish is my command....I added a quick code snippet I just wrote into my signature.
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
Yep. I personally hate it. But that doesn't mean to say it's not popular. In fact, I'm sure that it's the most popular board on the net.

I get an error on your sig ?

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
Quote:
But that doesn't mean to say it's not popular.

Again, I mean unpopular in terms of people's comments about it, not customers!

Quote:
I get an error on your sig ?

I don't ;)

Maybe you aren't executing it properly...
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
Paul,

OK? su/(\d{2})/chr($1)/eg+print lc scalar reverse <>,if$_='5983847366798478733632444778696865763278736647328473768083';? yes
Badly placed (.
[localhost:~] qooq%

DOH have no clue what that is supposed to mean Crazy

--------------------------------------------

hmmm ... I 've seen a lot of sites go wwwThreads but now I wonder what those converted sites will do ???

Wink hopefully go GForum all the way ....

but sadly vBulletin is gaining ground quickly .... hmmmm they have a licencing issue that a lot of folks don't like. And I've heard that vBulletin is very particular about mods that people put out ...



openoffice + gimp + sketch ... Smile

Last edited by:

QooQ: Oct 15, 2001, 6:58 AM
Post deleted by RedRum In reply to

Last edited by:

RedRum: Oct 15, 2001, 7:03 AM
Quote Reply
Re: [QooQ] Why dymanic pages as opposed to HTMl? In reply to
To run it from the shell use:

perl -e 's/(\d{2})/chr($1)/eg+print lc scalar reverse,if$_="5983847366798478733632444778696865763278736647328473768083"'

Don't try it if you are offended easily...

Last edited by:

RedRum: Oct 15, 2001, 7:03 AM
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
Angelic

ummm ... isn't that a little off topic ???

openoffice + gimp + sketch ... Smile
Quote Reply
Re: [QooQ] Why dymanic pages as opposed to HTMl? In reply to
I would have thought it is the most on-topic, topic, in the world lol.

I said don't do it if you get offended.

No-one knows what it says without running it, so if you ignore the warning then that's not my fault :)
Quote Reply
Re: Paul's Sig In reply to
Print a new line after.

heehee

- wil
Quote Reply
Re: [QooQ] Why dymanic pages as opposed to HTMl? In reply to
Edited.

Last edited by:

RedRum: Oct 15, 2001, 7:26 AM
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
;-)

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
Not that it was needed ... :)

I guess you are fussy about design not only in your pages but in your telnet window too...lol

Last edited by:

RedRum: Oct 15, 2001, 7:40 AM
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
yep!

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
Hi,

With html pages you do lose a lot of the flexibility such as:

- Custom paging (i.e. I like to see 50 posts per page, others 10).
- NEW tags on the posts
- Security Groups: i.e. if I'm not allowed to see this post, it's harder to control that.
- Rebuilding is horrible. If I were to make a template change, I would either need to accept that 160,000+ pages won't be updated, or rebuild. That's going to take a long time.
- Flat view only? Or do you build a flat view + threaded view?
- Show IP for admin's can't work.

Those are just a few of the reasons. That said, I have thought of doing an HTML plugin that would create pages, as it is definately useful in some cases.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Why dymanic pages as opposed to HTMl? In reply to
Not to mention, these additional benefits:

1) When users change their preferences (like signatures), those changes would not carry over into older threads/html files, thus causing inconsistency and confusion.
2) Inability to search new threads...you have to re-index threads/posts in UBB every once in awhile for the search engine to work.

Also, popular search engines, like GOOGLE, DO index and store dynamic web pages in their directory.

========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] Why dymanic pages as opposed to HTMl? In reply to
Eliot

Does Google cache them too?

And just for the record; I don't want to see GT go down the 'static route'. I was just wondering why not, and if they had thought about it. I'm also wondering why the UBB decided to revert back. I guess I'll have to take a look at their boards for that answer.

Cheers

Wil



- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
Yes they do...

Example:

http://www.google.com/...sion+Forum&hl=en
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] Why dymanic pages as opposed to HTMl? In reply to
Interesting, thanks!

- wil
Quote Reply
Re: [QooQ] Why dymanic pages as opposed to HTMl? In reply to
FYI: wwwthreads just bought by Infopop (the company of UBB).

Many dislike Infopop/UBB, and more, they decided to develop their perl version. Many of their clients realy annoy it.

I think it is a good time to transfer those clients to gForum.
Quote Reply
Re: [cfox] Why dymanic pages as opposed to HTMl? In reply to
You mean they decided to abandon the Perl version, claiming that the PHP version was actually faster. I'd like to see some benchmarks with a server loaded up with mod_perl delivering the forum. Or maybe it's just louzy coding in the Perl version?

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
I'd like to see a PHP cgi script (NOT mod_php) try to compete with a Perl CGI Tongue.

I'm assuming that PHP can even do cgi's though... Maybe it can't...

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Why dymanic pages as opposed to HTMl? In reply to
Yes, it can do CGIs. And the guys behind WWWThreads are actually claiming that doing it through PHP would be faster, and even with mod_perl loaded you would not be able to beat the speed of their PHP version.

Which leads me to believe that it must be a case of very louzy coding on the Perl side.

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
As Scream pointed out, few hosting service will allow you to run mod_perl. He's a very good programmer, I think.

PHP is a lot easier for non-programmers to come to grips with, so the market will be much bigger. Perl scripts like GT produces run the risk of being labelled "For Perl Programmers only". If you want your market to include all the part-time, non-programmer Web masters out there, then you need to make sure that your scripts have an excellent and easy to use admin interface.
samantha
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
Quote:
Which leads me to believe that it must be a case of very louzy coding on the Perl side.

Or that they dropped perl and want to lose as few perl customers as possible.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Why dymanic pages as opposed to HTMl? In reply to
This is what I think about that whole Infopop buying w3t deal. Infopop knows UBB can't really compete with the other faster, better products on the market. So they went and got WWWThreads. But the problem is that WWWThreads has a Perl and PHP version... They can't just drop UBB since that would be just implying that their product is not as good. They also can't merge it with WWWThreads, as they're very different programs. So, the other solution would be to drop the WWWThreads Perl version and keep UBB, and keep on developing the PHP version. Or maybe there are lots of people who like UBB because it's flatfile based...

Adrian
Quote Reply
Re: [brewt] Why dymanic pages as opposed to HTMl? In reply to
But the UBB is PHP based? So developing the WWWThreads Perl version would of been a better decision as they could then offer a broader spectrum of products? They could of offered the PHP UBB to non-programmers (as Susanne pointed out) and the more powerful WWWThreads to more experienced web masters.

Although I believe this point is completly invalid. You don't need any experience of Perl whatsoever to run GossamerForum, as anyone who has isntalled it will tell you.

It just seems to me at the end of the day that they are trying to either save money by cutting out all their perl programmers from the loop, or they actually don't feel that their perl code can compete with the others on the market.

Cheers

Wil

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
But the UBB is PHP based?

The vast majority of UBB implementations are version 5, which is a PERL script. UBB6 has a PHP wrapper, I think, but is not an PHP script. In any event, the tepid response to UBB6 probably prompted Infopop to start thinking about a PHP board, as they were losing many potential upgraders to vBulletin. Scream, the W3T programmer, noted when the acquistion was being discussed, that almost all his new licenses were for the PHP version.

In Reply To:
It just seems to me at the end of the day that they are trying to either save money by cutting out all their perl programmers from the loop, or they actually don't feel that their perl code can compete with the others on the market.

Eh, what others? :)


samantha
Quote Reply
Re: [samtha25] Why dymanic pages as opposed to HTMl? In reply to
Quote:
that almost all his new licenses were for the PHP version.

I think that might be some infopop pr work justifying dropping perl version. I heard different numbers when I asked Rick about php vs perl about two months ago.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [samtha25] Why dymanic pages as opposed to HTMl? In reply to
It seems that a lot more inexperienced web "developers" are starting to develop their own sites then, thinking that the PHP versions are more user-friendly and easier to install. That's the only reason I could think of.

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
I wonder if a lot of the php craze is due to the fact that lots of good code and good scripts are GNU/GPL which means you can throw together a decent site relatively simply and cheaply. hey, just look at all the nuke users out there! why not, get lots, I mean lots of function for just a simple link back to their site or not even that. I found 3 different scripts that compete pretty well with links regular. and there are good boards out there too. dbman is the only one that GT definately has a strong hold on.

NOW, don't get me wrong, I'm not even any where knocking GT, it's just that alot of young folks are getting on the net wagon, with little or no cash, and can slap together a pretty decent site with the help of lot's of php fanatics. look at the power and bonding between mac users.

Also, I do know that the SQl versions from GT just about blows everything else out of the water, but ... come on with a limited budget that fire power is only a dream. (look at the taliban with their homemade weapons and pickup trucks that imitate tanks -- they really have a dream going on but that dream sent Russis packing with it's tail between it's legs)

hmmm ... at least GT is well established and any site that ues GT products can't go wrong, well at least in my opinion. I just wonder what GT will do in a few years? Will, the net still be around as we know it now?

??? Crazy

openoffice + gimp + sketch ... Smile
Quote Reply
Re: [QooQ] Why dymanic pages as opposed to HTMl? In reply to

> NOW, don't get me wrong, I'm not even any where knocking
> GT, it's just that alot of young folks are getting on the net wagon,
> with little or no cash, and can slap together a pretty decent site with
> the help of lot's of php fanatics. look at the power and bonding
> between mac users.

This used to be the case of Perl years ago. Remember Matts Script Archive at http://www.worldwidemart.com/ -- that used to be the place for all your free CGI/Perl scripts. Until the guy went off to Uni and everyone realised his scripts were crap and full of security loopholes.

Jeepers. I think he really started off the whole free scripts craze. Or I'm sure he was one of the root people to start coding and throwing away his stuff for free. After that came the CGI Resource Index, which is now more or less dead too. Selena Sol, and so on and so on...

Sigh. Those were the days.

I'm just wondering why has the shift moved from perl to php recently? There's been a dramatic shift from everyone jumping ship from Perl to PHP for their free scripts, and little forms etc. etc. All the big complex programs are still written in Perl, and other languages, even some still in Python. <shudder>.

I'm just wondering what the catalyst for this big jump has been? I miss the good old days of the Perl community. Not saying that it's dying, it's as strong as ever, maybe even stronger, maturer and wiser.. but there was a real sense of perl everything on the net a few years back. Now that seems a little distorted as of late.

- wil
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
Whats all this good old days stuff...lol you are 19. In the good old days you were still going through puberty.
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
good ol days or not ... I know what you're saying. When I got involved with making my own homepage back a few years ago. I remember the cgi-resource center and over 70% shareware or at least linkware. After which lot's of scripts went to buy me systems.

Also, lots of hosting services were being very protective about CGI and SSI usage. Sercurity of course.

At which time, the newbie came out - php. With promises of easier use, speed and a more of a built for sql language. Also, at the same time. SQL was starting to take hold in a lot more servers. These SQL based hosting solutions were probably based at places which sprouted up with the .com boom time. Which were offering cheap and decent service. (I'm sure lot's of other variables came into effect at the same time).

So, you have a wave of folks catching on to the band wagon and to be in with the others. Offered lot's of decent scripts as GNU/GPL.

But, the creep effect has already started. Lot's of efficent scripts are finally arriving and with them prices and shareware have started to replace the 1st generation of freebie goods.

Within another year I bet php will be like perl. 70% shareware/buy me and 30% hey here's a freebie.

What will happen after that ??? I would love to know. I figured knowing Java, Perl, and php would be nice little buffer to protect yourself for a bit. After that ... mmm ... possibly RUBY might get bigger. And I have been digging around about WebObjects ... doesn't make much sense for me to use since I got GT but thought that such type of systems might finally put ASP into it's grave finally.

oh no Crazy starting to ramble.

openoffice + gimp + sketch ... Smile
Quote Reply
Re: [QooQ] Why dymanic pages as opposed to HTMl? In reply to
IMO there are too many php myths.

Please someone tell me why they think php is "easier" than perl
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
Because you can do more complex stuff in Perl Wink that PHP can't, so naturally PHP's GOT to be 'easier'. hehe

Perl's and PHP's syntax is pretty similar, except I find PHP's syntax more strict and everything is function based (or whatever you'd call it). For example, I find it extremely annoying that I have to go:
Code:
$foo = preg_replace('/foo/', 'bar', $foo);
When you can just do:
Code:
$foo =~ s/foo/bar/;
in Perl. And we all know how useful regex's are and how often you use them in most web oriented programs/scripts.

What's 'easy' about PHP is that most things are just built in (kinda). With Perl, you do have to know which modules you need to load to do and such.

I'm too lazy to think of any more differences, so I'll leave it at Tongue

Adrian
Quote Reply
Re: [brewt] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
I'm too lazy to think of any more differences, so I'll leave it at Tongue

Ooh, how about that idiotic thing we came across the other day? In PHP, you can't get the form input from this HTML multi-select list:

Code:
<select name="foo" multiple>
<option>abc
<option>def
<option>ghi
</select>

You'll only get either the last (or the first, I don't remember which) item selected, even though it is a MULTI-select.

You instead have to do something idiotic:

Code:
<select name="foo[]" multiple>
<option>abc
<option>def
<option>ghi
</select>

Notice the [] after the name. But then, your input is just 'foo', not 'foo[]'. Am I the only one who thinks that is just plain dumb?

And they try to say PHP is better LaughLaughLaughLaughLaugh

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Why dymanic pages as opposed to HTMl? In reply to
I tried to write some php code a while ago and gave up after 10 minutes when I realised I needed to use up a whole line for something that would take a 1/4 of that in perl.

I like using php scripts but ugh...I would never wish to write one.

Everything seems so lengthy and unnecessary. eregi_replace and echo this, echo that...and thats the tip of the iceberg

Last edited by:

RedRum: Oct 30, 2001, 6:37 PM
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
Try having to convert the LinksSQL frontend to use PHP instead of Perl Crazy

Adrian
Quote Reply
Re: [brewt] Why dymanic pages as opposed to HTMl? In reply to
Aww, your almost done though. =)

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
Whats all this good old days stuff...lol you are 19. In the good old days you were still going through puberty.

What's puberty ;-)

I mean the good old days of the net. Round the time Mosaic was alive and well, and then NS came on the scence..... Where usenet was actually worth pouring through... Those were the days for me. I was young, yeah, 13 14 or 15 maybe?

- wil
Quote Reply
Don't get me started on PHP... In reply to
Mhph.

- wil
Quote Reply
Re: [brewt] Why dymanic pages as opposed to HTMl? In reply to
I'll leave that to you if it's all the same :)
Quote Reply
Re: [brewt] Why dymanic pages as opposed to HTMl? In reply to
Quote:
$foo = preg_replace('/foo/', 'bar', $foo);

preg_replace('/foo/', 'bar', $foo);

I think you can leave "$foo = " out. Can't be bothered testing it, but I'm fairly sure that would work.

I don't see what the big deal about making the PHP Frontend to Links SQL. The backend is the hard part -> The front end is the simple bit which is easier in PHP.

Cheers,
Michael Bray
Quote Reply
Re: [Michael_Bray] Why dymanic pages as opposed to HTMl? In reply to
Quote:
preg_replace('/foo/', 'bar', $foo);

I think you can leave "$foo = " out.

Still doesn't beat perl.

preg_replace('/foo/', 'bar'); 28 chars

s/foo/bar/; 11 chars....less than half the length.


Quote Reply
Re: [RedRum] Why dymanic pages as opposed to HTMl? In reply to
http://evil.inetarena.com/php/DBI.php3

A site for all you Perl junkies needing to use PHP for SQL stuff.

Look how much more readable the PHP version of the regular expression is.Blush
Cheers,
Michael Bray

Last edited by:

Michael_Bray: Oct 31, 2001, 5:14 AM
Quote Reply
Re: [Michael_Bray] PHP v. Perl In reply to
I have to agree with you there. It's much easier just to write a HTML document and throw in a few extra PHP tags than it is to construct a Perl program.

I think that's why the major shift to PHP. People see it as being easier.

I blame it all on cheap domain names and cheap web hosting. The number of crap sites on the net have rocketed since the introduction of cheap hosting and cheap domains. Well, saying that, does anyone else remember the days when domain names were free?

Gone are the days of amateur sites being thrown together on Geocities, AOL and Ourworld/Sprynet.

More and more people without a clue what they're doing are getting access to PHP/MySQL and all these powerful tools for next to nothing - and in some cases for nothing.

Someone somewhere should devlelop a crafty perl program where you can not write a single line of perl code without reading the entire camel book.

Sigh.

- wil
Quote Reply
Re: [Wil] PHP v. Perl In reply to
Of course it's easier to have a html page with a few chunks of php code....that's why perl programmers are more talented Tongue
Quote Reply
Re: [RedRum] PHP v. Perl In reply to
I wouldn't go that far, Paul.

Maybe more ambitious, good looking, humourous, tall, dark, always got a nice blonde hanging off his back ....

Ugh. Gotta stop day dreaming.

Back to work ...

- wil
Quote Reply
Re: [Wil] PHP v. Perl In reply to
Quote:
Maybe more ambitious, good looking, humourous, tall, dark, always got a nice blonde hanging off his back ....

......enough about me...I don't often have blondes hanging off my back though...lol (maybe my arm)
Quote Reply
Re: [Wil] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
In fact, I'm sure that it's the most popular board on the net.

1. you meant the first locally installable software!
2. imho, simply no. google finds 1.5 Million phpBB boards, 1 million ikonboard installations, and a half a million UBB Forums.

it has been the most popular 'cause they where among the first, giving away a free board. and they "invented" the now standart "flat" view, the ubb codes, "["-markup-style.

and hey, look at this pic:

http://members.ikonboard.com/ibsearch.jpg

(beside, why not put on a img-ubb-tag? like the url, email, i tags..)

cu, Raphael.

Last edited by:

raphb: Nov 15, 2002, 4:58 AM
Quote Reply
Re: [Jagerman] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
I'd like to see a PHP cgi script (NOT mod_php) try to compete with a Perl CGI Tongue.

I'm assuming that PHP can even do cgi's though... Maybe it can't...

hum - didn't you miss the point? why wouldn't you use mod_php? nobody's runnin' php through CGI (even if it's possible.

greets, Raphael.
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
Wow, I thought that comment was long gone Wink!

My point was simply that comparing mod_php to Perl CGI is comparing apples to oranges. Many people see that mod_php is faster than Perl CGI (unless you get into long-running processes), and therefore mistakingly make the conclusion that PHP is faster than Perl. It isn't - it's actually considerably slower. So, if you want to compare actual language speed, you really need to put them on the same level - either both under CGI, or both compiled into the web server.

Would you think it fair if I compared CGI PHP with mod_perl?

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Michael_Bray] Why dymanic pages as opposed to HTMl? In reply to
Quote:
preg_replace('/foo/', 'bar', $foo);

I think you can leave "$foo = " out. Can't be bothered testing it, but I'm fairly sure that would work.

it doesn't :) every function returns a value (well, actually it doesn't have to), so if you don't do:

echo preg_replace('/foo/', 'bar', $foo);

or something with it the value gets returnet into /dev/null :)

ok, you could use:

preg_replace('/foo/', 'bar', &$foo);

wich would then modify the variable by reference. but DON't do this, as it's depreciated.

what about php & perl? perl is just plain ugly :) not readable.

what about the [] in the multiple select? the return value will be placed in the
Code:
value="valuename"
- so it will be just a variable. but to get multiple values in one object-name you've simply to use arrays..

it's more logic.

cu, Raphael.
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
Quote:
perl is just plain ugly :) not readable.

I guess it depends on what you are familiar with as I could say the same about php.
Quote Reply
Re: [Jagerman] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
Would you think it fair if I compared CGI PHP with mod_perl?

eh - no :) look here:

http://www.bagley.org/...out/bench/ackermann/

so what now? yes, perl is 20 - 50 % faster. but Perl's syntax is just PLAIN UGLY. you write it quite fast, but you can't read it after.

Code:
foreach($this->result as $key => $value) {

$result[] = $this->_stripform($value);

}

$this->result = $result

pretty cool isn't it? :) but use the benchmark site above - it give's the code used too.

cu, Raphael.
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
Can you explain what that code does? It isn't intuitive enough on its own to make sense of. What is "_stripform"? And what does $result[] = ... do? (I'm guessing it pushed onto the end of the array, but it certainly isn't intuitive). And why do you assign back to $this->results at the bottom? Is it not possible to change a value inside a loop in PHP?

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
Which language is uglier is not going to go very far here, I think - but I will give you that Perl can be ugly. But, the fact that Perl can be ugly is a strengh, not a weakness. One of Perl's main tenants is that there is (almost) always more than one way to do something. PHP's philosophy is a little different - basically, it tells you what the way you should do something is.

Ultimately, I suppose the biggest difference between the two comes down to how creative and intriguing you want to be with your programming. With the different interfaces you can write in a module to do the same thing - via tie()ing, autoloading, prototyping, overloading, etc. you can come up with very "cool" ways of doing things in Perl that usually don't look ugly, but rather look kindof cool.

For example, consider the following:

my $response = GT::WWW->get('http://gossamer-threads.com');
print "Response status: " . int($response->status) . "\n";
print "Response string: " . $response->status . "\n";
print "Headers: " . $response->headers . "\n";
print "Content: $response\n";

Could I do something like that in PHP? It's doubtful. Most likely, I'd have to call something that returns an array, and extract the information from various predefined positions in the array. Personally, I prefer the above - it is simple to see what it does from just looking at it. In reference to your other post, will I be able to read it 5 minutes from now? Yes. You don't know Perl, yet you can see exactly what that does. On the other hand, I can't look at your PHP example and figure out what it does.

I could write the same code so that it looked like this:

my %response = GT::Fictional::WWW->get('http://gossamer-threads.com');
print "Response status: " . $response->{status} . "\n";
print "Response string: " . $response->{string} . "\n";
print "Headers: " . join("\n", map "$_: $response->{headers}->{$_}", keys %{$response->{headers}}) . "\n";
print "Content: $response->{content}\n";

That code could do exactly the same thing - but you'd be right in this case; that is a little ugly. Many people would probably be tempted to write it that way - or worse. My point is that just because some Perl code is ugly, doesn't mean that all Perl code is ugly.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
Can you explain what that code does? It isn't intuitive enough on its own to make sense of. What is "_stripform"? And what does $result[] = ... do? (I'm guessing it pushed onto the end of the array, but it certainly isn't intuitive). And why do you assign back to $this->results at the bottom? Is it not possible to change a value inside a loop in PHP?


oookay *lol*. _stripform is a function inside the actual class ($self) you wrote. would have been suggested by the (), i think. $result[] adds a value to a number-indexed array. i think it's pretty intuitive.

$result[2] = 1;

puts 1 to the result array wich you can access by the index nr 2, not giving a number will simply create one for you..

i assign back "$results = $this->results" at the bottom 'cause i'm just too silly ;)

foreach($this->result as $key => $value) {

$this->result[$key] = $this->_stripform($value);

}

would be correct.
Quote Reply
Re: [Jagerman] Why dymanic pages as opposed to HTMl? In reply to
Quote:
For example, consider the following:

my $response = GT::WWW->get('http://gossamer-threads.com');
print "Response status: " . int($response->status) . "\n";
print "Response string: " . $response->status . "\n";
print "Headers: " . $response->headers . "\n";
print "Content: $response\n";


Actually PHP does support classes, and the syntax in this case is practically the same. You just need to make sure you have the appropriate GT::WWW class written in PHP.

Or, without using a class in php...

$fp = fopen('http://www.yahoo.com/','r');
print_r(stream_get_meta_data($fp));
fpassthru($fp);
fclose($fp);

:)

Joe
--
Christianity.com Forums
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
Code:
foreach($this->result as $key => $value) {

$this->result[$key] = $this->_stripform($value);

}

There's nothing special about that. In perl it would be:

Code:
while (my ($key, $value) = each %{$this->result}) {

I'm not sure about your next bit as you seem to be treating "result" as a class method but you then treat it as an array. Oh well.

Either way I consider the perl version to be more readable (and I'm not just saying that) - I find words mixed in with code to be more confusing.

Btw, how would you go about modifying every element in an array in php?

Say for example, what would the code be to create an array with 100 elements set to "1" and then modify them all to "11"?

Last edited by:

Paul: Nov 15, 2002, 6:40 AM
Quote Reply
Re: [Paul] Why dymanic pages as opposed to HTMl? In reply to
hmm, pretty forum, handles things pretty much like you except :)

Code:
while (my ($key, $value) = each %{$this->result}) {

In Reply To:
I'm not sure about your next bit as you seem to be treating "result" as a class method but you then treat it as an array. Oh well.

uh - methods are allways called with "()".. i don't see what your "my" does. and what does your "%"? and what does your "{" do?

in my humble opinion this can't get be understood wrong after some thoughts:

Code:
foreach($this->result as $key => $value) {

$this->result[$key] = $this->_stripform($value);

}

foreach creates a loop, runs through the {} code for every line, and there are new variables called $key and $value.


In Reply To:
I find words mixed in with code to be more confusing.

hey, i found YOUR "my" confusing Cool

In Reply To:
What would the code be to create an array with 100 elements set to "1" and then modify them all to "11"?

Code:
for($a = 0; $a > 100; $a++) {

$array[] = 1;

}

foreach($array as $key => $value) {

$array[$key] = $value * 11; // or simply "= 11;"

}

and how would YOU do that? Laugh
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
Quote:
uh - methods are allways called with "()".

Not in perl they aren't ;)

$this->is_a_method
$this->is_a_method_too()

Quote:
i don't see what your "my" does.

It declares the listed variables to be lexically confined to the enclosing block which means it prevents conflicts and pollution and allows you to do things like this (not that it is advisable):

Code:
sub foo {

print header;

my $var = 1;
print $var;
{
my $var = 2;
print $var;
{
my $var = 3;
print $var;
}
print $var;
}
print $var;
}

That will print: 12321

Code:
and what does your "%"? and what does your "{" do?

That tells you that the return value from the "result" method is a reference to a hash and so %{} dereferences the hashref into a normal hash.

Code:
and how would YOU do that?

Well the php version is just laborious :)

I could show you 5 or more variations in perl but how about this (for shits and giggles):

Code:
my @array = map { $_+=10 } map { 1 } 1..100;

Tongue

Last edited by:

Paul: Nov 15, 2002, 7:12 AM
Quote Reply
Re: [Jagerman] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
PHP's philosophy is a little different - basically, it tells you what the way you should do something is.

yes. like 500 years before: there was no "right" way to write correctly. everyone wrote simply like he wanted to.. i hope you agree the model today with having one way to write "tomorrow" is better.


In Reply To:
For example, consider the following:

my $response = GT::WWW->get('http://gossamer-threads.com');
print "Response status: " . int($response->status) . "\n";
print "Response string: " . $response->status . "\n";
print "Headers: " . $response->headers . "\n";
print "Content: $response\n";

Could I do something like that in PHP? It's doubtful.

no, evern better Tongue

$snoopy = new Snoopy; // snoopy is a class..
$snoopy->fetch("http://raphb.ch/");

echo "headers: <pre>";
print_r($snoopy->headers);
echo "</pre>";
echo "status: " . $snoopy->status;
echo "content: " . $snoopy->results; // "." is concarnation..

and hey, if you don't want the headers, you could even do:

$fp = fopen("http://raphb.ch/", "r");
$content = file($fp); // loads the filepointer fp into array content
foreach($content as $value) {
echo $value;
}

In Reply To:
Yes. You don't know Perl, yet you can see exactly what that does. On the other hand, I can't look at your PHP example and figure out what it does.

i'd say the opposite Unsure


In Reply To:
I could write the same code so that it looked like this:
[.]
Many people would probably be tempted to write it that way - or worse. My point is that just because some Perl code is ugly, doesn't mean that all Perl code is ugly.

yes. but of course if you can't write ugly, you won't write ugly. there is NO reason to write ugly, never.

In Reply To:
But, the fact that Perl can be ugly is a strengh, not a weakness.
Basicly i think you should force the user to write in a good style. you should never support users wich write ugly code. i'm reading pretty much code the hole day. i don't think having various ways to solve something is pushing creativity. it rahter stops it, 'cause you've to hold more things in your mind. more code. more ways to solve something.. ok, this really may be discutable Crazy (even if i'd never agree..)

cu, Raphael.

Last edited by:

raphb: Nov 15, 2002, 7:27 AM
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
I love the irony Tongue

Quote:
Basicly i think you should force the user to write in a good style.

You totally mis-spell "basically" and then go on to use "hole" instead of "whole"

Sly
Quote Reply
Re: [Paul] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
Not in perl they aren't ;)

$this->is_a_method
$this->is_a_method_too()

uh bad :) hey you HAVE to agree that this MUST be wrong - allowing both ways to do it? we're able to simply differ a class variable and method by looking if there are parantheses, but you have to ..?

Code:
print $var;
{
// things here in
}

uh - that's ugly :) what does the "{" stand for? basically they are a block wich should either be repeated (loops) or called by name (functions, methods). having a more straight defined ways to do something allows different behavior on little code change.

In Reply To:
I could show you 5 or more variations in perl but how about this (for shits and giggles)..

so are you proud of? ;)

PHP has less language to learn, wich is then more readable, easyer to learn, and easyer to write, as you have to learn less.

Wink
Quote Reply
Re: [Paul] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
Quote:
Basicly i think you should force the user to write in a good style.

You totally mis-spell "basically" and then go on to use "hole" instead of "whole".

*lol*. yeah, let's write german or even french Cool
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
Quote:
easyer to learn, and easyer to write, as you have to learn less.

It sounds like you just need/want something easy....so yes, I'd recommend php for you Wink

Perl is for big boys.
Quote Reply
Re: [Paul] Why dymanic pages as opposed to HTMl? In reply to
In Reply To:
Perl is for big boys.

You're not beein' logical Smile

the more complicated the language, the more your script will be buggy, hard to write, hard to read. you'll not be able to do write the most complicated thing with the most complicated language.

with less and clearer, more logical rules you're able to do more sophisticated. Citing' Eric Raymond if he maybe has more weight in his writings (as you sayd, my english sucks..):

Quote:
This kind of thing is called metaclass hacking and is generally considered fearsomely esoteric--deep black magic. Most object-oriented languages don't support it at all; in those that do (Perl being one), it tends to be a complicated and fragile undertaking. I had been impressed by Python's low coefficient of friction so far, but here was a real test. How hard would I have to wrestle with the language to get it to do this? I knew from previous experience that the bout was likely to be painful, even assuming I won, but I dived into the book and read up on Python's metaclass facilities. The resulting function is shown in Listing 3, and the code that calls it is in Listing 4.

Listing 3: http://www.linuxjournal.com/...ue73&file=3882l3

Listing 4: http://www.linuxjournal.com/...ue73&file=3882l4

That doesn't look too bad for deep black magic, does it? Thirty-two lines, counting comments. Just from knowing what I've said about the class structure, the calling code is even readable. But the size of this code isn't the real shocker. Brace yourself: this code only took me about ninety minutes to write--and it worked correctly the first time I ran it.
Quote Reply
Re: [raphb] Why dymanic pages as opposed to HTMl? In reply to
I think this debate is futile. Whether perl or php is easier to read/write is all subjective and based on personal opinion so a definitive answer will never be reached.
Quote Reply
Re: [joet] Why dymanic pages as opposed to HTMl? In reply to
You missed the whole point of what I was saying with the GT::WWW example. It had nothing to do with fetching a web page.

In Perl, I can get a single variable that can do this:

print "Var is: $var\n";
print "Var is: " . int($var) . "\n";
print "Var's method is: " . $var->method();

The output could be something along the lines of:

Var is: String
Var is: 27
Var's method is: Something else

PHP cannot do that, thus making things more complicated - as your example showed.

Also, with regards to $obj->method(); vs. $obj->method; - are you trying to tell me that leaving off the () make it uglier? Let's not change the subject: $obj->method; is less ugly than $obj->method(); So, therefore, here is at least one area where PHP is uglier than Perl.



Another thing, as you point out, is that PHP is much easier. So, people can churn out something that "works" with much less effort than they can with Perl - but they don't know how to code, so the code ends up being terribly ugly. Yes, there is ugly Perl out there, and yes, there is ugly PHP out there too. But when it is properly written, either language can be as ugly or pretty as you want to make it - ultimately it comes down to how much effort the user is putting into their code. PHP encourages less effort, which, I think, directly leads to ugliness.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com