VS.PHP (3) – The comment is power

VS.PHP has a interesting idea to use the intellisence in PHP which isn’t a type safe language. Look at this:

class Foo1
{
function
methodFoo($num)
{
}
}

function foo($a, $b)
{
}

In foo(), VS.PHP doesn’t know the type of $a. Therefore, you aren’t supported by VS.PHP when you type code in foo().

We often write comments on the top of the definition of functions for a document system. The format of those comments aren’t defined by the grammer of PHP. But, there is the popular rule which is phpdoc or Doxygen. VS.PHP analogizes the type of variables by reading those comments. Look at this sample:

class Foo1
{
function
methodFoo($num)
{
}
}

/**
* @param Foo1 $a
*/
function foo($a, $b)
{
}

I added simple comments to the top of foo(). If these comments are written, VS.PHP can analogize the type to run intellisence:

This is a great hint for all of IDE which handles type unsafe languages. And, the idea brings rapid typing to us. That’s must for us. I don’t want to write code in PHP if I’m not with VS.PHP.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s