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 5990339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:13:48+00:00 2026-05-22T23:13:48+00:00

My buddy says that he tries to program with as little if/else statements as

  • 0

My buddy says that he tries to program with as little if/else statements as possible, for efficiency’s sake. When I asked why he said that if/else’s take a somewhat significant part of the program’s ressources, so he tries to stay away from them.

Is he right? Are there better ways to execute if/else style code without actually using that structure? Are switch/case structures any better?

EDIT: He wasn’t referring to a specific language but more as a general practice. As well as UNIX/Linux and Windows platforms.

  • 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-05-22T23:13:49+00:00Added an answer on May 22, 2026 at 11:13 pm

    Typically, a compiler will represent an if/then/else construct as a test followed by a jump to another location in the code. This is a very standard and well-optimized operation for any processor. Unless you are programming in something other than the standard compiled or interpreted languages, your buddy’s conclusion is seriously flawed.

    Further, optimizing code at this level without profiling it first (to find where the slow bits are) is well, ill-advised. (More like a complete waste of the programmer’s time.)

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

Sidebar

Related Questions

My buddy read an OpenGL book that said interleaving your vertex pointers and the
When writing simulations my buddy says he likes to try to write the program
me and my buddy are working on a program for our Object Oriented Programming
I want to let application user know that whom buddy has downloaded the application
Possible Duplicate: How to use existing database with Android App A buddy and I
A buddy of mine asked me to post this question: EDIT: He decided to
How do you call it when your buddy designs a class Dinosaur, that represents
Possible Duplicate: How to EJB 3.1 Deployment in Tomcat 5.5.x Blockquote Any buddy please
hwy buddy i try to make my album view for that i put my
My buddy at work told me that you could use jQuery to write a

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.