code indentation (python and c...)

  • From: Daniel Dalton <d.dalton@xxxxxxxxxxxx>
  • To: blind programming <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 3 Apr 2008 23:26:19 +1100 (EST)

Hi,

I'm learning python and know a bit of c.
Is the following code ok?
Like is it fine to use 2 spaces for indenting instead of four?
I prefer 2 personally since I read braille...
So is this just a personal choice?

BTW how do you guys code in python with out braille?
Its quite white-space dependent...

Anyway is this code ok re white space?

#!/usr/bin/python
# my-program.py

i = 2
if i == 2 :
  print "hello"
print "done."

Obviously it is useless and the if is pointless since 2 is hard coded to i...
But is the indentation fine?
Or is it a bad standard.
I know it works.

And is the following good c code re indentation?
Or should I be using 4 or 5 spaces?

int main (void)
{
  printf ("hello world\n");
}

So is my 2 space indenting ok? Or is this a personal choice thing?
Or is there a certain number of spaces I should follow?
I just set up my text editor (emacs) to do indenting for me and set it to 2...
Should this be changed?

Thanks,

--
Daniel Dalton

http://members.iinet.net.au/~ddalton/
d.dalton@xxxxxxxxxxxx
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: