15 points

That’s because these programmers are getting paid by the character.

This is also why Java dev pays so well.

permalink
report
reply
5 points

System.out.println(“Wow, so little amount of characters to print this!”);

permalink
report
parent
reply
4 points

Or the slightly more readable brainfuck:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

permalink
report
parent
reply
2 points

Hey! Brainfuck is a fun puzzle language and nothing someone does at a job to do money per character. Would be funny if yes

permalink
report
parent
reply
3 points

std::cout << “Wow, so little amount of characters to print this!” << std::endl;

permalink
report
parent
reply
3 points

printf("C wins again\n");

permalink
report
parent
reply
2 points

std::puts("Why do so many C++ programmers not use the right tool for the job?");

permalink
report
parent
reply
11 points

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.

permalink
report
reply
3 points

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.

permalink
report
parent
reply
5 points
*

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.

permalink
report
parent
reply
2 points

This is a legit observation. However, I would argue that spaces needs a set indentation width anyway, so if tabs had a set indentation width that coders are expected to maintain when aligning code, it wouldn’t make a difference. Enforcing that in practice may be different, but in theory it works.

permalink
report
parent
reply
0 points
*

It’s OK, I replace all the tabs with spaces for uniformity. Tabs are stupid and they mess things up when I paste stuff. I like to watch the world burn.

permalink
report
parent
reply
2 points
*

Imagine not having an IDE that automatically fixes the spacing of pasted text.

permalink
report
parent
reply
9 points
11 points
*

That’s cause they pay us by the byte the suckers.

permalink
report
parent
reply
4 points

Imagine not using a minifier

permalink
report
parent
reply
1 point

I can imagine that just fine

permalink
report
parent
reply
8 points

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.

permalink
report
reply
8 points

It goes on the line! If you put it below, you’re wasting a line for no extra readability!

permalink
report
parent
reply
7 points

It goes on the next line, so you can have open and close brackets at the same indent depth for easy visual matching.

permalink
report
parent
reply
4 points

Your closing } goes on a new line below at the same indent depth as the line containing the open {!

permalink
report
parent
reply
3 points
*

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

permalink
report
parent
reply
2 points

That’s horrible.

permalink
report
parent
reply
1 point

To be honest, I think the forced ‘fixed’ indent in python is horrible, not being able to identify the different block function just by the indent, not being able to use % in vi to find the correct end,…

Much be an age thing, I learned to program in the 80s.

permalink
report
parent
reply
1 point

Why isn’t the else curly lined up with the end of the else word? I’d your gonna go crazy might as well go all the way I guess 😜

permalink
report
parent
reply
1 point

The { of the else is just the 2nd, optional, part of the if statement, so I was learned to align it with the opening keyword. I do the same with the then keyword, when the language requires a then, then it’s aligned with the i if if an the { with the f of if.

In the old days, when memory was expensive (in the day of 4k computers), even an extra cr/lf was worth preventing. Hence C has no then, C layout is usually { … } for one liners… or even without the { },… I learned to program in the IT dark ages. ;)

permalink
report
parent
reply
1 point

Wonder what the x-axis is? Survey year? Years of experience? Caffeine intake?

Anyway, I can hardly join a holy war – I code in assembly most comfortably, which I’m pretty sure is heresy these days.

permalink
report
parent
reply
5 points

Is there any actual advantage to using spaces? I have seen similar posts for a while and as a tab user I don’t understand why they are any better than just a tab

permalink
report
reply
5 points
*

The indentation always looks the way you wrote it even in raw text viewers, is generally the argument.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 3.3K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments