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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:38:59+00:00 2026-05-29T05:38:59+00:00

Is it a bad habit to write reverse loops as: for (i = N;

  • 0

Is it a bad habit to write reverse loops as:

for (i = N; i--;)

in order to access (N-1) to 0

If so, why? jsLint certainly doesn’t like it.

  • 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-29T05:39:00+00:00Added an answer on May 29, 2026 at 5:39 am

    There’s no technical reason that this won’t work. However, it clearly has readability issues since someone had an immediate “well that won’t work!” reaction.

    This is the kind of issue that the jQuery team struggles with – whether to use novel constructs that save bytes at the expense of clarity and maintainability. It really comes down to whether it’s worth 1 or 3 bytes of savings:

    for(var i=9;i--;)
    var i=9;while(i--)
    for(var i=9;i>0;i--)
    

    In this case, probably not.

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

Sidebar

Related Questions

when programming in Java I practically always, just out of habit, write something like
I like c# #region...#endregion facility a lot (some people say that's a bad habit
I have a bad habit of using the cursor keys of my keyboard to
What bad things happen at the moment document.write() is invoked? I've heard bits and
Is it bad habit to work with multiple models in one controller action? Should
In class design, is it a bad habit if one method calls another method
Not sure if this is just a bad habit, or a valid way of
I often find I want to write code something like this in C#, but
Maybe it is a bad habit which I still have since Flash Professional, but
Ok, so lately I got this presumable bad habit of declaring my class properties

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.