The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Actually, it is a real question. I wish Ruby could make a cup of coffee. The VM isn't there yet, still too slow and too big for embedding in a coffee machine. I think someone did get it running on a PDA though, which is heading in the right direction.

Douglas

If ya want coffee then Sun Java has lots of pretty coffee mugs :P Sure enough, you could even use Java for real coffee machine. Of course it would need to be powered by a Quad processor SPARC server. Which I guess ain't too bad if you're a multi billion dollar corporation with shed loads of cash to throw away.

Returning back to namespaces, I agree with Marcus, I don't understand the point of the private class cack, it's much like the final keyword, it's totally evil and no one has any use for it in PHP anyway

If ya want coffee then Sun Java has lots of pretty coffee mugs :P Sure enough, you could even use Java for real coffee machine. Of course it would need to be powered by a Quad processor SPARC server. Which I guess ain't too bad if you're a multi billion dollar corporation with shed loads of cash to throw away.

I see you developed some kind of Ruby sindrome were you bash Java with every opportunity. The problem is you ussually don't know what you are talking about (joke or not). And I have to defend it because I love it.

For raw performance take a look here: http://www.bytonic.de/html/benchmarks.html
I couldn't find a recent benchmark, but a good example is always http://www.walmart.com/ which handles according to them 7 million sessions and 106 million page views per day and it is based on Tomcat and Apache (no fancy websphere or weblogic or jboss).

Next time please provide some real arguments to support your claim.

Ruby doesn't even compile to bytecode (at least Python does, and PHP does too with some help). So you can't expect features like just in time compiling or a HotSpot compiler pretty soon.

For a start, why does everything need strict static typing in a bytecode / "scripting"

Sometimes i find static typing very useful when reading someone else's code.
I'm currently studying Hibernate code(i think it's a glory of OOP) and this Java verbosity helps to understand its internals much better.

I really miss static typing in PHP, especially when i need to make some major refactoring(e.g changing method signature, etc) which spans many files. All modern editors simplify some tedious refactoring analyzing the code and using static types as helpers, i wonder if PHP type hinting would allow that.

In the first example, it still has the types, it is just dynamic (ie. automatic type casting). Hence, what BerislavLopac said can apply to that statement (although, I would agree with you and say that PHP is not a strongly-typed language). As for the second example, well, I agree.

In the first example, it still has the types, it is just dynamic (ie. automatic type casting). Hence, what BerislavLopac said can apply to that statement (although, I would agree with you and say that PHP is a strongly-typed language). As for the second example, well, I agree.

The first example is actually the most important one. Quote from the Wikipedia link BerislavLopac gave:

"A language is strongly typed if conversions between different types are forbidden. If such conversions are allowed, it is weakly typed."

I spent a few weeks . . . trying to sort out the terminology of "strongly typed," "statically typed," "safe," etc., and found it amazingly difficult. . . . The usage of these terms is so various as to render them almost useless.

bonefry, I admit that I have fallen into the same trap you seem to and believed that the way I use those terms are the en-all and be-all definitions. But, like so many things in software industry, same things mean different things to different people. I have accepted a certain terminology and yes, it would be nice if everyone would agree with me, but I have to accept the fact that they don't.

Weakly typed (or "untyped"): when a language stores the values without caring about types (e.g. all values are strings); each operation must internally resolve the implicit type to work with a variable (examples: TCL, Net.Data).

Statically typed: when a type is bound to the variable as well as to its value. (examples: Java, C).

Dynamically typed: when a type is bound to values only, and the actual type required for an operation is determined and the value is dynamically converted to it (examples: PHP, Python).

Yes, but that does not mean they don't matter.
Because in Python 12 + "24" isn't allowed. Also in Python, you can't use a variable if it wasn't initialized.
And PHP is definitelly weak typed from all points if view if such term exists.

Not a powerful enough expression (and probably not even proper syntax) , but you get what I mean.

It would work if you have a single class in each file which doesn't reference any other classes. Say you have two classes which reference eachother, and you want to import them both under the same namespace, you'll have to update internal $foo = new Foo(); lines of code too. But can you assume that you can update all new Klass() lines?

A better fix would be to extend the extension so that this code works:

PHP Code:

namespace ns {
require('foo.php');
}
$foo = new ns:Foo();

I've not looked closely enough to see how that would work with the current code.