Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Sub::Assert::Nothing
Design-by-contract like pre- and postconditions, etc.

Sub::Assert::Nothing - Design-by-contract like pre- and postconditions, etc.


NAME

Sub::Assert::Nothing - Design-by-contract like pre- and postconditions, etc.


SYNOPSIS


  use Sub::Assert::Nothing;

  

  assert

         yada yada yada;


ABSTRACT


  Design-by-contract like subroutine pre- and postconditions.


DESCRIPTION

This module is part of the Sub::Assert distribution. Please read the documentation on Sub::Assert. For your convenience, a portion of the docs is reproduced below, but do not expect it to be updated whenever Sub::Assert is updated.

The Sub::Assert module aims at providing design-by-contract like subroutine pre- and postconditions. Furthermore, it allows restricting the subroutine's calling context.

There's one big gotcha with this: It's slow. For every call to subroutines you use assert() with, you pay for the error checking with an extra subroutine call, some memory and some additional code that's executed.

Fortunately, there's a workaround for mature software which does not require you to edit a lot of your code. Instead of use()ing Sub::Assert, you simply use Sub::Assert::Nothing and leave the assertions intact. While you still suffer the calls to assert() once, you won't pay the run-time penalty usually associated with subroutine pre- and postconditions. Of course, you lose the benefits, too, but as stated previously, this is a workaround in case you want the verification at development time, but prefer speed in production without refactoring your code.

EXPORT

Exports the 'assert' subroutine to the caller's namespace.

assert

The implementation of the assert subroutine exported by this package is a no-op.


AUTHOR

Steffen Mueller <assert-module at steffen-mueller dot net>


SEE ALSO

the Sub::Assert manpage

perl.

Look for new versions of this module on CPAN or at http://steffen-mueller.net

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy