Christian Mayer's Weblog

Tab-based Source Code Indentation

I’m always a fan of tab-based indentation. Tab is flexible. Every single coder can setup the width of a single tab on his own in his own development environment. As each single coder likes it. This is not possible using spaces for indentation.

I’m using the Doctrine Entity Generation Tool for some projects. This tool is very useful because it can generate getter and setter functions for a class. You just put in the variables and it generates all functions. But it’s also as shitty as it is useful because it appends the generated code to the existing class using spaces. Even if you used tabs. This behavior isn’t user-friendly.

I found a thread named Unable to generate entities with tab-based indentation on the Doctrine’s project management tool.

Description:

My project uses tabs for indentation, but there doesn’t seem to be any way of generating tab-indented entities using doctrine orm:generate-entities. The tool is useful but fixing the indentation after every run is very tedious.

A user named Marco Pivetta responded with this comment:

This won’t be fixed. You can always simply use your favorite editor and re-align your code as you wish. The entity generator is not supposed to focus on alignment/style problems.

I love the Doctrine project, but statements like by Marco Pivetta above make me raging all the time. Why can’t be there a simple setting for using both space indented and tab indented code? And everybody would be happy. If I still need to use my favorite editor to re-align my code the whole Entity Generation Tool has no sense in my mind.

More Resources

Posted on .
Categories: Commented
Tags: Tab, Spaces, Source, Code, Indentation, Getter, Setter, PHP, Doctrine, Entity, Generation, Tool

Categories | RSS Feed | Usage | Imprint
Copyright © 2006 by