Which server-side programming language?

L

Leif K-Brooks

Hope this isn't off-topic for this group, but it is web-related.

I've been using PHP for a few years, but it's feeling more and more like
a dirty language to me. I've looked into JSP and Servlets, but
Java-style OO is annoying. Ruby looks interesting, but I'm not sure if
its library has enough web-related things to be very useful. What would
all of you reccomend?
 
D

Default User

Leif said:
Hope this isn't off-topic for this group, but it is web-related.

I've been using PHP for a few years, but it's feeling more and more like
a dirty language to me. I've looked into JSP and Servlets, but
Java-style OO is annoying. Ruby looks interesting, but I'm not sure if
its library has enough web-related things to be very useful. What would
all of you reccomend?

PHP. I'm not sure what "dirty" is supposed to mean. Do you have some
specific objections to it?




Brian Rodenborn
 
L

Leif K-Brooks

Default said:
PHP. I'm not sure what "dirty" is supposed to mean. Do you have some
specific objections to it?

Its lack of less-than-slightly-basic OO features, mostly.
 
D

Dylan Parry

Leif said:
Its lack of less-than-slightly-basic OO features, mostly.

PHP 5 (currently in beta) is much more advanced in terms of OO features.
I'd hold in there for a little while :eek:)
 
L

Leif K-Brooks

Dylan said:
PHP 5 (currently in beta) is much more advanced in terms of OO features.
I'd hold in there for a little while :eek:)

I know, but... it's hard to wait. Guess I should.
 
M

Marc Nadeau

Leif K-Brooks a écrit:
Hope this isn't off-topic for this group, but it is web-related.

I've been using PHP for a few years, but it's feeling more and more like
a dirty language to me. I've looked into JSP and Servlets, but
Java-style OO is annoying. Ruby looks interesting, but I'm not sure if
its library has enough web-related things to be very useful. What would
all of you reccomend?

perl

This one is powerfull and there is a lot of modules for it.
It is also usefull for system scripting.
 
L

Long

: Leif K-Brooks wrote:
:
: > Default User wrote:
: >> PHP. I'm not sure what "dirty" is supposed to mean. Do you have some
: >> specific objections to it?
: >
: > Its lack of less-than-slightly-basic OO features, mostly.
:
: PHP 5 (currently in beta) is much more advanced in terms of OO features.
: I'd hold in there for a little while :eek:)
:
While reading up on PHP, I came accross the section on persistent DB connection.

http://ca.php.net/manual/en/features.persistent-connections.php

It seems PHP will not scale well in a database intensive application. Does PHP 5
address this issue?

I have not gotten further in the docs, but how does PHP handle database rows?
Do I manipulate the db row directly? or can I map row attributes to a user defined
type?

Also, how does PHP manage user session data?

Long
 
L

Louis Somers

Hope this isn't off-topic for this group, but it is web-related.

I've been using PHP for a few years, but it's feeling more and more like
a dirty language to me. I've looked into JSP and Servlets, but
Java-style OO is annoying. Ruby looks interesting, but I'm not sure if
its library has enough web-related things to be very useful. What would
all of you reccomend?

Perl is the one I would go for if you want it to be a "script".

It's not my favorit though. I like Delphi (Object Pascal Language) better,
but most ISP's will not run a Delphi or Kylix cgi-program on their server.
With Delphi / Kylix you create compiled executables, so it's not a script.
 
L

Leif K-Brooks

Louis said:
It's not my favorit though. I like Delphi (Object Pascal Language) better,
but most ISP's will not run a Delphi or Kylix cgi-program on their server.
With Delphi / Kylix you create compiled executables, so it's not a script.

I'm on a dedicated server, so I can run pretty much whatever I want.
I've considered compiled CGI programs before, but I've always decided
against it, mostly because it wouldn't be very portable.
 
L

Louis Somers

PHP 5 (currently in beta) is much more advanced in terms of OO features.
I'd hold in there for a little while :eek:)

Ah at last. I really got frustrated last time I had to use php.

PHP vs Perl is a bit like Visual Basic vs C++. PHP is easy to learn and
there are huge resourced and librarys to make life easy. Great for
beginners.
 
T

Toby A Inkster

Leif said:
Its lack of less-than-slightly-basic OO features, mostly.

You can do some quite nice OO stuff in Perl.

Or alternatively, what's wrong with C++?
 
L

Louis Somers

