Sign in to follow this  
Agreenknight

[web] PHP

Recommended Posts

I heard php is being phased out, atleast that's what the local russian computer genius who worked went to college for computer science said. Is this true? JUST WANTED TO GET SOMEONE ELSE's OPINION. He's proficient in Java, and visual basic so he says. He's from Russia, so things might be quite different there. That's where he got his college degree. He's going to go to school in a larger city but is going to need to retake some classes.

Share this post


Link to post
Share on other sites
Well, I can't say too much about PHP except for it's extremely ugly . Alternatives ? I'm using Spyce, a Python based server-side scripting language. It's just like PHP but instead of a crippled C++ syntax, it uses the Python language directly.
Waiting for 'D Server Pages' though...

Share this post


Link to post
Share on other sites
No PHP is not going away.
The guy just hates PHP so he is saying that.
Tell him that his crack smoking days should end.
P.S.
PHP is not ugly, you just do not know how to use it correctly.
Why else would so many users be coding in PHP if it was so bad (plus Free).
Python Server Pages (PSP) is just a java shell to make it seem cool. You might as well do .jsp in that case (Plus easy to be hacked).
If you are going to code code in .jsp .asp or .php
Perl is old school, but still very powerful as well.

Share this post


Link to post
Share on other sites
Even if PHP is phased out (which I'd not heard about) it's popularity alone would ensure it lived on for several years to come. I can't imagine the millions of websites and servers suddenly ditching it for the next best thing (ASP.NET [grin]).

Besides, because PHP is open-sourced it would still live on in new incarnations even if the official PHP development group disbanded.

Share this post


Link to post
Share on other sites
<flame>

Quote:
Original post by microcyb
P.S.
PHP is not ugly, you just do not know how to use it correctly.
Why else would so many users be coding in PHP if it was so bad (plus Free).
Python Server Pages (PSP) is just a java shell to make it seem cool. You might as well do .jsp in that case (Plus easy to be hacked).
If you are going to code code in .jsp .asp or .php
Perl is old school, but still very powerful as well.


LOL... I don't know how to use it correctly. I know how to. But could you please tell me what for it has all that damn dollar signs ll over the place, why it uses -> as the member getter and why does it use a dot as its string concatenation operator. To confuse everyone who's trying to learn it and assumes it has C++ syntax. I knew a guy who's been playing around with PHP with some time and claimed, heh, was almost ready to kill me, claiming that the . is the same as -> in PHP... He was just wondering why his scripts wouldn't work. Not a nice approach for language learners.

Sorry, but I don't understand your rant about PSP and I don't know what does it have to do with Java. I never said I'm using PSP, so don't assume that all Python server-side scripting has to be done with PSP.

Anyway, DSP's gonna rock the place :>

</flame>


edit:
Quote:
Why else would so many users be coding in PHP if it was so bad (plus Free).


Because PHP is an established technology that has lots of documents about and lots of libraries made for (Python has more). Also, at the time when PHP emerged, there was no real alternative to it. Now there are, yet if everyone keeps saying 'PHP r0xxxx0rz', newbs will try to learn it to be on top / keep up with the others. But seriously, anyone who's ever done any real world coding in a language that's got syntax better than C++ will seek something other than PHP.

Share this post


Link to post
Share on other sites
Really, is that why you think PHP is ugly? Because you don't like the symbols they use for the syntax? :P

Hardly worth making a fuss of, is it?
No doubt, PHP isn't a particularly pretty language, but that's not because they use $'s in variable names. (Why is that so ugly anyway? It just makes it easier for you to see what's a variable and what's not)

There are plenty of alternatives though, so just use whatever you like. But PHP is hugely popular, so it's not going away any time soon.

Share this post


Link to post
Share on other sites
hmmm... enough if I say I'm a freak of nice syntax and doing that shift + 4 all the time drives me nuts. How about default behaviour for copy on assignment.
PHP has it's glitches that require a huge book and I don't like using that kind of a language. What about the pseudocode:

func()
{
return (get data from mysql)
}

this kind of a function once did crap on me. yeah, literally. didn't return the values as expected, but when changed to:

func()
{
$local = get data from mysql
return $local
}

worked as expected. now, what's an understandible language ? (no, I can't reproduce it. It happened long time ago to me and I almost destroyed the floor with my jaw when I analyzed that)


