… | |
… | |
21 | make a program more readable, despite the lack of named parameters. |
21 | make a program more readable, despite the lack of named parameters. |
22 | Function calls also allow more static type checking than method calls, so |
22 | Function calls also allow more static type checking than method calls, so |
23 | many mistakes are caught at compiletime with this API. |
23 | many mistakes are caught at compiletime with this API. |
24 | |
24 | |
25 | Also, some backends (Perl and EV) are so fast that the method call |
25 | Also, some backends (Perl and EV) are so fast that the method call |
26 | overhead is very noticable (with EV it increases the time five- to |
26 | overhead is very noticeable (with EV it increases the execution time five- |
27 | six-fold, with Perl the method call overhead is about a factor of two). |
27 | to six-fold, with Perl the method call overhead is about a factor of two). |
28 | |
28 | |
29 | At the moment, there will be no checking (L<AnyEvent::Strict> does not |
29 | At the moment, there will be no checking (L<AnyEvent::Strict> does not |
30 | affect his API), so the L<AnyEvent> API has a definite advantage here |
30 | affect his API), so the L<AnyEvent> API has a definite advantage here |
31 | still. |
31 | still. |
32 | |
32 | |
33 | Note that the C<AE> API is an alternative to, not the future version of, |
33 | Note that the C<AE> API is an alternative to, not the future version of, |
34 | the AnyEvent API. Both APIs can be used interchangably and and there are |
34 | the AnyEvent API. Both APIs can be used interchangably and and there are |
35 | no plans to "switch", so if in doubt, use the L<AnyEvent> API. |
35 | no plans to "switch", so if in doubt, feel free to use the L<AnyEvent> |
|
|
36 | API in new code. |
36 | |
37 | |
37 | As the AE API is complementary, not everything in the AnyEvent API is |
38 | As the AE API is complementary, not everything in the AnyEvent API is |
38 | available, so you still need to use AnyEvent for the finer stuff. Also, |
39 | available, so you still need to use AnyEvent for the finer stuff. Also, |
39 | you should not C<use AE> directly, C<use AnyEvent> will provide the AE |
40 | you should not C<use AE> directly, C<use AnyEvent> will provide the AE |
40 | namespace. |
41 | namespace. |