Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 581437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:34:42+00:00 2026-05-13T14:34:42+00:00

Does anyone have any opinions on not using prototypes unless necessary for functions declared

  • 0

Does anyone have any opinions on not using prototypes unless necessary for functions declared “static”. Do you always put them at the top of your translation unit? I tend to but recently I’ve been thinking about why not rely on the ordering of the functions and in way you can limit some scope of where the function can be called from, potentially forcing yourself to think a little bit more about the scope of the function. I’m still on the side of doing the prototype, but I can see arguments aren’t completely baseless for the other side of the fence. I suppose this argument could also be continued on to #define and file scope variables.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:34:43+00:00Added an answer on May 13, 2026 at 2:34 pm

    I follow the “define before use” rule myself wherever possible (thus my files always read from the bottom up). That way I don’t have to worry about keeping declarations and definitions in sync, at least within the same file.

    To be pedantic, you’re talking about declarations, not prototypes; prototype refers to the syntax of a declaration/definition (i.e., declaring the number and types of parameters in the parameter list). To be clear, the following declaration and definition use prototype syntax:

    /**
     * prototype declaration; the number and types of parameters are
     * part of the declaration, so the compiler can do type checking
     * on the function call
     */
    double f(int x, int y, double z);
    /**
     * prototype definition
     */
    double f(int x, int y, double z)
    {
      ...
    }
    

    whereas the following declaration and definition do not use prototype syntax:

    /**
     * non-prototype declaration; the number and types of parameters
     * are not specified, so the compiler can't do any type checking
     * on the function call.
     */
    double f();
    ...
    /**
     * non-prototype definition; this is still legal AFAIK, but
     * *very* outdated, and should no longer be used
     */
    double f(x, y, z)
      int x;
      int y;
      double z;
    {
      ...
    }
    

    Whether you define functions before use, or just declare before use and define later, always use prototype syntax.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 353k
  • Answers 353k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First, the inner subselect that queries the "Details" result is… May 14, 2026 at 7:49 am
  • Editorial Team
    Editorial Team added an answer Eclipse 3.5.2 (and possibly earlier versions) already provides this feature.… May 14, 2026 at 7:49 am
  • Editorial Team
    Editorial Team added an answer Try finding out which of the table aliases is not… May 14, 2026 at 7:49 am

Related Questions

Does anyone have any opinions over the best ways to connect a client to
I've been messing around a bit with a Facebook application for a while now,
Does anyone have any white papers or articles that would compare and contrast a
Excuse me if I'm off on my terminology, I only have around 2.4 years
I have read in various places that having variables with global scope, i.e. a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.