Re: code indentation (python and c...)

  • From: Jim Dunleavy <jim.dunleavy@xxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Thu, 03 Apr 2008 14:21:22 +0100

Hi Daniel,

I use two spaces per indent also.
The Python library uses 4 spaces.
The house standard at Google is two spaces so we're in good
company.
The important thing is to be consistent throughout your projects.

--Jim

----- Original Message -----
From: Daniel Dalton <d.dalton@xxxxxxxxxxxx>
To: blind programming <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, April 03, 2008 1:26 PM
Subject: code indentation (python and c...)


> 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
>

----------------------------------------------------------------------------
"Information in this email (including attachments) is confidential.  
It is intended for receipt and consideration only by the intended recipient.
If you are not an addressee or intended recipient, any use, dissemination,
distribution, disclosure, publication or copying of information contained in
this email is strictly prohibited.  Opinions expressed in this email may be
personal to the author and are not necessarily the opinions of the HSE.

If this email has been received by you in error we would be grateful if you 
could immediately notify the ICT Service Desk by telephone at +353 1 6352757 
or by email to service.desk@xxxxxxxxxxxx and thereafter delete this
e-mail from your system"
----------------------------------------------------------------------------
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: