General > General Technical Chat

Religious technical opinions

<< < (9/22) > >>

tooki:

--- Quote from: SiliconWizard on February 24, 2022, 02:30:23 am ---
--- Quote from: T3sl4co1l on February 24, 2022, 01:17:48 am ---It seems the most effective use is to combine both, tabbing only to set indentation, then only spaces to align text e.g. when you have to lay out a table or something in the comments, or want to get nice columns of variables in repeating statements.

--- End quote ---

That's my take on this as well. TABs are effective at conveying indentation *and* make code much easier to navigate on top of that, both with keyboard and mouse (as clicking inside one indentation 'spacing' will just get you to the nearest token inside of just setting the cursor right inside it at some space character, which I find horribly annoying). But with keyboard navigation, spaces for indentation are just a royal pain. Similarly, I absolutely *hate* editors that do not stop the cursor at the end of a line but allow you to set it absolutely anywhere beyond the end of lines. It's freaking non-productive to a large degree.

The only potential problem with TABs, when used to align text beyond the indentation level, is that alignment will of course get borked if you use a different TAB width (which in itself is not that big a deal - it's, or at least was, relatively common to document the TAB width used in source files in the files themselves for that exact purpose. But sure, it would still mildly annoy people who want to use a certain TAB width at all times, even when the source code is not theirs.)

That said, I've found myself guilty of occasionally using TABs to align text beyond the indentation level, but I try to avoid that now.
Better yet: I try to avoid aligning text beyond the indentation level altogether, which I think is usually a waste of time with little added value. I have better things to do than frantically hit the spacebar (or TAB key, when done "unproperly") just to supposedly make things a bit prettier (which is subjective.)

--- End quote ---
”Tab” isn’t an initialism, so it’s not in all-caps.

pardo-bsso:

--- Quote from: SiliconWizard on February 24, 2022, 02:30:23 am ---
I have better things to do than frantically hit the spacebar (or TAB key, when done "unproperly") just to supposedly make things a bit prettier (which is subjective.)


--- End quote ---

My editor has been inserting 4 (or whatever the current project requires) spaces every time I hit tab until reaching the correct level but I get your feeling of time wasting too

Siwastaja:

--- Quote from: T3sl4co1l on February 24, 2022, 01:17:48 am ---It seems the most effective use is to combine both, tabbing only to set indentation, then only spaces to align text e.g. when you have to lay out a table or something in the comments,

--- End quote ---

Exactly this. Tabs are the right way because then everyone can choose their exact own preference, and code base written with tab indentation on the left will automagically just work for any setting. There is then no need to fight over the "right" amount of indentation.

Choose spaces, and you will always be fighting. Maybe that's the point?

And this is not religious technical opinion; it's the opposite. Using tabs (for the line indentation in code) has multitude of very strong, factual arguments behind. Anti-tabbing resembles more like a religion of some sort, though. The only real reason to use spaces instead would be some limited software which cannot output or handle tabs correctly, but such programs are extremely rare, I can't think of any example. The reality is more dire: there are two reasons to prefer spaces: "just because", i.e., people who just picked up this habit somewhere, never really thought about it, and just kept doing what seems to work well enough for them. I was in this group. And then; sociopaths, because picking the "space" side is a way of controlling others, and ensuring having some sparkling fights about the correct number of spaces and spaces vs. tabs.

The former is of course more usual than being a sociopath. I was that way in the past, too. But sensible people who think about things (instead of making them religious choices of group identity) tend to convert into tabs at some point in their career. Unless they come into conclusion that it doesn't matter that much; people use suboptimal processes like imperial units that get the job done for them, without being evil.

free_electron:

--- Quote from: Someone on February 24, 2022, 01:02:28 am ---
--- Quote from: free_electron on February 24, 2022, 12:31:49 am ---
--- Quote from: Someone on February 20, 2022, 01:12:04 am ---But then mindless user with their "helpful" IDE that hides this and makes it look pretty for them starts adding in a random mixture of tabs and spaces.
--- End quote ---
Proper IDE's can do this automatically.  They strip all leading whitespace upon load and re-indent everything. just like they can colorize source.
Visual Studio Code, Slickedit, Eclipse , notepad++ have been able to do that for decades.

--- End quote ---
Then what do they save.... hence the mess of indentation through large and/or historic code bases.
Being able to make it pretty for your preferred settings /= correct.
Whitepace changes to suit your preference = vandalism.

--- End quote ---
Why do i care what they save ? They could save it without any leading spaces. it would still be rendered properly in the IDE and compile just the same. The compilers don't care about leading spaces / tabs ( unless you code in that python crap )
You can set your colorization to your liking ( i am colorblind : i do not see green. The receptor in my eyes is missing. so i may use different colors from anyone else ).
IDE's are there to make your life easier. Use em instead of fighting useless religious wars over tabs / spaces, vi / emacs and kde / gnome , mac/ pc , windows / linux, flathead or phillips. Scraping along with pen and paper cause you don't like 'puters' is counterproductive.

it doesn't matter that i use notepad++ , someone else slickedit and yet a third person uses visual studio. The code gets rendered properly. irrespective of tabs and spaces. That is what is important.

Someone:

--- Quote from: free_electron on February 24, 2022, 06:35:02 pm ---
--- Quote from: Someone on February 24, 2022, 01:02:28 am ---
--- Quote from: free_electron on February 24, 2022, 12:31:49 am ---
--- Quote from: Someone on February 20, 2022, 01:12:04 am ---But then mindless user with their "helpful" IDE that hides this and makes it look pretty for them starts adding in a random mixture of tabs and spaces.
--- End quote ---
Proper IDE's can do this automatically.  They strip all leading whitespace upon load and re-indent everything. just like they can colorize source.
Visual Studio Code, Slickedit, Eclipse , notepad++ have been able to do that for decades.

--- End quote ---
Then what do they save.... hence the mess of indentation through large and/or historic code bases.
Being able to make it pretty for your preferred settings /= correct.
Whitepace changes to suit your preference = vandalism.

--- End quote ---
Why do i care what they save ? They could save it without any leading spaces. it would still be rendered properly in the IDE and compile just the same.
--- End quote ---
Only rendered "correct" by your specific choice of editor/IDE. If the tools only clean leading whitespace then middle whitespace with tabs are still broken. Also a quick google suggests none of those programs auto indent on loading a file, its a user action (or automated on saving, eclipse might be able to do it on import but its not clear, requires plugin?). Decades you say? so it should be obviously documented and easy to point to a reference.

But its the "why do I care" that is telling, exactly the attitude of: works fine for me and I don't value anyone else's time/effort. Hence the problem.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod