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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:50:05+00:00 2026-06-07T19:50:05+00:00

I was reading this thread https://stackoverflow.com/questions/268538/tab-versus-space-indentation-in-c-sharp reagrding Tab versus space indentation. The moral of

  • 0

I was reading this thread https://stackoverflow.com/questions/268538/tab-versus-space-indentation-in-c-sharp reagrding Tab versus space indentation. The moral of the thread leads to “Tabs for indentation, spaces for alignment.” Can you explain me with some code example what does indentation means and what does spaces means wrt code? I am just confused with the two things in the context of code?

  • 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-07T19:50:07+00:00Added an answer on June 7, 2026 at 7:50 pm

    Example from that thread:

    switch(foo)
    {
       case bar:      Do1(); break;
       case foobar_2: Do2(); break;
    }
    

    here, keyword ‘case’ is indented. “bar:” and “foobar_2:” are aligned to the left.

    You can imagine there is a box, where the same words can be either left- or right-aligned. Left:

    switch(foo)
    {
       case bar:      Do1(); break;
       case foobar_2: Do2(); break;
    }
    

    Right:

    switch(foo)
    {
       case      bar: Do1(); break;
       case foobar_2: Do2(); break;
    }
    

    as this kind of thing will become messed up if done with tabs due to different tab configuration, spaces are a must here. However, with different tab width configuration, indentation just becomes like this:

    switch(foo)
    {
           case bar:      Do1(); break;
           case foobar_2: Do2(); break;
    }
    

    which is more a matter of preference as it does not mess up which line matches what.

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

Sidebar

Related Questions

I was reading this thread/post: https://stackoverflow.com/questions/262298/windows-c-ui-technology and am also wondering about a non .NET
I thought this other SO thread would have answered my question (http://stackoverflow.com/questions/4883751/trouble-reading-json-object-in-python), as it
I was reading through this thread: Hidden Features of JavaScript? and found this post:
Reading this article http://support.microsoft.com/kb/813878 I have a question: Where can I get ipseccmd.exe for
After reading this article I don't have a clear answer: http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/ Will browsers interpret
After reading this article on thedailywtf.com, I'm not sure that I really got the
I was reading this: http://en.wikipedia.org/wiki/Thread_safety Is the following function thread-safe? void foo(int y){ int
I'm reading data from a serial port. I read this posting: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/a709d698-5099-4e37-9e10-f66ff22cdd1e He is
I was reading the following article: http://odetocode.com/articles/294.aspx This article raised me a lot of
I was reading the tutorial on this page: http://edocs.bea.com/docs/cd/E13222_01/wls/docs81/medrec_tutorials/ejbgen.html#858279 And I have the following

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.