RE: Text Adventure Resources, PHP4 Criticism (Was: Is there a program that will let me create text adventures?)

  • From: "Sina Bahram" <sbahram@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 17 Sep 2007 16:01:59 -0400

Php is rather well documented, and not just in .chm format.

You can go to php.net followed by any name of a function, such as

http://php.net/strlen


Or, if you want a general topic, just type that, like for MySQL:

http://php.net/


I'm sure it would be trivial to integrate this into at least one of what
seems like the hundreds of text editors that go across this list.

Furthermore, it's incorrect to say a language's documentation is bad when a
particular editor doesn't happen to support it. Those two statements are
unrelated, as far as I'm concerned.

Take care,
Sina 

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Octavian Rasnita
Sent: Monday, September 17, 2007 3:43 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: Text Adventure Resources, PHP4 Criticism (Was: Is there a
program that will let me create text adventures?)

Well, I don't think PHP has a lower security than perl (if the programmer
knows what he does, of course).

I found that PHP's syntax is very closed to perl's syntax, but it is just
much less developed than perl's.

For example, you could include an array element or a hash element in a
quoted string without needing to use additional params for letting the
language know that it is a separate element that should be replaced with its
value.

Then in very many fields perl is better not because of the core language,
but because there are much developed modules. And I am thinking for example
to the list of frameworks that can be used in perl, the templating systems
and what they can do, the ORM libraries, and other things. I am also
thinking that perl can be used to create programs with a graphical interface
usable on Windows or portable on more operating systems, using Win32::GUI,
Tk, GTK, WXPerl...

Perl also has disadvantages. For example, the perl programmers tend to not
care about other languages and the libraries they use if what they do can be
done better in perl in another way.
And this is a disadvantage, because some of those libraries could be used
for interaction between programs made in different languages or platforms.
Perl can use SOAP, but the XML used by its SOAP is not fully compatible with
the one used by .net or Java. Most perl programmers don't care about this,
because they say that there are other protocols of communication much better
than SOAP, and this might be true, but this is not important if all the
others got used to use SOAP.

On the other side, PHP copies everything it can from all the languages
including perl and offer those facilities as built in functions and it tries
to follow more closely the "fashion" of the web.

PHP is much better than perl for creating small web sites, because it is
easier to do it in PHP than in perl, however for bigger web sites, that kind
of web sites that are ran by the system administrator, not on a shared web
host, perl is better. However, of course, there are much more small web
sites that just require PHP, Apache and MySQL.

Regarding the documentation, I think PHP has a horrible documentation
comparing it with perl's one.

If I don't know how to use a certain function or method from a perl module
or a built in function, I just need to press Control+Shift+E in TextPad,
type the function or module name and press enter, and the documentation for
that module or function is printed in a newly created window, and I can read
it just like any other text.
And then I can read that is that module used for, which are all the method
names from it, which are their syntax, but *with examples always* and I can
even copy and paste some lines of code from there for using them in the
program.

PHP has a nice CHM and I like that format, but it displays a huge number of
types of functions, then another huge list of functions for each type, and
it takes a long time to find what I want even if I search the CHM. But this
is not the most important thing. What I don't like is the fact that PHP
doesn't give examples, but gives a technical general example, using for
example [ and ] for including the optional parameters and it is very hard to
follow if there are more optional parts and especially in cases when if an
optional parameter is used, another should be also used...
Perl's documentation gives an example for each possible situation, showing
how to access the function without parameters, with only one, with 2, with 3
and so on, or if there are more, it gives only some examples then describe
in detail in below.

Perl has a stronger support for Unicode (even some libraries like Win32::GUI
don't support Unicode at all).

The advantage of PHP is that all the modules are compiled, and the admin
doesn't need to compile the modules in C on the local machine in order to be
able to use them, so the admin doesn't need to be the system administrator. 
Well, of course perl can be installed by another simple user than root, then
compile and install anything he wants, but it is still more complicated to
do that than just using the language.
The advantage of perl is that it is more flexible, and if the programmer
knows what he does, he could install other external libraries and perl
modules that work with them, and can do much more things than a PHP
programmer can do with PHP.

So none of them is "better" than the other. Each one is best for some
things.

Octavian

----- Original Message -----
From: "Marlon Brandão de Sousa" <splyt.lists@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Monday, September 17, 2007 7:25 PM
Subject: Re: Text Adventure Resources, PHP4 Criticism (Was: Is there a
program that will let me create text adventures?)


Helo,
I read this thread now and do understand your points in telling php is a
little bad thought out. I have to say you that php 5 is better.
I personally don't like perl sintax style and, if there is a library that
will require me to turn on safety critical stuff, I won't use them. Although
I can understand your points, I also agree that I won't use the bad things
of the language. So I don't think that php is this bad, although it has its
weaknesses like any other language. I like the php documentation and the way
php comunities behave when a new programmer needs help.
Also I found the errors pretty clear to understand and fix.
Marlon

2007/9/17, Veli-Pekka Tätilä <vtatila@xxxxxxxxxxxxxxxxxxxx>:
> Hi alex,
> For text adventures, there are frameworks, class libraries and parsers 
> that are hard to beat. Inform the bytecode of whose Infocom used in 
> their Zork adventures, among others:
>
> http://www.inform-fiction.org/I7/Welcome.html
>
> Tads 3 is more object-oriented and advanced:
>
> http://www.tads.org/tads3.htm
>
> If you don't like writing code some good adventures have also been 
> created using Adrift:
>
> http://www.adrift.org.uk/cgi/new/adrift.cgi
>
> For what has been done with these tools try:
>
> www.ifarchive.org
>
> and
>
> http://www.sparkynet.com/spag/
>
> For quirky game ideas and a whole lot of links go here:
>
> http://emshort.wordpress.com/reading-if/
>
> I wouldn't necessarily use PHP for Webby adventure development unless 
> you already know that. I've never personally liked the language for 
> many many reasons and writing a parser from scratch is basically 
> wasted effort unless you count learning and the fun of coding 
> something from scratch.
>
> Here's what I hate in PHP:
>
> * Overly friendly but inexact docs, that is behavior in error 
> conditions not well specified and tone not K&R:ishly formal even if it 
> would be beneficial.
>
> * OOP system is very weak in PHP 4, and not extendably minimalist as 
> in Perl 5, for instance.
>
> * Only one aggregate data type that blends hash and array access. Hard 
> to tell whether it only contains ints and it seems both the advantages 
> of hashes and arrays are lost. You cannot index non-integer types 
> quite as fast as pointer arithmetic yet the PHP arrays are ordered and 
> hash-like, despite a hashtable being inherently unordered. That's just 
> strange, conceptually, and probably not very efficient.
>
> * Syntax is C-like, reference semantics have not been well specified 
> or at least I've never understood them, and the compiler errors often 
> sound like they're straiht from some automatic tools . That is, full 
> of obscure symbols.
>
> * Bloated class library at least in php4. There's redundant 
> convenience in places, without the facilities to generalize using 
> callbacks or extra args, and naming is a horible jumble borrowing from 
> which ever language the function in question has been lifted.
>
> * PHP doesn't have a good track record in security despite nifty hacks 
> like magic quotes. One bad thing is autovivifying variables based on 
> URl parameters, if I may use the Perl lingo here. That can cause quite 
> bad security issues, if I've understood things correctly, but some PHP 
> libs require that the feature is on.
>
> What are the advantages, really, apart from some nifty CGI 
> functionality, and easy initial configuration? It seems to be there's 
> nothing special or really interesting in PHP as a programming language.
> NOt that such a language could not be nice for Webby stuff given good 
> libs, though.
>
> Note that I have only used PHP4 in a project which tried extending the 
> OS Commerce platform for a client's needs. So PHP 5 might be much 
> better and as with Perl, if you are a good coder, you don't do the 
> things that are evil, admitted.
>
> Still I thought I'd mention the gripes I have with the lang to 
> generate some discussions for workarounds, clarification and the 
> merits of PHP for new users. Feel free to move this to a separate thread.
>
> --
> With kind regards Veli-Pekka Tätilä (vtatila@xxxxxxxxxxxxxxxxxxxx) 
> Accessibility, game music, synthesizers and programming:
> http://www.student.oulu.fi/~vtatila
>
> alex wrote:
> > Well i was just wondering if there was a program that will let me 
> > create text adventures? Or is there one for MUDS? (rpgs)?
> __________
> View the list's information and change your settings at 
> //www.freelists.org/list/programmingblind
>
>


--
When you say "I wrote a program that crashed Windows," people just stare at
you blankly and say "Hey, I got those with the system, for free."
Linus Torvalds
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: