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

  • SEARCH
  • Home
  • 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 8412627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:43:14+00:00 2026-06-10T00:43:14+00:00

I wonder if macros only have pros in any programming language. As there must

  • 0

I wonder if macros only have pros in any programming language. As there must be the limit we can create macros, and in frequency of use.

Suppose we create 100 macros in a class and imported that in 100 class of an application project. Is this a right approach?

  • 1 1 Answer
  • 0 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-06-10T00:43:15+00:00Added an answer on June 10, 2026 at 12:43 am

    #define is useful for:

    • header include guards for C and C++ headers (idiom: #include C and C++ headers, #import ObjC headers)
    • conditional compilation for language compatibility (e.g. UIKIT_EXTERN) which must be resolved during preprocessing.
    • conditional compilation for platform/compiler/version specific declarations (e.g. NS_AVAILABLE_IOS()) which must be resolved during preprocessing.
    • Assertion macros. Specifying the information such as the file, line and expression is just too noisy and error-prone.

    for everything else, there is an alternative which will save you headaches along the way.

    Suppose we create 100 macros in a class and imported that in 100 class of an application project. Is this a right approach?

    no – that is terrifying 🙂

    Cons

    There are many. Too often, the program will be difficult to understand by humans and programs (compiler, parser, indexer) alike. It’s a good way to introduce bugs, and completely replace text of unrelated programs (via a simple #import). There are more modern replacements for pretty much everything (e.g. functions, inline, typedef, constants, enums) — Allow the compiler to make your life easier!

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

Sidebar

Related Questions

I wonder how I can best create a progress bar fragment. It must be
wonder whether someone can help me with the following one... I have a struct
wonder if anyone can help; I have an a two dimensional array which I
Wonder if there is a js plugin to control music volume? I have all
I wonder if there is a way to use the fancybox with Image maps?
I wonder if there's a way to do the following: I have a structure
I wonder if there are any good / possible ways to automate - for
Wonder if anyone can help. I have a c# web application that uses the
wonder if someone could help me with a little problem. I have session values
I wonder about that can I write native SQL to add or delete operations

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.