techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.7K
active users

#indentation

0 posts0 participants0 posts today
DJ Adams<p>I'm researching for a rewrite of our OData tutorials in our SAP Developer Centre and came across this example of an Atom feed (you know the connection, right?). I cannot unsee the absolute randomness of indentation here, so I thought it only right that I share it here. <a href="https://hachyderm.io/tags/XML" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>XML</span></a> <a href="https://hachyderm.io/tags/Indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Indentation</span></a> <a href="https://hachyderm.io/tags/Atom" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Atom</span></a> <a href="https://hachyderm.io/tags/OData" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>OData</span></a></p>
dorotaC<p>What's a command-line tool to hard-wrap a file but preserve <a href="https://fosstodon.org/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> ?</p><p>(No, I'd never hard-wrap anything willingly, but sometimes you have to bow to evil in order to achieve greater good.)</p><p><a href="https://fosstodon.org/tags/wrapping" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>wrapping</span></a> <a href="https://fosstodon.org/tags/linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>linux</span></a> <a href="https://fosstodon.org/tags/opensource" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opensource</span></a> <a href="https://fosstodon.org/tags/terminal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>terminal</span></a></p>
Gary "grim" Kramlich<p>This is what I imagine people's code looks like when they complain about the forced indentation in <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a>. </p><p>And yes, this code is correct.</p><p><a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/c" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>c</span></a> <a href="https://mastodon.social/tags/formatting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>formatting</span></a> <a href="https://mastodon.social/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> <a href="https://mastodon.social/tags/tabsvsspaces" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tabsvsspaces</span></a> <a href="https://mastodon.social/tags/whitespace" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>whitespace</span></a> <a href="https://mastodon.social/tags/developers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>developers</span></a> <a href="https://mastodon.social/tags/developerexperience" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>developerexperience</span></a> <a href="https://mastodon.social/tags/debugging" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>debugging</span></a> <a href="https://mastodon.social/tags/fail" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fail</span></a> <a href="https://mastodon.social/tags/goodluck" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>goodluck</span></a></p>
C.<p>Judging a programming <a href="https://mindly.social/tags/language" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>language</span></a> based on whether it uses <a href="https://mindly.social/tags/braces" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>braces</span></a> or <a href="https://mindly.social/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> for block scoping is like judging a dinner course by the shape of the pot it was cooked in.</p><p><a href="https://mindly.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://mindly.social/tags/dinner" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dinner</span></a> <a href="https://mindly.social/tags/dish" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dish</span></a> <a href="https://mindly.social/tags/course" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>course</span></a> <a href="https://mindly.social/tags/block" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>block</span></a> <a href="https://mindly.social/tags/scope" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>scope</span></a> <a href="https://mindly.social/tags/syntax" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>syntax</span></a> <a href="https://mindly.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>
Inautilo<p><a href="https://mastodon.social/tags/Development" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Development</span></a> <a href="https://mastodon.social/tags/Pitfalls" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pitfalls</span></a><br>Lessons from plain text · “Plain text might not always be as straightforward as it appears.” <a href="https://ilo.im/160erg" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">ilo.im/160erg</span><span class="invisible"></span></a></p><p>_____<br><a href="https://mastodon.social/tags/Programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Programming</span></a> <a href="https://mastodon.social/tags/Tools" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Tools</span></a> <a href="https://mastodon.social/tags/TextEditor" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TextEditor</span></a> <a href="https://mastodon.social/tags/CodeEditor" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CodeEditor</span></a> <a href="https://mastodon.social/tags/Newline" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Newline</span></a> <a href="https://mastodon.social/tags/Indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Indentation</span></a> <a href="https://mastodon.social/tags/Wrapping" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Wrapping</span></a> <a href="https://mastodon.social/tags/WebDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>WebDev</span></a> <a href="https://mastodon.social/tags/Frontend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Frontend</span></a> <a href="https://mastodon.social/tags/Backend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Backend</span></a></p>
Kevin Karhan :verified:<p><span class="h-card" translate="no"><a href="https://social.treehouse.systems/@krutonium" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>krutonium</span></a></span> also <a href="https://infosec.space/tags/Tabs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Tabs</span></a> don't fuck with other peoples' <a href="https://infosec.space/tags/IDE" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>IDE</span></a> and correlate with <a href="https://infosec.space/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> depth easily.<br><a href="https://www.youtube.com/watch?v=V7PLxL8jIl8" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">youtube.com/watch?v=V7PLxL8jIl</span><span class="invisible">8</span></a></p><ul><li>In fact, I always insisted on <a href="https://infosec.space/tags/TabsNotSpaces" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TabsNotSpaces</span></a> for formatting and also use <a href="https://infosec.space/tags/TSV" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TSV</span></a> over <a href="https://infosec.space/tags/CSV" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CSV</span></a> because one may want to use <a href="https://infosec.space/tags/comma" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>comma</span></a> in a field for like correct decimal designation.</li></ul>
Stephane L Rolland-Brabant ⁂⧖⏚<p><span class="h-card" translate="no"><a href="https://mastodon.tetaneutral.net/@tth" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>tth</span></a></span> </p><p>There is an ongoing underground global war where you have chose a side: either TAB or SPACE</p><p>I was on the TABS side, for many years</p><p>I cannot tell you how i have been caught, I have no memories left, no trace of my former life where TABS was my default indentation key, whatever the language</p><p>I assure you the &lt;Space&gt; people are really friendly. They have not hurt me. I just no longer use the TAB key, that is the only difference</p><p><a href="https://mathstodon.xyz/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://mathstodon.xyz/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> </p><p>Now, I have been told there is a growing schism between 2-space indentation and the 4-space indentation</p><p>Given the galactically-known wisdom of the bipedal cousins of the chimpanzees, we can be sure they will bury the axes of war</p><p>PEP8 advises to stand with space-4 as the prefered pythonic way of indenting</p>
Blake Patterson<p>Coding indentation styles. I'm a K&amp;R man, myself. </p><p><a href="https://en.wikipedia.org/wiki/Indentation_style" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">en.wikipedia.org/wiki/Indentat</span><span class="invisible">ion_style</span></a></p><p>If you are a Horstmann person, please unfollow. </p><p><a href="https://oldbytes.space/tags/developers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>developers</span></a> <a href="https://oldbytes.space/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://oldbytes.space/tags/coding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>coding</span></a> <a href="https://oldbytes.space/tags/dev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dev</span></a> <a href="https://oldbytes.space/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> <a href="https://oldbytes.space/tags/format" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>format</span></a> <a href="https://oldbytes.space/tags/coders" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>coders</span></a></p>
Kagan MacTane (he/him)<p>Spicy take: If your software development team is using Prettier, you should set it to indent with tabs, not spaces.</p><p>That makes it easy for everyone to set whatever indentation depth they want, and even adjust it if they feel the need. Someone who can pick out a 4-column indent better than 2 will have trouble reading that "indented with 2 spaces" stuff, but tabs let everyone coexist.</p><p><a href="https://wandering.shop/tags/SoftwareDevelopment" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SoftwareDevelopment</span></a> <a href="https://wandering.shop/tags/coding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>coding</span></a> <a href="https://wandering.shop/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://wandering.shop/tags/webdev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>webdev</span></a> <a href="https://wandering.shop/tags/code" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>code</span></a> <a href="https://wandering.shop/tags/Prettier" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Prettier</span></a> <a href="https://wandering.shop/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a></p>
Martin Schmitt<p>Googled "<a href="https://mastodon.online/tags/vim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vim</span></a> heuristic <a href="https://mastodon.online/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a>", wasn't disappointed. 🤯</p>
Technotramp<p><span class="h-card" translate="no"><a href="https://social.vivaldi.net/@Catweazle" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>Catweazle</span></a></span> </p><p>That's very <a href="https://mastodon.social/tags/strange" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>strange</span></a>. To me the <a href="https://mastodon.social/tags/links" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>links</span></a> are complete after <a href="https://mastodon.social/tags/loading" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>loading</span></a> and the <a href="https://mastodon.social/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> works for me too. Can I have a <a href="https://mastodon.social/tags/personal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>personal</span></a> <a href="https://mastodon.social/tags/question" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>question</span></a>? Can you please tell me what <a href="https://mastodon.social/tags/reader" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>reader</span></a> you are using? Ideally and operating <a href="https://mastodon.social/tags/system" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>system</span></a> or at least one of the above. I'd be happy to <a href="https://mastodon.social/tags/fix" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fix</span></a> it, but I can't bring up the <a href="https://mastodon.social/tags/errors" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>errors</span></a>. I've tried two readers at the same <a href="https://mastodon.social/tags/time" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>time</span></a> and it's <a href="https://mastodon.social/tags/always" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>always</span></a> been ok..</p>
George Z<p>Historic <a href="https://mastodon.social/tags/ProgrammingStyle" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ProgrammingStyle</span></a> question: I remember that more than a decade ago everyone (i know of) exclusively used four spaces for <a href="https://mastodon.social/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a>. Now I see almost-exclusively two spaces for indentation. When did this switch start? What's the trend?</p><p>Can someone scrape dotfiles repos on github and their histories and plot that change in people's vim/emacs configs?</p><p>I suspect that it's correlated with the popularity of modern webdev brought by its Mariana-deep &lt;div&gt; nesting.</p>
Nataniel Farzan<p>If you could only indent your code with either tabs or spaces from now on, which would you prefer to use?</p><p>Without considering the norms/preferences in specific languages, which one do you personally prefer to work with?</p><p>Reply with your reasoning if you'd like - please keep the discussion civil though 😅</p><p><a href="https://floss.social/tags/tabs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tabs</span></a> <a href="https://floss.social/tags/spaces" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>spaces</span></a> <a href="https://floss.social/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> <a href="https://floss.social/tags/formatting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>formatting</span></a> <a href="https://floss.social/tags/code" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>code</span></a></p>
Matt Cengia<p><span class="h-card"><a href="https://mstdn.social/@mattwilcox" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>mattwilcox</span></a></span> Oof, this hits hard, because my interest in <a href="https://aus.social/tags/accessibility" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>accessibility</span></a> completely agrees with you, but this is such an unpopular opinion that making such a transition will be a long and tricky process (not to say it's not worthwhile), and I'll have to work out how to configure various linters and code formatters to do the right thing.<br>Have you found code formatters can usually be configured to use tabs without too much trouble?<br>(In particular, I've not yet worked out if I can make autopep8 or similar go against its grain and *not* just do 4-space indents.)<br><a href="https://aus.social/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> <a href="https://aus.social/tags/tabs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tabs</span></a> <a href="https://aus.social/tags/spaces" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>spaces</span></a> <a href="https://aus.social/tags/tabsOverSpaces" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tabsOverSpaces</span></a></p>
Michael Zeevi<p>Do you prefer your <a href="https://fosstodon.org/tags/YAML" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>YAML</span></a> lists indented or not?</p><p>```<br>a:<br>- foo<br>- bar<br>b:<br> - foo<br> - bar<br>```</p><p>(please boost to gather more replies to the poll!)</p><p><a href="https://fosstodon.org/tags/syntax" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>syntax</span></a> <a href="https://fosstodon.org/tags/indentation" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indentation</span></a> <a href="https://fosstodon.org/tags/prettify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>prettify</span></a> <a href="https://fosstodon.org/tags/code" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>code</span></a></p>
Aaron Lael<p><span class="h-card" translate="no"><a href="https://mastocomm.org/@tojosan" class="u-url mention">@<span>tojosan</span></a></span> Adopt PEP8 formatting early and if you post online asking for questions make sure your formatting works. <a href="https://techhub.social/tags/indentation" class="mention hashtag" rel="tag">#<span>indentation</span></a> <a href="https://techhub.social/tags/4spaces" class="mention hashtag" rel="tag">#<span>4spaces</span></a></p>