I'm on a dedicated server, so I can run pretty much whatever I want.
I've considered compiled CGI programs before, but I've always decided
against it, mostly because it wouldn't be very portable.

Kylix compiles to Linux and Windows alike. Only it's not free like php or
perl. (it's free for personal use only).
 
D

Dylan Parry

Long said:
It seems PHP will not scale well in a database intensive application.
Does PHP 5 address this issue?

I honestly don't know about this, but I am sure that there will be some
info on the PHP website if they have addressed it.
I have not gotten further in the docs, but how does PHP handle database
rows? Do I manipulate the db row directly? or can I map row attributes
to a user defined type?

Assuming you are using a decent RDBMS then it "talks" to the database
using good old SQL.
Also, how does PHP manage user session data?

The same way that ASP et al. do - with sessions and cookies.
 
L

Long

: Long wrote:
:
: > It seems PHP will not scale well in a database intensive application.
: > Does PHP 5 address this issue?
:
: I honestly don't know about this, but I am sure that there will be some
: info on the PHP website if they have addressed it.
:
I hope you are right, but I doubt it. I don't think PHP is right for developing
serious web apps.

: > I have not gotten further in the docs, but how does PHP handle database
: > rows? Do I manipulate the db row directly? or can I map row attributes
: > to a user defined type?
:
: Assuming you are using a decent RDBMS then it "talks" to the database
: using good old SQL.
:
This seems painful, to have to hand-code SELECT, INSERT, UPDATE, DELETE
statements for database operations. Is there not a database mapping mechanism
that will help automate these operations in PHP?

: > Also, how does PHP manage user session data?
:
: The same way that ASP et al. do - with sessions and cookies.
:
Sure sessions and cookies are standard methods, but I was wondering if
PHP can store/manipulate complex structures with sessions and/or cookies.

Long
 
D

Dylan Parry

Long said:
: Assuming you are using a decent RDBMS then it "talks" to the database
: using good old SQL.
:
This seems painful, to have to hand-code SELECT, INSERT, UPDATE, DELETE
statements for database operations. Is there not a database mapping mechanism
that will help automate these operations in PHP?

Not painful at all, you don't have to actually hand code them as such -
you can have them dynamically generated, eg.

mysql_query("SELECT * FROM $table WHERE $col='$val'");

Of course you can use variables to replace any part of the string, not
just the parts I used above.
 
L

Long

: Long wrote:
:
: > : Assuming you are using a decent RDBMS then it "talks" to the database
: > : using good old SQL.
: > :
: > This seems painful, to have to hand-code SELECT, INSERT, UPDATE, DELETE
: > statements for database operations. Is there not a database mapping mechanism
: > that will help automate these operations in PHP?
:
: Not painful at all, you don't have to actually hand code them as such -
: you can have them dynamically generated, eg.
:
: mysql_query("SELECT * FROM $table WHERE $col='$val'");
:
: Of course you can use variables to replace any part of the string, not
: just the parts I used above.
:
This is exactly the low-level programming I want to avoid. You could Google
"database mapping" to find out more, but the idea is db mapping lets you
define the relationship between complex structures and db tables. It then
takes care of database operations by generating and executing the appropriate
SQL, upon request.

For example,
PersonThing.age = 10
PersonThing.persistToDb

The above psuedo code leave out a lot of detail, but the point is I am not
coding SQL, especially when a Domain Model contains many structures
needing database storage.

Long
 
L

Long

: Long wrote:
: > : >> ....
: >> Not painful at all, you don't have to actually hand code them as
: >> such - you can have them dynamically generated, eg.
: >>
: >> mysql_query("SELECT * FROM $table WHERE $col='$val'");
: >>
: >> Of course you can use variables to replace any part of the string,
: >> not just the parts I used above.
: >>
: > This is exactly the low-level programming I want to avoid.
:
: LOL: you're kidding - right?
:
Of course, since database mapping is non-existent in PHP (and in many other
programming languages as well), writing SQL spaghetti-code is the only way
many are accustomed to.

I will reconsider PHP, perhaps in version 10...

Long
 
L

Leif K-Brooks

Long said:
Of course, since database mapping is non-existent in PHP (and in many other
programming languages as well), writing SQL spaghetti-code is the only way
many are accustomed to.

Spaghetti code is bad because it's hard to maintain, not because it's
slow or insecure. Is this really so hard to maintain?

$result = mysql_query("SELECT username FROM users, $conn);
while ($row = mysql_fetch_array($result)) {
// Do something with the username
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top