3
top 12 comments
sorted by: hot top controversial new old
[-] Grishaix@feddit.de 1 points 1 year ago
[-] OsrsNeedsF2P@lemmy.ml 1 points 1 year ago

Imagine not using a minifier

[-] noisytoot@lemmy.ml 1 points 1 year ago

Seven semicolons are the correct way to do indentation (it even alliterates):

int main
(void) {
;;;;;;;printf("like this\n"); }
[-] dystop@lemmy.ml 1 points 1 year ago* (last edited 1 year ago)

the correct way is to never indent and never use whitespace. Saves memory.

Your goal should be 1LOC every month, no more.

[-] booty@hexbear.net 1 points 1 year ago

all code should be written in one line with absolutely no breaks. it's the most efficient way

[-] UpperBroccoli@feddit.de 1 points 1 year ago

[ ] tabs [ ] spaces [x] why would I even care, I press tab and the editor puts either a tab or a number of spaces, couldn't care less...

[-] demonen@lemmy.ml 1 points 1 year ago

I use tabs because I prefer 4-space indents and others might prefer 2-space indentation or the gross and unacceptable 6-space indentation.

If more than one person is working on a code base, there will likely be more than one preference, and with tabs everyone gets to just set their own tab width.

Yes, even the 3-space savages.

[-] noisytoot@lemmy.ml 1 points 1 year ago

Tabs work fine as long as you don't align stuff. If you do, you have to assume a tab size and mix tabs and spaces.

[-] edward@lemmy.ml 1 points 1 year ago* (last edited 1 year ago)

Generally aligning stuff isn’t nice. But if you do, it’s tabs up to whatever level of indentation you’re at then spaces the rest of the way. So you wouldn’t have to assume a tab size. And the tabs and spaces have different semantic meaning (indent vs alignment) so mixing them makes sense. It's even built into Jetbrains IDEs, where it's called "Smart Tabs".

Although really just adding a level of indent is better than aligning.

[-] Lanthanae@lemmy.blahaj.zone 1 points 1 year ago

I'd imagine it's because people who use spaces are either further in their career in average (because the modern programming ecosystem in general uses tabs so new devs are more likely to only know that) or they're just more serious about software development because the kind of person to die on that hill is also the kind of person who is very obsessive about other things as well.

[-] gnuslashdhruv@lemmy.ml 1 points 1 year ago

Is this some kind of python meme I'm too C++ to understand?

Now, I'm completely willing to start a war about { going on the next line.

[-] TheInsane42@lemmy.ml 1 points 1 year ago* (last edited 1 year ago)

Totally agree, all my { end up on the next line, 1st spot when starting a function, last character of the keyword when starting an if/for/... section. I even put the closing one on the same line when it's single line, else either at the end of the closing line (when changing really old code) or same indent.

So indenting varies a lot, which makes most 'new' programmers go mental.

while (my code)
    { I'll do it my way }

if (! liked)
 { toughen-up }
else
 { get used to it
   multi-line can go both ways...
 }

That is, unless the font used messes it up. ;)

this post was submitted on 17 Jun 2023
3 points (100.0% liked)

Programmer Humor

32050 readers
1390 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS