Hacker News new | ask | show | jobs
by jacquesm 4223 days ago
Significant whitespace in configuration files... what could possibly go wrong.

Didn't we learn something from Makefiles here? Does that 'tab' look like 8 or 4 spaces to you?

3 comments

This is mentioned a lot by Python newcomers but rarely turns out to be a problem in practice because, unlike GNU Make, Python simply requires you to be consistent throughout the same file.

That strikes me as an even more valuable property for configuration, which is more often accessed by multiple people and tools and more often as a distraction from other work rather than the primary focus.

> Python simply requires you to be consistent throughout the same file.

You or the other team of developers/maintainers/sys-admins looking over or patching this particular file. Using whatever default editor they prefer with whatever config an tabifying/untabifying behaviour that has.

Or maybe they are applying a patch produced on a different system with different tabulation? Or the other 2000 common ways for accuracy to go out the window.

> That strikes me as an even more valuable property for configuration

So you'd like to deliberately make the configuration system more brittle for absolutely no gain?

Yeah. Count me up for anything else. I personally prefer s-expressions, but I would be willing to go the full mile with pretty much any format NOT based on whitespace. Whitespace is bullshit and depending on it even more so.

If your team can't pick a single style and stick with, it is exceedingly unlikely that whitespace will be your biggest source of problems.
So your argument is that because you should be doing $X anyway, let's make the entire OS's configuration system needlessly brittle, just because you're a python dev and like python's style.

I don't think you understand the philosophy behind FreeBSD: it's about creating a predictable and reliable OS. This goes against those goals. Simple as that.

My point is that I've rarely found "predictable and reliable" to hinge on whitespace convention. The Python mention was simply that the same category of complaint comes up frequently in reference to the language but is so rarely an issue in practice that it's not worth discussing.
> > Python simply requires you to be consistent throughout the same file.

I like Python but this is not actually true. you only need to be consistent within a block, or be more deeply indented than the outer.

You can have different indentations for the if and else clauses!

Same that goes wrong in Python: Nothing. As long as tabs are outlawed, anyway.
I see many people continuing holy wars between tabs and spaces, even to a point to dismiss specific technology because of it.

If you simply enable option in your editor to make white spaces visible (i . e. you can tell the difference between tab and space), the problem becomes silly.

I personally like to use tabs for indentation, because of huge flexibility being able to change tab size (which changes indentation) as needed, but that just me.

It doesn't really matter which it is, as long as it's one of them. Spaces are more copy-paste friendly though.
> As long as tabs are outlawed, anyway.

When did that happen?

Tabs look like a light grey arrow in any editor I care to use.