anyway, I'm not gonna start a flamewar here. This is probably one of the things like "Delphi sux" vs "C++ sux", etc. Just a matter of an opinion. I'm happy with a nice alternative to PHP and I know I could have done the same with PHP but an order of magnitude slower.

Agreenknight wanted someone else's opinion. Now he's got a very controversial one <g>

[Edited by - h3r3tic on September 20, 2004 6:22:47 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by microcyb
Python Server Pages (PSP) is just a java shell to make it seem cool. You might as well do .jsp in that case (Plus easy to be hacked).


You were doing so well until that point. PSP is nothing to do with Java. If anything it's closer to ASP.

Share this post


Link to post
Share on other sites
Php is a wonderful language for web development. It is very usable, and that is what makes it good. It is fast, and easy/rapid to develop in. It is not a C++ clone. It shares some familiar syntax and concepts, but it is it's own language. Java and C++ share many familiar functions and syntax, but they are obviously not the same language. Similarly you wouldn't say japanese and chinese are the same language even though share many words.

PHP will be around for awhile. With the recent release of PHP5 is another step in the right direction. It improves the weaknesses it had with OO development. PHP won't go away any time soon. You can't find a web host that doesn't support PHP; that is why people use it. Another reason is the wealth of open source libraries that are available. PEAR provides a lot of great extentions that are priceless. The DB abstraction layer is programmers gold. The smarty template engine is another great library.

As someone had mentioned earlier, the documentation sets the standard. Usually the biggest downfall with open source projects is the lack of documentation. The manual at PHP.net has everything you'll need. Very straight forward approach, with lots of user follow ups that close even the narrow gaps.

Like any language, you need to use it and really get to know it before you can learn to love it or hate it.

I hope this doesn't sound fanboyish, because that is not the case. I don't believe any one programming language is the be all end all. But I do feel that anyone who is truely interested in web development should at least become familiar with PHP. It is a strong leader in web development, and you would be doing yourself a favor in the long run because there is so much to learn from it right now.

Share this post


Link to post
Share on other sites
Quote:
Original post by h3r3tic
<flame>
LOL... I don't know how to use it correctly. I know how to. But could you please tell me what for it has all that damn dollar signs ll over the place,


Firstly, there are advantages to prefixing all variables, such as with the $ sign in PHP (and PERL). It allows you to easily interpolate variables in strings, instead of having to use incredibly frustrating syntax, such as this:


Response.Write "something" + str + "something else" + str2 + ""


Secondly, being able to use a variable's name as the basis for another variable, is kinda cool, albeit sometimes confusing. The point is, there are no ambiguities when prefixing variables.

Quote:

why it uses -> as the member getter


A lot of people prefer using the arrow operator, when accessing members of objects; somehow, it feels more intuitive. I much prefer that to object.member.

Quote:

and why does it use a dot as its string concatenation operator.


Next, again, I think the .= operator for concatentation, is a good idea. There are no ambiguities.

For example, arguably, most people that learn PHP, haven't really had very much programming experience, so they don't know that += is universally accepted to mean string concatenation and addition assignment. Whilst it is fairly trivial to grasp, having two separate operators, prevents that from being a problem in the first place.

Plus, consider the following:


$var += $var2;


I've deliberately used the += operator here. Imagine if PHP used += for addition assignment, and, concatenation. Wouldn't that statement look ambigious to you? Not everyone names their variables with such strong naming conventions as found in C and C++. In fact, I find that web developers' code, tends to be the hardest to follow in terms of naming conventions. Having .=, eliminates the problem that I've just illustrated.


$var .= $var2;


You instantly know that a concatenation is supposed to take place.

Quote:

To confuse everyone who's trying to learn it and assumes it has C++ syntax.


PHP is a C and PERL hybrid. It has nothing to do with C++. OO in PHP, was actually a last minute addition, which is why there are some problems with it (strange constructor uses, for example).

Quote:

I knew a guy who's been playing around with PHP with some time and claimed, heh, was almost ready to kill me, claiming that the . is the same as -> in PHP... He was just wondering why his scripts wouldn't work. Not a nice approach for language learners.


If your friend decided he knew what the operator did, then perhaps he should have paid more attention to the PHP manual. Never assume something you do not know.

Share this post


Link to post
Share on other sites
it's funny how one can get rated down on the forum for expressing their opinions that are not in par with general standards. so if everyone likes carrots and one says "I dont like carrots", that person is a public enemy. lol

Share this post


Link to post
Share on other sites
Hmm, + isn't "universally accepted" as string concatenation, is it? Only language I can think of which uses it, is Java. (And C++'s String class, but thats only due to operator overloading). It's pretty common to use other symbols too. Why? Because some languages prefer to use + for addition, and nothing else, to avoid confusion.

In any case, in a weakly typed language like PHP, using + would mean big trouble. In PHP, "12hello" + "34world" == "12" + "34" == 12 + 34 == 46. Very useful for web development, as you frequently get some input that could be any type. From an url, a form the user submitted, or even from a database. And so, being able to perform basic math operations on strings can be very useful. Instead, you have to use something different for different operations, like concatenation.

Especially for web designers who don't actually know much programming. The syntax in PHP isn't bad. It's not C++, thats true, and you shouldn't assume that because some of it looks like C++, it's all the same. But the same is true for Java and C++. Or for C and C++. The syntax in PHP does the job. It makes it very clear what's concatenation and what's addition. You can easily see what's variables and what's constants or other language constructs. Actually, I'm inclined to say that in this respect, PHP is a much prettier language than many others. You don't need syntax highlighting in PHP to see that $i is a variable.

And h3r3tic, because you once found a bug doesn't mean the language sucks. I don't know if you've noticed, but they're still updating PHP. If you can't reproduce it, then odds are you actually messed up your code somehow. However, *if* you found a bug in PHP, I'll bet you a lot of money that it's fixed now.

Visual Studio 6 had a pretty big bug in their C++ compiler as well (with the variable scope in for loops), but that doesn't mean C++ sucks, does it?

Don't get me wrong, I can think of plenty of bad things to say about PHP, but the fact that it uses $ for variables and . for concatenation isn't among them. If anything, thats one of its better sides.

H3r3tic, I haven't rated you down, but if you look at the descriptions on the rating page, it says that if you think someone are unhelpful and/or unfriendly, they should be rated down.

However, saying that a language plain sucks because it uses some slightly different symbols than your favorite language *is* pretty unhelpful. The overall structure of PHP is not very different from, say, C++ or Java. True, for accessing member variables, Java always uses ->, C++ uses -> and . and PHP uses -> . But the structure is *exactly* the same.
True, a C++ variable can be called 'i' while a PHP variable can be called '$i'. But you use them in the exact same way. $i++ in PHP means exactly the same as i++ in C++, and can be used in the same situations.

If you actually commented on the overall structure or functionality of the language, on something that *mattered* when using PHP, then it would be helpful. But saying "I think + looks better than . and $'s sucks" isn't.

As for the unfriendly part, look at your last post. You're accusing us all of thinking you're a "public enemy"? You're accusing us for rating you down purely based on your personal opinions?
Whether or not it's true, it still doesn't make you look any friendlier.

Share this post


Link to post
Share on other sites
Quote:
Original post by Spoonster
Hmm, + isn't "universally accepted" as string concatenation, is it? Only language I can think of which uses it, is Java. (And C++'s String class, but thats only due to operator overloading). It's pretty common to use other symbols too. Why? Because some languages prefer to use + for addition, and nothing else, to avoid confusion.


