What I stated about coercion in PHP is right. The program below will demonstrate
Code:
<?php
if ("0" == 0) print "string 0 equal to number 0\n";
if ("" == 0) print "empty string equal to 0\n";
if ("0" == "") print "string 0 equal to empty string\n";
?>
The automatic casting rules in PHP are hardly useful... The above example illustrates how PHP is inconsistent because it's type system does not follow the principles of "Deductive reasoning". When I used PHP at work, my exboss could never remember what would be true or false when using ==. I often myself used === to get round this. It is not designed to help developers at all. All it does it does allow new programmers get into bad habits in the way they expect data types to be handled because they don't understand the purpose of data types.
Coercion in a language should be consistent when used (i.e. follow some rules of deductive reasoning so it's easy to remember how things are cast) and it should be easy for a programmer to see where it happens. Well in my opinion that's show things should work, and most languages do follow that (Or at least give cast warnings, like C does)
It's nothing to do with me being efficient with development or not or not really when it comes to the framework issue. You look at most PHP frameworks out there, they really put a large overhead on the app. While frameworks are evil and stupid on small projects, when you start developing something of any size you need some sort of framework / archietecture. Just look at all the CMS's and portal systems PHP has... they are really bloated and slow.
The cowboy statement was meant in a joking tounge and cheek manner. I never came up with the statement, Lastcraft made that statement a while back when we were discussing some stupid PHP bug I found that the PHP developers were trying to avoid fixing.
The "enterprise" arguement is a stupid one. Most people who talk about "enterprise" software should be shot. Please *define clearly* what is and isn't enterprise software for me, and where the boundary lies?.... because I really don't know what this is.... as do most other people. The word "enterprise software" is one of these nasty slapstick terms given by business managers and software engineers.
If you have to use the term "enterprise", I can't say PHP has excelled in this area. It has taken a long time for PHP to be accepted by larger companies in a commercial context. Yahoo is one of the few exceptions. Yes, there are more larger sites using PHP, but that's only because it's getting old in terms of technology, and many of these sites are not large companies, but rather sites like sourceforce, ****, facebook etc. Ruby has been used in a wide range of larger scale commercial projects. You only need to look at http://www.ruby-lang.org/en/document...ccess-stories/ for a few examples. However Ruby suffers in the same way PHP did about 5 years ago because it's seen as a new player in the technology sector. Like I said, PHP is pretty bad in the enterprise sector, it's totally drafted by Java. Does this mean Java is a good language? No. It was good in the late 90's, much like PHP was good in about 5-6 years ago but times have changed, technology has evolved. Anyone could go one forever about the "enterprise" debate. I mean, people could argue LISP is no good for enterprise software because it's 40 years old... yet Paul Graham and Naughty Dog software (made crash bandicoot games etc) have been very sucessful as businesses all because they used LISP to give them a competitive edge.
The basic point with "enterprise software", is that in reality it doesn't matter what language you use, it's how you use it. Hell, there's loads of big companies like banks who still have huge amounts of their business based in nasty stuff like VB and COBOL (aka... Compiles Occaasionally Because Of Luck :P)
I'm not sure what you mean by your last point... relating to:
I'm not going to make out Ruby is flawless, it's not. It's slow as hell, and very unsupported in terms of hosting. However as a language it has a lot to offer for new programmers as it is clean, simple, consistent and allows you to program in a range of styles / paradigms.
I stated Ruby was a good starting language for learning, but has it's flaws, mainly in the relam of speed, commercial support and hosting. I can't tell if you are a agreeing with me there or not as you also said it's a good "concept" where developers can learn, but said "I'll do the opposite" (how is your point disgreeing with mine). I will argue that the speed is down to the implementation (at a C code / VM level, as opposed to a language design level).
Like I've said, I'm not totally sticking up for Ruby, I've clearly stated it's hosting and VM speed leaves a lot of room for improvement. However I don't see how people can stick up for PHP when it's such a poor language. I am not one of these people who believe that everything should be coding in language X, because languages are tools and you need the right tool for the right job. However some tools start to become obsolete after time (I mean, who uses flint these days when you have knives for cutting food). PHP is a tool that is started to show it's age in the same way that VB6, and COBOL have. (Does anyone know any COBOL programmers still???)
Bookmarks