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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:11:21+00:00 2026-06-07T06:11:21+00:00

I was browsing a GNUstep project on github and came across this little loop…

  • 0

I was browsing a GNUstep project on github and came across this little loop…

for(; i < 9; i+=1)
{
  for(;j < 9; j+=1)
  {
      /* Inner loop code - snipped */
  }
}

Most, but not all incremental operations were done using ‘+=1‘ in the source code; which would make sense if it was consistent. If it was consistent I would put it down to simple personal preference, or even readability.

However, for a project that appears to have been worked upon by one person (it is, after all, a simple sudoku game) the differing style of incremental operations has got me a bit curious.

for(; i<10; i++)
{
  /* inner loop code - snipped */
}

Now I’ve read this question, and it confirmed my suspicions – The compiler should be generating the same low-level code regardless of the syntax used.

This got me pondering whether it’s best practice or style guidelines, but the same coder has used the both methods of incrementing. Personally speaking, I use ‘i++‘ without thinking – and I’m guessing that’s natural for any coder, you just type it without thinking almost.

Am I missing something or is this “just because“? Is there any reason why you would mix both types of incrementing? If they both compile down to the same ASM then I would assume there’s no situations when one performs better than the other.

  • 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-07T06:11:23+00:00Added an answer on June 7, 2026 at 6:11 am

    Usually this happens when there are several programmers, each with his own coding preferences, and the project doesn’t enforce strict coding style.

    There is no difference.

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

Sidebar

Related Questions

While browsing some source code I came across a function like this: void someFunction(char
I was just browsing Sizzle's source code and I came across this line of
While browsing some code, I came across this line: if False: #shedskin I understand
While browsing I came across this blog post about using the Wikipedia API from
Browsing through the source of a spring framework project i came across a method
I was just browsing the perldocs when I came across this in an example
Browsing the code sample from C# 4.0 in a nutshell I came across some
While browsing the code of an erlang application, I came across an interesting design
While browsing the code of my friend I came to notice this: switch(State &state
While browsing MSDN documentation, you may come across this gem: TextBox.Watermark. Awesome! I've been

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.