General > General Technical Chat

Religious technical opinions

<< < (8/22) > >>

free_electron:

--- 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.

Someone:

--- 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.

T3sl4co1l:
BTW, an actually useful argument in favor of tabs:
https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/

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.  The former of which is probably not a great idea anyway (e.g. Doxygen is just going to use a proportional font by default -- you have to use markup to layout that; better yet, just write the supplementary docs, alright?), and the latter, I mean, I like doing it (lining up statements), though I don't know how accessible it is.  And all bets are off anyway with proportional fonts (as scary as it might seem to write code that way).  Not clear how many use prop'l. for accessibility, but something to keep in mind in any case.

Tim

SiliconWizard:

--- 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.)

T3sl4co1l:

--- Quote from: SiliconWizard on February 24, 2022, 02:30:23 am ---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.

--- End quote ---

Not a fan of HOME/END, CTRL+arrows?

CTRL+LEFT/RIGHT isn't all that efficient through a sea of operators or punctuation, but it's not too bad overall.

I haven't used an unlimited-line-length editor since QBASIC... :-DD

...Oh no wait, that's not true.  There's one.  Altium's text editor, of course. :palm: :-DD

(But anyway, I don't mind those too much, as long as END works, which, I haven't seen one that doesn't.  Handy for, say, writing tables so you don't have to spam in all the white space, but not very useful beyond that.)

The modern-ish feature that took me by surprise is ALT selection (columns).  Now there's a handy editing mode!

Tim

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