lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Monday, January 6, 2014, Marc Lepage wrote:
On Mon, Jan 6, 2014 at 4:42 PM, Hisham <h@hisham.hm> wrote:

I think this is the level of attention that Marc LePage was alluding
to (when he said that average people just don't have it). Tabs for
indentation and spaces for alignment are great in theory but hard to
get right 100% of the time in practice. (The visual markers that some
IDEs put in tabs help, but not everyone likes to enable them, or to
use a graphical IDE for that matter.)

Even when not mixing tabs and spaces sometimes the wrong one slips --
I modified my console-based text editor so it checks if the file
contains tab characters; if it doesn't, then the Tab key emits spaces;
if it does, then the Tab key emits tab *and* I get a message saying
"TABS" in the status bar. (I can press Ctrl-T to toggle the behavior
of my Tab key.) Sometimes when applying patches sent by contributors
to my (spaces-only) source code, it is the "TABS" warning that tells
me to go there and clean up the indentation. If it wasn't for that, I
would most likely miss them.

-- Hisham


That's exactly what I'm saying, it all sounds great on paper, but in practice, the simpler solution (spaces only, pick a number) is the only workable solution.

The ideal is that your team of 10 agrees on what to do and does it. The real world is more like this: even if you repeatedly say to configure git to "remove trailing whitespace" upon commit, only about 6 ever do so (at a time, because people of course are changing computers and VMs and git installs now and then).

Personally, I rely on my editor to do smart things with spaces and indentation, try to leverage commit settings in git, and view all my diffs before committing. I can assure you not every one is that diligent.

In that world, tabs will infect spaces (or vice versa). So pick one. Spaces is simpler. 4 (maybe 2) are common standards.

I'm gonna transcribe my buddy's epic rant and convert every one of you to tabs. Or your money back. 

If you guys have enough time to hand-align code with the arbitrary number of spaces that are required to make things appear more aligned, then you must be laying down museum-quality sizzource down. 

I wonder if we couldn't type set things in LaTeX and really pretty things up! ;)

-Andrew