Die Flagge des Marasek

Dekostreifen

English

Aktuell Texte Der Comic Impressum Kalender Suche PHP-Klassen Container-Wizard main.s21

Kategorien

Buch
Computer
Computerspiele
Film
Geschichte
Gesellschaft
Idee
Kunst
Natur
Persönlich
Politik
Programmieren
Religion & Philosophie
Weblog
Weltpolitik
Weltsicht
{{login}}

Hard Tabs vs. Soft Tabs

Permalink
Vorheriger: Klassen verfügbarNächster: Second Life - Second Capitalism
Eingeordnet in: Computer, Foreign Language, Programmieren

Sometimes in life, a man has to step forward and stand firmly for his beliefs. And with all the flame wars going on in computer science, I've discovered a new one which I did not even thought of before: the war between the hard and soft tabbers.

It all began when I read the developer FAQ on PEAR, and they insisted on space-indentation in any contributed code.

The problem is as follows - in order to indent code, one can either press TAB to insert one \t or instead press space any number of times to get the same effect. Of course, modern editors can be configured to do the latter for you when pressing TAB.

I never really thought of using spaces instead of TAB. TAB is one character which gives an abstract information: indent by one level, with level being dependent on my editor and configuration. Also, it allows me to easily maneuver among indentation levels with the cursor keys and backspace.
Blanks, on the other hand, are much more a direct information: go x times right. When you want to delete those, you have to delete every one of them, and if you want to maneuver within this structure, you have to move one by one. Yuck. Also, it bars me from possibility to customize the view to my needs by simply telling the editor "render \t x spaces wide" and instead being at the mercy at whatever someone else considers to be an appropriate indentation width.

True enough, some of the examples in the FAQ make sense, as they show how certain statements would look with different tab width:

printf("%s",
$arg);
and

printf("%s",
$arg);

However, to make one thing clear: I'm not the kind of programmer which would spread a single command across several lines. Let's see how long I will stay on that side - I have a tendency to convert promptly, like I changed from underscore_style to CamelCaps within one day.

Kommentieren

Bitte beachten: Kommentare sind nicht sofort sichtbar, sondern werden erst nach einer kurzen Prüfung freigegeben, sofern keine rechtliche Beanstandung vorliegt.
Rechtlich bedenkliche Inhalte werden entweder entschärft oder nicht veröffentlicht.

* Titel  
* Nickname  
* Kommentar