This is not a meme, I was trying to find content for an OC /c/programmerhumor post and found this

3 years ago by OsrsNeedsF2P to c/programmerhumor

aaaantoine 21 points 3 years ago

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

This is also why Java dev pays so well.

path: 0 292501, hotness: undefined, score: 21, children: 7
ReakDuck 7 points 3 years ago

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

path: 0 292501 294174, hotness: undefined, score: 7, children: 6
Eavolution 7 points 3 years ago

Or the slightly more readable brainfuck:

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

path: 0 292501 294174 314217, hotness: undefined, score: 7, children: 1
ReakDuck 2 points 3 years ago

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

path: 0 292501 294174 314217 316582, hotness: undefined, score: 2, children: 0
Grishaix 4 points 3 years ago

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

path: 0 292501 294174 294918, hotness: undefined, score: 4, children: 3
original_ish_name 5 points 3 years ago

printf("C wins again\n");

path: 0 292501 294174 294918 300361, hotness: undefined, score: 5, children: 1
Grishaix 6 points 3 years ago

p "Ruby FTW!"

path: 0 292501 294174 294918 300361 300362, hotness: undefined, score: 6, children: 0
ElectronSoup 3 points 3 years ago

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

path: 0 292501 294174 294918 297218, hotness: undefined, score: 3, children: 0
demonen 21 points 3 years 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.

path: 0 314172, hotness: undefined, score: 21, children: 6
noisytoot 6 points 3 years 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.

path: 0 314172 334423, hotness: undefined, score: 6, children: 2
edward 13 points 3 years 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.

path: 0 314172 334423 335305, hotness: undefined, score: 13, children: 0
gun 3 points 3 years ago

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.

path: 0 314172 334423 336403, hotness: undefined, score: 3, children: 0
victron 1 point 3 years ago
path: 0 314172 393719, hotness: undefined, score: 1, children: 0
PeterPoopshit -1 points 3 years ago

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.

path: 0 314172 327752, hotness: undefined, score: -1, children: 1
edward 2 points 3 years ago

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

path: 0 314172 327752 335754, hotness: undefined, score: 2, children: 0
noisytoot 17 points 3 years ago

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

int main
(void) {
;;;;;;;printf("like this\n"); }
path: 0 333004, hotness: undefined, score: 17, children: 1
dystop 7 points 3 years ago

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

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

path: 0 333004 343666, hotness: undefined, score: 7, children: 0
gnuslashdhruv 14 points 3 years 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.

path: 0 312060, hotness: undefined, score: 14, children: 10
Eavolution 9 points 3 years ago

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

path: 0 312060 314169, hotness: undefined, score: 9, children: 4
gnuslashdhruv 7 points 3 years ago

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

path: 0 312060 314169 314200, hotness: undefined, score: 7, children: 3
Steeve 4 points 3 years ago

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

path: 0 312060 314169 314200 318324, hotness: undefined, score: 4, children: 1
ForbiddenRoot 2 points 3 years ago
fn main() {
    println!("WTF?");
          }

PS: I know what you meant

path: 0 312060 314169 314200 318324 333482, hotness: undefined, score: 2, children: 0
TheInsane42 2 points 3 years ago

This, as it also helps when using % to go to the matching open/close bracket when the cursos doesn't jump all around the place..

path: 0 312060 314169 314200 321801, hotness: undefined, score: 2, children: 0
TheInsane42 3 points 3 years 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. ;)

path: 0 312060 321766, hotness: undefined, score: 3, children: 3
edward 2 points 3 years ago

That’s horrible.

path: 0 312060 321766 361326, hotness: undefined, score: 2, children: 0
salimundo 1 point 3 years ago

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 😜

path: 0 312060 321766 348040, hotness: undefined, score: 1, children: 1
TheInsane42 1 point 3 years ago

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

path: 0 312060 321766 348040 375427, hotness: undefined, score: 1, children: 0
Saigonauticon 2 points 3 years ago

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.

path: 0 312060 341503, hotness: undefined, score: 2, children: 0
Grishaix 13 points 3 years ago path: 0 292415, hotness: undefined, score: 13, children: 3
yads 14 points 3 years ago

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

