[web] PHP

Started by
26 comments, last by OctDev 19 years, 6 months ago
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.
Advertisement
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 ???
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... :)
Let's not turn this into an anti-PHP (or anything else) thread, so be careful with the 'vs' flaming.

I've not used PHP extensively, how is the OOP support in PHP5? If anything, I can see it moving to be a lot more like ASP.NET than the traditional PHP.
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.
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
Quote:Original post by h3r3tic
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)


Yeah, that happenned to me once. I did:

func()
{
// some stuff
}

but that didn't work, so I had to change it to this instead

func()
{
// some different stuff
}

Confusing, huh?

Quote:original post by evolutional
I've not used PHP extensively, how is the OOP support in PHP5? If anything, I can see it moving to be a lot more like ASP.NET than the traditional PHP.


I can see it becoming a bit more like JSP rather than ASP.Net. The object model in PHP5 is pretty much Java's. The Zend people are really working on Java interoperability too. I think one of their goals is to be able to be able to use PHP as a replacement for JSP, even when using a J2EE backend.

Which is nice :)
[teamonkey] [blog] [tinyminions]
Quote:Original post by teamonkey

I can see it becoming a bit more like JSP rather than ASP.Net. The object model in PHP5 is pretty much Java's. The Zend people are really working on Java interoperability too. I think one of their goals is to be able to be able to use PHP as a replacement for JSP, even when using a J2EE backend.


Sounds like it's time I polish up my PHP skills and move into version 5. Always good to be future ready.
I would highly recommend Advanced PHP Programming if you have some background but want to brush up on more advanced topics as well as PHP 5.
The Tyr project is here.

This topic is closed to new replies.

Advertisement