[Kde-pim] Re: Kdepim coding style: indentation

David Jarvie djarvie at kde.org
Fri Mar 4 00:40:59 GMT 2011


--===============0020699950==
Content-Type: multipart/signed;
  boundary="nextPart1665418.6xHNfmPPyx";
  protocol="application/pgp-signature";
  micalg=pgp-sha1
Content-Transfer-Encoding: 7bit

--nextPart1665418.6xHNfmPPyx
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

On Tuesday 01 March 2011 18:35:40 Cornelius Schumacher wrote:
> On Tuesday 01 March 2011 David Jarvie wrote:
> > I'd like to propose that the kdepim coding standard
> > http://community.kde.org/KDE_PIM/Development/CodingStyle/Korganizer sho=
uld
> > be amended to allow indentation with either 2 or 4 spaces. To avoid
> > confusion when reading code, the two indentations should not, of course,
> > be mixed together. The standard should stipulate that the same indentat=
ion
> > should be used throughout each source file. Alternatives might be that
> > each subdirectory, or each function, can have its own indentation.
>=20
> Changing indentation rules seems to me like one of the most unproductive=
=20
> things you could do, and a rule allowing two different indentations doesn=
't=20
> deserve the name rule.
>=20
> The only change, I would (hesitantly) understand, would be to replace the=
 KDE=20
> PIM coding style by the kdelibs one to get overall more consistency. This=
=20
> still would open the nightmare of migrating from one style to another.
>=20
> Frankly, I think there are way more important things to spend time on tha=
n the=20
> indentation rule, so I'd avoid changing it at all. Let's focus on the 4.6=
=20
> release for example.

Personally, I find 2-space indentation makes code more difficult to read, b=
ecause it's more difficult to judge whether source lines which are separate=
d by multiple indented blocks actually do line up or not. It's much easier =
to see whether source lines align when 4-space indentation is used. So I wo=
uld argue that it actually _is_ productive to allow indentation of 4 spaces=
=2E I'm not suggesting that existing code should be reformatted, just that =
the alternative should be explicitly allowed as an alternative, with suitab=
le provisos to ensure that the two formats aren't mixed.

Because the coding standard has in practice been adopted by more than just =
the modules listed in the wiki page, I think it's a good idea given the app=
arent general support for 4 spaces, to amend the standard. This way, people=
 writing new modules or sub-modules who might be inclined to follow the sta=
ndard can feel free to adopt 4-space indentation if they wish.

=2D-=20
David Jarvie.
KDE developer.
KAlarm author -- http://www.astrojar.org.uk/kalarm

--nextPart1665418.6xHNfmPPyx
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAk1wNR0ACgkQTGZ1gSTAjlNTMwCdHubOpFTlMAfePyKpeflST2KH
5DkAnR49KQb8OshPWIWrhha8coiQeKOP
=bo9G
-----END PGP SIGNATURE-----

--nextPart1665418.6xHNfmPPyx--

--===============0020699950==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
--===============0020699950==--



More information about the kde-pim mailing list