path: 0 292415 292590, hotness: undefined, score: 14, children: 0
OsrsNeedsF2P 6 points 3 years ago

Imagine not using a minifier

path: 0 292415 292460, hotness: undefined, score: 6, children: 1
leodude 1 point 3 years ago

I can imagine that just fine

path: 0 292415 292460 466011, hotness: undefined, score: 1, children: 0
edward 13 points 3 years ago

Tabs make more sense because that’s exactly what they’re for, indents. Ignoring how it looks, which makes more semantic sense for an indent, or ? You wouldn’t use a bunch of spaces to indent a paragraph, so why would you use it to indent code?

path: 0 335730, hotness: undefined, score: 13, children: 7
StudioLE 8 points 3 years ago

And by using tabs the IDE can customise whether it's displayed as two character or four character deep indentation. It just makes so much more sense.

It's insane that anyone considered spaces to be a sensible default. Yet I primarily develop in C# where four spaces are the standard so that's what I use. However the reality is the IDE handles all the formatting automatically so I'm never actually typing four spaces

path: 0 335730 342797, hotness: undefined, score: 8, children: 1
PlasmaK 2 points 3 years ago

Just don't use IDE

path: 0 335730 342797 343657, hotness: undefined, score: 2, children: 0
0x00cl 1 point 3 years ago

Well, the tab key was created to avoid repeatedly having to press space to create an indentation, but that was on typewritters, so either way, you can use spaces or tab key to indent text.

Now text editors can transform tab character ('\t') to desired amount of spaces, and I think the problem with using tab characters in code ('\t') is that system may have different configurations for the amount of space a tab char takes, making it look inconsistent on different systems, while space char is pretty much standard on every system.

path: 0 335730 354835, hotness: undefined, score: 1, children: 0
Vlyn 0 points 3 years ago

I was pro tabs when I started out with software development. It just made sense, right? You press the key once, you get a single symbol, you have your indention, neat. And there is the argument that everyone can adjust their tab sizes, want it to be 2 spaces? 4? 6? Whatever? Awesome!

Then you write actual code and this perception changes. Tabs make a mess, developers often align both code and comments to make sense. That alignment only works at x-spaces and utterly breaks if you change tab width.

An example in C# with LINQ (just semi-random stuff):

var test = customers.Where(c => c.Deleted == false
                             && c.Enabled
                             && c.HasProducts()
                             && blockedCustomers.Contains(c.Id) == false);

This kind of indention only works with spaces, not with tabs. And no, mixing tabs and spaces doesn't work (like some users claim, that you can indent with tabs and then do alignment with spaces.. nope, if you change tab with then your space alignment breaks).

Honestly, I don't care either way, I just use what my company uses and adapt. But till now it has always been spaces (even though I was team tabs in university) and now I actually prefer spaces as it just makes sense. It's consistent, it's easy, it works everywhere.

Btw. the Lemmy code editor is shit, trying to align this was trial and error for a minute :-/

path: 0 335730 427177, hotness: undefined, score: 0, children: 3
edward 3 points 3 years ago

if you change tab with then your space alignment breaks

No, it doesn't? Here's the exact same text content with different tab widths:

The tabs are smaller but the spaces are the same, so the alignment remains.

path: 0 335730 427177 427178, hotness: undefined, score: 3, children: 2
Vlyn 2 points 3 years ago

Ah, I see what you mean, out of instinct I'd have put one more tab on the "whatever" line, which would break the concept. But if you manually do both the indent + alignment in spaces then it works.

Besides your IDE of choice screaming at you that you are mixing tabs and spaces that is :)

It still feels like a hack though, simply going with spaces is more uniform and works everywhere. Especially as a lot of code is viewed in browsers nowadays (GitHub, GitLab, ..) and tabs are often a mess in those environments.

path: 0 335730 427177 427178 434224, hotness: undefined, score: 2, children: 1
edward 1 point 3 years ago

Besides your IDE of choice screaming at you that you are mixing tabs and spaces that is

JetBrains IDEs actually have it built in, it's called "smart tabs".

path: 0 335730 427177 427178 434224 441872, hotness: undefined, score: 1, children: 0
ZachAR3 13 points 3 years ago

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

path: 0 294974, hotness: undefined, score: 13, children: 1
zalack 15 points 3 years ago

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

path: 0 294974 296044, hotness: undefined, score: 15, children: 0
Lanthanae 13 points 3 years 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.

path: 0 295030, hotness: undefined, score: 13, children: 6
zalack 8 points 3 years ago

Wait. Are tabs used more often in modern stuff? Almost everything I use does spaces and I'm not that new to programming. Been doing it for maybe 5 years. I use spaces in everything but Go.

path: 0 295030 303594, hotness: undefined, score: 8, children: 5
Lanthanae 6 points 3 years ago

Most text editors people use (like VSCode) generally automatically adjust tabs to be whatever the standard indent is for the project (and convert to spaces if it's necessary). As a result, indenting with tabs usually just works, and so most people just learn to do it that way. Also people are used to using tabs for indent from things like Word which they used before learning to write code. As a result, I've noticed most people use the tab key (even if their not technically "using tabs" every time they do it).

path: 0 295030 303594 303595, hotness: undefined, score: 6, children: 4
itty53 5 points 3 years ago

I think the deeper generational thing is in the idea that anything "just works". Like I'm a programmer, right, so I know shortcuts. Ctrl+S saves the file, simple right?

Me when I want to save a file: Ctrl+SSSS. Why? Because I don't trust it "just works". Same reason I don't trust auto save. Same reason I am stunned every time I tell windows to diagnose and fix the network problem and then it actually does.

I grew up in a time where you couldn't trust any of that shit.

path: 0 295030 303594 303595 321219, hotness: undefined, score: 5, children: 1
Lanthanae 4 points 3 years ago

I generally trust things that "just work" so long as I know why and under what conditions.

path: 0 295030 303594 303595 321219 327753, hotness: undefined, score: 4, children: 0
zalack 3 points 3 years ago

Yeah, I have my tab key set up to insert spaces. I meant the characters being used, not the key used to write them.

path: 0 295030 303594 303595 307029, hotness: undefined, score: 3, children: 1
Lanthanae 1 point 3 years ago

Exactly, and do you think the majority of people who took the survey considered that distinction?

path: 0 295030 303594 303595 307029 307030, hotness: undefined, score: 1, children: 0
UpperBroccoli 11 points 3 years 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...

path: 0 311936, hotness: undefined, score: 11, children: 0
projectazar 6 points 3 years ago

I'd assume this is a product of space users being older and thus earning more, but that is wild speculation.

path: 0 295454, hotness: undefined, score: 6, children: 0
Korne127 6 points 3 years ago

Someone here made a longer explanation in a blog post why it's that way and what this corresponds to: https://evelinag.com/...

path: 0 306434, hotness: undefined, score: 6, children: 3
StarkillerX42 1 point 3 years ago

So people who contribute to open source use spaces more.Thiss is probably because in a collaborative environment, you can't guarantee how tabs will look on all systems, and it may look horribly on some. An open source project is most likely to enforce a standard, and that standard kind of has to be spaces.

It makes me wonder what portion of the stack overflow survey is from people who aren't working on collaborative projects at work.

path: 0 306434 327797, hotness: undefined, score: 1, children: 2
edward 4 points 3 years ago

But with tabs each contributor is free to choose how the indent looks. If it looks horrible on some system, that’s a configuration issue.

path: 0 306434 327797 335579, hotness: undefined, score: 4, children: 0
PlasmaK 2 points 3 years ago

Isn't that exactly the point of using tabs?

path: 0 306434 327797 343726, hotness: undefined, score: 2, children: 0
Crackhappy 5 points 3 years ago path: 0 322470, hotness: undefined, score: 5, children: 0
Joe_0237 4 points 3 years ago

So the two camps are:

spaces: who want to be able to have accidental fractional indentation and so they can force anyone who may read their code in the future to see the indentation at the size that they intended.

tabs: who want consistent bug-resistant and logical formatting, and for any future reader to decided for themselves thier own personal best indentation size.

A possible explanation: people who want it their way at the expense of others are more likely to choose spaces, and are more likely to feel at home at a company that does exactly that in order to extract more profit from thier victi... customers.

path: 0 357873, hotness: undefined, score: 4, children: 0
le_saucisson_masque 3 points 3 years ago

Casualty / coincidence

Edit: causality/coincidence

path: 0 301963, hotness: undefined, score: 3, children: 3
Cholsonic 2 points 3 years ago

Did you mean "causality" ?

path: 0 301963 328267, hotness: undefined, score: 2, children: 2
ninjan 1 point 3 years ago

Don't be mean to the tab user.

path: 0 301963 328267 328393, hotness: undefined, score: 1, children: 0
le_saucisson_masque 1 point 3 years ago

nop

path: 0 301963 328267 332228, hotness: undefined, score: 1, children: 0
Crackhappy 2 points 3 years ago

But what about their DTF?

path: 0 322410, hotness: undefined, score: 2, children: 1
Jimmycrackcrack 3 points 3 years ago

Down to fuckness? I suppose a greater score on this metric might help career in certain specific circumstances.

path: 0 322410 347872, hotness: undefined, score: 3, children: 0
Manbart 1 point 3 years ago

Well, spaces are superior, so…

path: 0 295626, hotness: undefined, score: 1, children: 0
StoryVander 1 point 3 years ago
path: 0 421649, hotness: undefined, score: 1, children: 0
StoryVander 1 point 3 years ago

I have to come in here and comment because I can’t let the slander continue.

You can use either spaces or tabs, both options are viable. There are different reasons to choose each. I am sick and tired of hearing elitism from people thinking they have the objectively correct answer. I’ve been in this debate for a long time and it’s more toxic now than it ever has been. It used to be that each camp fought for the virtues they liked about their choice. Now that accessibility is a mantra of the tab camp, that’s all they talk about and they assert that their values are the only ones that matter - without evidence.

There are plenty of good reasons to use spaces. The biggest of which is if you care about line lengths in any capacity. There are many reasons to care about line lengths.

  • Government requirements
    • Believe it or not, some projects still require code to be printed out, and how the code looks printed matters.
  • Heavy terminal use
    • Projects where code is frequently accessed though a terminal greatly benefits from a maximum line length.
  • Three-way merges
    • If you're ever in a situation where you want to see three versions of the code on a single screen, maximum line length matters.

I'm sure there are more.

If you use tabs, the only way to accommodate a maximum line length is to enforce a particular tab width. Which is almost always better to do by using spaces.

There is a reason almost every language style guide says to use spaces. Go is the only modern language I'm aware of that says tabs. It's mind-boggling to me that people will look at nearly the entire industry and say that they're crazy or malicious or uncaring. That obviously can't be true. The reality is that there are in fact decent reasons to use spaces.

And of course tabs are fine too. If you don't care about strict maximum line length requirements, then there isn't much of a reason to use spaces. There are few other reasons, but they're not very strong. So feel free, use tabs in your company and on your projects.

But drop the elitism where you assert without evidence that because a tiny minority of people have to spend a few hours of their time configuring their special tools to work with spaces the entire industry has to drop all their other values and preferences to save them that time.

Please, do feel free to disparage maximum line lengths, or bloated file sizes, or whatever else. Let the Holy War continue. I'm just sick of people pretending that the debate is over just because they say so.

If I had to venture a guess as to why spaces-users make more money, it's probably just because that's what all the tools are pre-configured for. People that just use the defaults and get going are likely more productive than those who rabidly obsess over something like whitespace. I expect the reverse would be true if tabs were the default. But that's pure speculation, I truly have no idea.

path: 0 421958, hotness: undefined, score: 1, children: 0
UnbeatenDeployGoofy 1 point 3 years ago

I let the editor handles the formatting, so I make no money

path: 0 374002, hotness: undefined, score: 1, children: 0
programmerhumor
programmerhumor

@lemmy.ml

login for more options
43743
1627
1185

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.

go to feed...