Em 14/12/2011 22:25, Leif Biberg Kristensen escreveu:
Onsdag 14. desember 2011 22.21.04 skrev Chris Angelico :
The biggest problem with PHP, imho, is actually that it's so easy to
use. Anyone can get a WYSIWYG editor, save as HTML, and have a web
page... and then all you need to do is rename it to ".php" and put
some special tags in it, and look! You have a dynamic web page and
it's so awesome! At least, it is until you try to go further, and you
start adding mess on top of mess on top of mess.
You can have the same with JSP (Java Server Pages). I really dislike it.
You will be most by using OOP, a good design and a real, planned
architecture.
In my opinion, that's a pretty elitistic view. Certainly, that's one way of
writing PHP, but it isn't the only one. Quite a few of us have started with
something like what you've outlined here, but have long ago moved on to more
maintainable coding practices.
The good thing about PHP is the low threshold, and you can start using it
doing exactly what you outlined in your first paragraph. But somebody coming to
PHP from any old procedural language, will soon find that PHP lends itself well
to building function upon function, until you can really write the code you
need to express anything you want.
There are a few more fundamental issues with the language, but mainly,
it gets the blame for myriad bad PHP programmers.
Yes there's a lot of bad programmers out there. Most of them code in Java or
Visual Basic.
Comments like these seems FUD for me. You can't judge people by the
language of choice, but by the bad programming habits (IT: I do program
in Java, as well in C, Cobol, Visual Basic, C#, few functional languages
and some scripting languages). I can see that most bad programmers use
VB or Java because these are the most used languages in the whole
world... But I believe that there are more bad Javascript programmers
(just check how many beauty-and-crap-never-work-as-planned-sites exists
all around the world), only Javascript is not counted as a real
programming language (who knows why?).
You will find bad programmers on any language, including some languages
that do not exists yet. Is the same if I say that bad DBA uses database
X instead PostgreSQL. This is not true, because we can have bad DBA
using PostgreSQL.
FUD apart, I would add that by using the Java Platform (not the language
- you can choose the language you want to use among hundreds JVM
options), you can leverage authorization and authentication to well
known and proven platform (and APIs) for user identification, that can
easily rely on Database of choice, LDAP, Kerberos, NT-Auth, Linux auth
among others (you can even extend and create a completely new one).
Once the user has been authenticated, you can easly use JAAS API to get
trusted user name (the one that has passed the authentication method of
choice) to leverage your decision on how to connect to database (either
by using generic database user, or by using set session authorization, etc).
If you write your own provider, you can customize the code in order to
have the database connection available directly by the custom JAAS
provider. So you will have the best of any world you judge better for
your needs.
Regards,
Edson.
I prefer Pike. It's designed for writing servers, performance is
pretty decent, it's a high level language, and it has great database
support (including Postgres-specific features, some of which are quite
handy).
I'd like to look at this Pike. I don't think that my Web host supports it, but
it might still be a fun experience.
regards, Leif
The Yggdrasil project:
http://code.google.com/p/yggdrasil-genealogy/
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general