in reply to warning about prototypes too early?

Simple. Don't use prototypes. If your company policy requires you to use prototypes, have them give me a call at the office number listed on my home page, and I'll explain to them why they need to fix their policy.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on •Re: warning about prototypes too early?

Replies are listed 'Best First'.
Re: •Re: warning about prototypes too early?
by flyingmoose (Priest) on Feb 24, 2004 at 15:57 UTC
    Care to explain why they are there if they are evil? I sort of like having a decent check that the arguments to my functions are sound (most languages provide this), and have only adopted using them in Perl lately -- despite some controversy. Coming from a C/C++ background, forward declarations are considered a good thing.

    Is it true that in Perl a forward declaration is essentially a definition, and thus you run into problems with defining functions that never have a correctly defined body at a certain point in the code? That's the only reason I would think would make them a bad design choice.

    I will accept the wisdom of folks in this thread saying "don't do it", but I'm a stubborn beast and I usually need to know why I am or am not doing something.

      What about the performance increase you get from using prototypes? My understanding is that using prototypes gives you a circa 10% boost on performance. Is that not worth using them?

      hackmare.
A reply falls below the community's threshold of quality. You may see it by logging in.