Pros and Cons of routing via Annotations

I have checked this

http://docs.phalconphp.com/en/latest/reference/routing.html#annotations-router

and it seems to me that defining the routes via annotations is better because you have routes and controllers in one file instead of two files (better for maintainance) etc.

What are pros and cons of using annotations exclusively?

Is it a bad idea?

Or is it OK and I just need to set the basic default controller and 404 page in the routes.php?

Does using annotations slow down the website more than using just routes.php?

Share your thoughts on this subject, please.



82.7k

Annotations might require an extra processing stage that plain PHP does not require. You can cache the routes in APC/Xcache to reduce the processing time of annotations. http://docs.phalconphp.com/en/latest/reference/annotations.html#annotations-adapters