Note that _ denotes cursor.
Code completion at this point should return all members of the "User" class, but we get nothing!
It should provide a list of Zend_Log members, but... nothing! So... it's not about dynamic typing vs static typing. It's more about type safety but maybe more accurately type awareness or simply type information. The above probably also holds true with Ruby on Rails. (and it's probably the fault of Rails' super-flexible-dynamic design by nature)
But very rarely heard in Java :
You get full code completion above. And even at times when you get a dumb Object, you can always typecast to the type you know you want.
#1
$user = Doctrine_Core::getTable('User')->find(1); $user->_
#2
$logger = Zend_Registry::get('Zend_Log'); $logger->_
Compare Cases with Type Information (or sometimes, Type Inference)
But very rarely heard in Java :
@Inject EntityManager em; ... em->_
You get full code completion above. And even at times when you get a dumb Object, you can always typecast to the type you know you want.
No comments:
Post a Comment