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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:40:09+00:00 2026-06-09T15:40:09+00:00

I am trying to understand the concept behind the for loop example for (;;)

  • 0

I am trying to understand the concept behind the for loop example

for (;;)
{
//write code
}

I understand what it does and how it’s the same looping structure as while(true), but my question is…is this good programming practice and for what sort of applications would this type of looping structure be applied to?

  • 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-09T15:40:10+00:00Added an answer on June 9, 2026 at 3:40 pm

    There are a few situations when this is desired behavior. For example, the games on cartridge-based game consoles typically have no exit condition in their main loop, as there is no operating system for the program to exit to; the loop runs until the console is powered off.

    Another example is when a module listen actions from another. It will need to listen all the time, so the listener have to listen for infinite time or until the program turn off. Like Sockets, Threads and UIComponents.

    There isn’t bad practice on the concept of infinite loop, but if it isn’t wanted or prejudice your system’s feature it can be considered, like when you create an unintentional infinite loop or lose program control for the loop.

    To make the infinite loop a good practice:

    1. Make sure that it is a desired behavior. If it has stop condition, avoid infinite loop!
    2. Make it explicity with for(;;) or while(true). Avoid tautologies in expression, do it simple!
    3. Make it fault tolerant, rescuing expected exceptions and give to them the right treatment!
    4. And the most important! Make a simple infinite loop!
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand the concept behind logic-less temlpates, but I'm finding myself
I'm having some difficulties while trying to understand the whole zend routing concept. My
I am trying to understand the concept of memory leaks. I tried this code
I'm trying to understand this concept but I don't get it yet. I'm new
I'm trying to understand the concepts behind DDD, but I find it hard to
I was trying to understand the concept of vEB tree. In an example: I
I'm trying to comprehend the concept behind MVC and URL routing. I understand that
The question might sound vague but I'm trying to understand the general concept of
So I have been trying to understand the concept of 3D picking but as
I am trying to understand the concept of currying and calling a function which

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.