I guess universally accepted was a little strong, but I have seen a number of languages adopt that syntax for string concatenation. I guess it's mainly strongly typed languages that adopt that approach, but you're right, perhaps universally accepted was a bit out of bounds.

Quote:

...snip...


In full agreement with everything there, too, Spoonster.

Quote:

And h3r3tic, because you once found a bug doesn't mean the language sucks. I don't know if you've noticed, but they're still updating PHP. If you can't reproduce it, then odds are you actually messed up your code somehow. However, *if* you found a bug in PHP, I'll bet you a lot of money that it's fixed now.


Ah yes, I was going to mention this. The thing to remember, h3r3tic, is that compared to a lot of languages, PHP is still relatively new. As a result of that, there are bound to be constant updates and bug fixes.

Quote:

Visual Studio 6 had a pretty big bug in their C++ compiler as well (with the variable scope in for loops), but that doesn't mean C++ sucks, does it?


Again, in full agreement with this statement. There was also a problem with setting flags for streams in the C++ library (can't remember what the exact problem was; something to do with output in hex or oct), but the point is, bugs will occur. The only difference, is that C/C++ aren't new languages. They've had their bugs worked out of them. Sure, there might be some left, or new standards revisions might introduce new ones, but that's part of the development cycle.

Share this post


Link to post
Share on other sites
"12" + "34" == 12 + 34 == 46

why ? how about doing int("12") like in Python for instance ? Doing things like this implicit may be dangerous.


"hello" ~ "world";

how about this ? that ~ symbol even looks like concatenating sth ( can't you hear it making a bzzzz sound ;] )


yeah, maybe I've only found a bug. But for beginning PHP learning this means "OMG, WTF, is tath weeroeng or is my meind sick"

Quote:

Visual Studio 6 had a pretty big bug in their C++ compiler as well (with the variable scope in for loops), but that doesn't mean C++ sucks, does it?


do you mean

for (int i = 0; i < 10; ++i) {}
for (i = 0; i < 10; ++i) {}

?

I don't think it was a bug. rather an old standard.



Quote:

You don't need syntax highlighting in PHP to see that $i is a variable.


you don't need syntax highlighting to see that a$ in basic is a string. but what for ? as a programmer one should understand his code. that's why hungarian notation isn't used everywhere

Quote:
Especially for web designers who don't actually know much programming

Ermmmmm... do non-programmers program in PHP o_0 ???

Share this post


Link to post
Share on other sites
Oh and to the OP, no, PHP certainly isn't being phased out. I think Microsoft would like that to happen, so that ASP.NET had a larger foothold in the market, and that probably is their aim, but I strongly doubt that the PHP authors' are laying it to waste. Even if they were, as already stated, someone from the community would pick it up and carry the torch.

Looking at the PHP website, a new version was released just over a month ago. The site is always constantly being updated and that's not the mark of something that's being phased out.

Share this post


Link to post
Share on other sites
Quote:

As for the unfriendly part, look at your last post. You're accusing us all of thinking you're a "public enemy"? You're accusing us for rating you down purely based on your personal opinions?
Whether or not it's true, it still doesn't make you look any friendlier.


nope, but

if (postingControversialStuff) useTheAnonymousAccount();

Share this post


Link to post
Share on other sites
PHP does do some odd things, and some of the functions are just plain weird (has anyone got an explanation for the argument order in mktime? Why month-day-year instead of day-month-year? Why hour-minute-second (OK, so that's the order they usually appear in)?). Anyway. It's OK once you get used to it, I guess. Using . as a string concatenator is not too weird - I'm more used to using &, admittedly (having come the Visual Basic way), but you soon get used to it.

Share this post


Link to post
Share on other sites
Quote:
Original post by h3r3tic
yeah, maybe I've only found a bug. But for beginning PHP learning this means "OMG, WTF, is tath weeroeng or is my meind sick"


Actually, it's more along the lines of not reading the manual properly. The PHP documentation is very good. So good, that you don't specifically need to buy any PHP-related book, in order to the learn the language to a high level.

Quote:

Ermmmmm... do non-programmers program in PHP o_0 ???


Non-programmers program in every language. Everyone has to learn to code somewhere. You can't learn to ride a bike just by looking at it. PHP is very popular because it is easily to learn, and as I and Spoonster have stated, it is a clear language.

I actually taught PHP to two guys fresh out of school, at work. For two people who had IT backgrounds, but no programming knowledge whatsoever, they were able to pick it up quite quickly, which is essential in a training environment.

Share this post


Link to post
Share on other sites
if PHP is so easy to learn and so clear then why am I getting negative comments about it in the environment around me all the time ? Am I doomed ?
Nope. PHP is easy to learn as for a web scripting language. But seriously, has anyone who claims that PHP is so easy and fun ever looked at alternatives other than JSP or ASP ? Because there may be languages that are EVEN EASIER TO LEARN. And compared to them, lets say it silently now 'php MAY suck'. but only compared to them. for sb who has never known any better alternative it may be the best language ever. just like what i thought C++ was. and many other ppl as well. read some interviews with Bruce Eckel, a C++ advocate, who's finally also noticed that not everything is so beautiful in thal lauguages.
There are alternatives. But hmm, for now, no, PHP is not being phased out and I don't expect it to be only because there are so many ppl claiming for it to be so good.

Share this post


Link to post
Share on other sites
Quote:
Original post by h3r3tic
if PHP is so easy to learn and so clear then why am I getting negative comments about it in the environment around me all the time ? Am I doomed ?
Nope. PHP is easy to learn as for a web scripting language. But seriously, has anyone who claims that PHP is so easy and fun ever looked at alternatives other than JSP or ASP ? Because there may be languages that are EVEN EASIER TO LEARN. And compared to them, lets say it silently now 'php MAY suck'. but only compared to them. for sb who has never known any better alternative it may be the best language ever. just like what i thought C++ was. and many other ppl as well. read some interviews with Bruce Eckel, a C++ advocate, who's finally also noticed that not everything is so beautiful in thal lauguages.
There are alternatives. But hmm, for now, no, PHP is not being phased out and I don't expect it to be only because there are so many ppl claiming for it to be so good.


Yes, I have looked at, and used, alternatives. I was a lead web developer for over 3 years, at which I had to use a great deal of different technologies; PHP included.

You're gettnig negative comments about PHP for several reasons:

1. Some people are elitist, and would simply tell you another language "sucks", just because they use something different.
2. Not everyone advocates the use of open source in commercial projects.
3. They don't like the fact that at first glance, the syntax is similar to PERL, which is renowned for obfuscated scripts.

There is a quote that goes along the lines of, "PERL is the only language that looks the same, before and after, RSA encryption.".

4. They don't see the point in learning a language, such as PHP, when they've already been trained to use ASP.NET, which might have been quite expensive.

5. They base their opinions of PHP, on products such as PHPNuke - renowned for their security problems, and attribute that to problems with the language itself.

Every language has pros and cons, and PHP is no different in that respect. If someone gives you a hugely negative view on any language, it's most likely because they've never used it to a large extent, or for the proper reasons.

Share this post


Link to post
Share on other sites
Quote:
Original post by h3r3tic
"12" + "34" == 12 + 34 == 46

why ? how about doing int("12") like in Python for instance ? Doing things like this implicit may be dangerous.

And using + for implicit concatenation isn't? :D
The former makes some sense for web development, as I described in my previous post. It can be useful because web development is generally not exactly strongly typed. :)
But you're right, it can be dangerous.

Quote:
"hello" ~ "world";

*shrug* if you like. Personally, I don't see the big difference. You could use ¤ if you liked, and it still wouldn't actually change the language.

Quote:

yeah, maybe I've only found a bug. But for beginning PHP learning this means "OMG, WTF, is tath weeroeng or is my meind sick"

So far, you're the only one I've heard of who's run into problems like that. Beginners tends to run into plenty of problems, but most of them are with their own code. Anyway, that bug (if it was a bug in PHP, and not your code) is fixed now, so who cares?

Quote:

do you mean

for (int i = 0; i < 10; ++i) {}
for (i = 0; i < 10; ++i) {}

?

I don't think it was a bug. rather an old standard.

Nope, it was a bug. Nothing more, nothing less.


Quote:

you don't need syntax highlighting to see that a$ in basic is a string. but what for ? as a programmer one should understand his code. that's why hungarian notation isn't used everywhere

You can't expect web designers to be programmers. Apart from that, I don't see a problem in giving even programmers a hint. What if the programmer is looking at the code he wrote 2 years ago? And even if he does remember which are variables and which aren't, I still don't see the harm in the $'s.

Quote:
Especially for web designers who don't actually know much programming

Ermmmmm... do non-programmers program in PHP o_0 ???[/quote]
Yes, they do. Welcome to the real world. Most webdesigners use PHP, and no, they can't actually program. They can get by in PHP, but they're not programmers, and they'll be completely lost if they have to make anything bigger than a website.

And there's no doubt that PHP has plenty of disadvantages and downsides. I never denied that. I think I even said that in my previous posts, so no need to get sarcastic about that, h3r3tic. That's just asking to be rated down.

PHP has plenty of nasty problems. In PHP4, the OO part was a mess (Haven't played much with PHP5). Much of the API is bloated beyond belief. It can be very tricky to set up. Like all interpreted languages it's slow. There are some odd things in the syntax, and yes, in many ways it is very messy. But none of these things have anything to do with whether you use $'s to denote variables, or whether @, ^, + or . is used for string concatenation (Yeah, I've seen them all used in various languages)

But it doesn't suck. It's very easy to learn (And yes, I have looked at alternatives, and if you don't have any programming experience, PHP is very simple to get into. Alternatives that use an existing language are obviously easier for programmers who already know the language, but that doesn't make them easier to get into for a beginner). It does the job it was designed for very well.

It definitely doesn't suck, and true, it's also far from perfect. No need to get upset about that

Edit:
Quote:

If someone gives you a hugely negative view on any language, it's most likely because they've never used it to a large extent, or for the proper reasons.

True, but that also applies if someone gives you a hugely positive view on any languages. Most likely, they have too little experience with alternatives... :)

Share this post


Link to post
Share on other sites
PHP5's new object oriented support is pretty good.

You can now define members as private/public/protected. You can create static members as well as abstract methods/classes.
Constructors and Destructors. It's very comprehensive now, definately worth checking out.

Though, since it isn't a typed language dynamic binding is weak at best. You can use a case statement and instance of; but that can get sloppy real quick.

When people see a weakness in a language, more often than not, it's weakness in the programmer. We tend to try and do stuff the way we previously learned it. Each language has different designs concepts that are more then likely in place for a reason. They might be different than what we are used to but that doesn't mean it's any worse. You have to be able to open your mind and embrace a new style sometimes.

Share this post


Link to post
Share on other sites
Quote:

Visual Studio 6 had a pretty big bug in their C++ compiler as well (with the variable scope in for loops), but that doesn't mean C++ sucks, does it?


Ok maybe you're right, but I haven't ever stumbled upon that bug in MSVC6 SP2 though I have coded lots of stuff in it. Apart from that, I don't like the compiler in MSVC6, MinGW produces faster code anyway.

<unfriendly disclaimer="Read for your own responsibility" nooffense="nooffense">

Quote:

(...)
You can't expect web designers to be programmers.
(...)


Well, from this standpoint I don't care about web developers because I am a programmer. This was not a rant about which language is the best for the majority of the world, the holy grail of web development. No, I gave you my personal opinion (that I was asked for) about the tools I AND NOBODY ELSE am willing to use. I can be far more productive with my tools than with PHP. If you prefer your tools, keep using them, I'm not converting anyone.

</unfriendly>

Maybe now there aren't (m)any viable alternatives for PHP for the majority of ppl, but... I'll be back soon !!! mwuahahhahahha
And, with this optimistic sentence, I'm finishing my war.

EOF

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this