There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

force , (edited ) in codeStyle

snake case for everything, pascal case for struct/enum/class/trait names, and screaming snake case for constexpr identifiers is the superior method of naming. FUCK camel case, java/c# naming conventions are dumb and stupid and cringe, rust did it right

i’m in pain every time i use scala/f# or something and i have to actually interact with those HEATHEN java/c#-conformist identifiers

mox ,

screaming snake case

What a great name for that style. Thank you.

GeniusIsme ,

Apart from screaming case, which is for textual macros, i approve.

NegativeLookBehind , in Company forgets why they exist after 11-week migration to Kubernetes
@NegativeLookBehind@lemmy.world avatar

I read somewhere that Volkswagen has about 900 K8s clusters. I feel that there is a direct correlation between this and the quality of their shitty cars.

DudeDudenson ,

Seriously curious here, what cars would you consider not to be shitty?

NegativeLookBehind ,
@NegativeLookBehind@lemmy.world avatar

Toyotas, mostly.

RGB3x3 ,

Mazdas too.

NegativeLookBehind ,
@NegativeLookBehind@lemmy.world avatar

True, just not the rotaries ;)

marx2k ,

Honda

fuckwit_mcbumcrumble ,

Mostly the non German ones.

DudeDudenson ,

Interesting, maybe I’m just used to living in south America where even the crap German cars are better than the “premium” Brazilian and Indonesian cars we get

fuckwit_mcbumcrumble ,

Down in Costa Rica I’d definitely take a VW over the invasion of Chinese cars.

But in the United States? I wouldn’t touch those overly complicated POS. The ones we get aren’t the simple cheap ones for outside the US market.

crispy_kilt ,

That’s not unusual, my company has an internal K8saaS product as well, so there are a lot of clusters

backhdlp , in C++ Moment
@backhdlp@iusearchlinux.fyi avatar

Meanwhile Rust: you might get an error at line 45 word 3 because it assumes variable foo is an int32 but it could be (whatever else idk), let’s not compile this before you correct this by changing line 43 in this specific way. Here’s the before and after code snippets so you can just copy-paste the fix.

TxzK ,

Man I fucking love the Rust compiler. Easily the most understandable and useful error messages I’ve ever seen.

skulbuny ,
@skulbuny@sh.itjust.works avatar

Have you seen Elm’s error messages? They were what inspired Rust to have its error messages.

Asudox ,
@Asudox@lemmy.world avatar

I like how Elm error messages are like the compiler talking to you as a person.

anton ,

In my IDE there us even a button for accepting the compilers recommend fix. This is only possible because the error messages and recommendations are that good.

agent_flounder ,
@agent_flounder@lemmy.world avatar

Hm. Rust sounds better and better every time I hear something new about it.

jamesthurley , in Should I file a bug report? 😀

Off topic, but what terminal font is that? The nerd font icons are a very generous size.

snaggen OP ,
@snaggen@programming.dev avatar

That is wezterm which have builtin Nerd Font fallback, and I actually think WezTerm renders it to wide to fit it better with other fonts. But the rest of the font is JetBrains Mono

ryannathans , in Should I file a bug report? 😀

I think it blows up because you need the Swedish calendar for the date to be valid, our calendar doesn’t have this day. The date occurred when Sweden used a different calendar

TWeaK , in Old xkcd, I can't see it ever not being relevant

“Old”. This was after I started reading it.

At the same time, it’s about 1200 strips before the latest, which is like 7 years ago? But still not even halfway back, not quite.

Man, he’s been around since forever.

smeg OP ,

Yeah same, I’ve been reading them all again and I didn’t check when it was originally posted but it seemed far enough from today to count as old!

isVeryLoud ,

7 years ago is just 2016

TWeaK ,

Why did you have to say that?! RIP Robin Williams :(

isVeryLoud ,

goddamn it, it’s been this long? rip.

TWeaK ,

Yeah man, loads of good people died in 2016, it was a whole thing.

deegeese , in Company forgets why they exist after 11-week migration to Kubernetes

I think they’re describing my company’s upcoming GCP -> AWS migration.

slazer2au ,

Hope you are getting a rebate on those egress fees.

sag , in I need this....

It’s not working It make my code look pretty not shitty 3/10

Kissaki , in Company forgets why they exist after 11-week migration to Kubernetes

The site name’s a play on “The Onion” so it’s gotta be satire, right? I couldn’t find an about page to confirm.

Yes, it’s satire.

The page is run by one author www.theolognion.com/about and no description or goal described

Runs on “substack” platform (standard software)

The story reads like a story, and the mentioned company does not exist

redcalcium , in wait what

The sole purpose of the tab key is for instructing the editor to insert four spaces.

Buddahriffic ,

*three spaces.

Actually, let’s make that two.

absentbird ,
@absentbird@lemm.ee avatar

2 space gang represent.

theneverfox ,
@theneverfox@pawb.social avatar

They fear us. We have to hide in the shadows.

But this is just one more example of our superiority - a perfect compromise between the file size and the nightmare that is two different invisible characters

Liz ,

Cycling through buttons, atl+tab, Ctrl+tab, some other fourth thing.

redcalcium ,

something something real linux users don’t use gui and tab completion

Liz ,

You can take my Cinnamon GUI from my cold dead hands.

mexicancartel ,

To insert a… TAB. Not four or any n number of space but TAB

redcalcium ,

After years of ass-whopping by python interpreter for stray tab characters, I’m now mentally rejecting the existence of tab character in my computing devices.

mexicancartel ,

Isnt that only because you “mixed” spaces with tabs? I have had no issues with python and tabs with no spaces for intendation

hansl ,

Yep the ASCII table just goes 1, 2, 3, 4, 5, 6, 7, 9, 10, …

corsicanguppy , (edited )

And indent according to my major mode.

Lizardqueen , in You could say, I am an odd person!

But… Both of these functions are odd?

Artyom ,

I’m not convinced OP has covered even and odd functions yet, best to not confuse him.

PhobosAnomaly , in dont();

Don’t

simple really

GregorTacTac ,
@GregorTacTac@lemm.ee avatar

"Whatever you do, don’t.

HerbalGamer ,
@HerbalGamer@sh.itjust.works avatar

holy shit that’s a cool project

Mango ,

Wot

Mango , in dont();
Artyom , (edited ) in Java...

I have a coworker who has 4 curved ultrawide monitors on his desk.

Edit: I checked by his office today, and it’s actually 3 ultrawides and 2 flat monitors. Sorry for misrepresenting the facts y’all.

morrowind ,
@morrowind@lemmy.ml avatar

Does he have them loop around 360?

r00ty Admin ,
r00ty avatar

A 360 ring of curved monitors. You could get two pixels, and accelerate them around the ring in opposite directions then collide them at close to the speed of light.

Wappen ,

Imagine the new colors we could discover

hakunawazo ,

After train, farm and goat simulator, now LHC simulator.

KinglyWeevil ,

4 doesn’t feel like enough to make the full curve but I bet its starting to get close. 8 is probably what you’d need for to truly encircle yourself

Artyom ,
XTornado ,

I would understand that for gaming, specially simulation stuff like car/planes or similar… But when working that sounds crazy, unless he has big as fuck dashboard with all kind of things being monitored.

SzethFriendOfNimi , in wait what

I know it’s a joke but I prefer the tab option. It’s easy to convert tabs to any particular spacing or code point width. It can also vary, if wanted, based on terminal or editor type.

People with worse eyesight can have a wider indentation while those who choose can opt for something more compact

kakes ,

I can’t imagine it would be difficult for an IDE to scale the width of spaces found at the start of a line, to emulate this same customization while still preserving my sanity as a fervent space-indenter. I’ve never seen an IDE that does this, but it’d be an interesting compromise.

Maestro ,
@Maestro@kbin.social avatar

It's not difficult at all, and many editors and IDEs already support this, making the entire point moot. Just do whatever the style guide says. I'm into PHP and Python so for me it's spaces all the way.

LaggyKar ,
@LaggyKar@programming.dev avatar

How can it tell the difference between spaces used for indentation and spaces used for alignment, if you use the same character for both?

lud ,

I guess the indention sizer thing knows how the formater works and adjusts accordingly. I can’t imagine it would be too much of a problem.

Iirc Jetbrain IDEs has a feature called dynamic tabs/space (or something like that) which uses exclusively tabs until it needs to align something and a tab doesn’t fit, so it uses a few spaces instead.

coloredgrayscale ,

Maybe alignment more for the righthand side of assignments. If you have a block of variables with different name lengths, or within a constructor / function call.

MotoAsh ,

All parsers ignore a shitload of whitespace already. Just compare unformatted code, COMPLETELY unformatted code, code without character returns, and it’ll become obvious how any given language is interpreted around whitespace.

Also fun to see just how infrequent a semicolon is ‘actually’ needed to tell when the end of a statement is here.

fidodo ,

What if instead of having the IDE special case space characters at the start of a line, we had a special character that could represent a variable width space?

kakes ,

What if we did that, and then wanted to align something?

fidodo ,

Then you use the variable width space for code indentation, then, when you’re at the code indentation level, you’d switch to spaces for alignment. If the IDE special cased all space characters at the start of the line you wouldn’t have that flexibility. You could also easily create a linter that ensured that the variable width space always has the correct indentation level, and ignore the standard space characters after it.

kakes ,

You’re entirely correct. Plus, I hate the idea of changing the width of spaces for any reason lol.

fluckx , (edited )

Honestly I always preferred tabs for indentation and spaces for aligning. It doesn’t break anyone’s experience. And if somebody wants two spaces for a two-space-tab-width for indentation and other people prefer four. That will work just fine.

I hate seeing 2 space indents. Unreadable AF ( to me ). At least this way I can easily work in the same codebase without somebody being annoyed ( except for the crying about the tabs )

jadero ,

Why not tabs for both indentation and alignment? (Actually, I see indentation as just a specific use of alignment.) Word processors have been doing it for decades (and typewriters for over a century!). Surely we can convince our code processors to use user-definable, fixed position tabs instead of relative position “tab = x spaces”.

Keeping the [TAB] character in the file then allows everyone the layout they like.

Or has working solo for 40 years fried my brain?

fluckx ,

What I mean with tab = x spaces is only visually and not actually ( there will ( obviously) still be a tab character in my preference. Not sure if that was clear.

Because alignment are fixed characters compared to indentation. For indentation the only question is how many characters the next indentation needs to be.

For alignment it is not fixed. As an example of PHP code:


<span style="color:#323232;">function test(</span><span style="color:#0086b3;">&amp;</span><span style="color:#323232;">obj) {
</span><span style="color:#323232;">$obj->doSomething()
</span><span style="color:#323232;">....->doSomethingElse()
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span>

The dots would be spaces because in IDEs people generally use a font where every character is equally wide.

If I would tab again instead of spaces it could work out if my tab length display is ( for one or more ) adds up to the width of the variable $obj. If somebody else has a tab width of 2 rather than somebody who has 3. It would only align for one of the two people.

Does make sense? I typed it out after a gym session on my phone.

Additionally. The whole problem is resolved by using spaces for both alignment and indentation. But in the cursor would still jump one space at a time rather than the whole tab ( although there are keyboard shortcuts for jumping words which would jump all of em.

I don’t know. Call me old fashioned. I like what I like :/

jadero ,

If I correctly understand what you are saying, you are describing “relative” tabbing, where /t moves a constant distance from the current position. I prefer “stopped” tabs where /t moves to the next tab stop. If my /t doesn’t create the spacing/alignment I’m after, I just tab to the next position.

Thus, I would set mine with the first tab position (for indenting) at 1.5 cm and subsequent tab stops at 3, 4, 5, … cm. That way I’d get perfect alignment with both fixed and proportional fonts.

I’d also set line-wrap or line-continuation to use a hanging indent based on the start position of the line being wrapped or continued.

I’d also set a boundary between code and comments so that lines always wrapped before the boundary and using the comment character at the end of a line would jump to the other side of the boundary with optional leaders (the characters, usually periods that connect the end/beginning of a gap). In an ideal world, I would be able to “hide code”, pulling all the inline comments into a “hanging indent” structure with their “parent” comments.

Yes, before the advent of IDE editors and all the fancy intellisense stuff, I used word-processing software for coding. 😀

vithigar ,

If I correctly understand what you are saying

You did not, but he also picked an example that could be conflated with the 4-spaces issue.

They’re talking about situations where you might want to align text by a number of spaces that isn’t divisible by your tab size. I’ll expand on their example:


<span style="color:#323232;">function test(&obj, &obj2, &a) {
</span><span style="color:#323232;">$obj->doSomething()
</span><span style="color:#323232;">....->doSomethingElse()
</span><span style="color:#323232;">
</span><span style="color:#323232;">$obj2->doSomething()
</span><span style="color:#323232;">.....->doSomethingElse()
</span><span style="color:#323232;">
</span><span style="color:#323232;">$a->doSomething()
</span><span style="color:#323232;">..->doSomethingElse()
</span><span style="color:#323232;">}
</span>

Again, dots are “visible spaces” in this example, and being used to align chained methods with the length of the object name.

jadero , (edited )

Edit: Bear with me while I sort out the difference between my display and the resulting code block. Ok, close enough.

Ok, thanks. I would instead (and prefer to ) do something like this:


<span style="color:#323232;">function test(&obj, &obj2, &a) {
</span><span style="color:#323232;">$obj---->doSomething()
</span><span style="color:#323232;">---->--->doSomethingElse()
</span><span style="color:#323232;">
</span><span style="color:#323232;">$obj2--->doSomething()
</span><span style="color:#323232;">---->--->doSomethingElse()
</span><span style="color:#323232;">
</span><span style="color:#323232;">$a-->--->doSomething()
</span><span style="color:#323232;">---->--->doSomethingElse()
</span><span style="color:#323232;">}
</span>

In this case, the “>” are showing the tab stops and the “-” the resulting white space. Note how all the calls are lined up. (My preferred alignment style, not necessarily anyone else’s.)

Yet another edit: I see that I missed addressing alignment on other than tab boundaries. To me, that’s just sinful! 😀

fluckx ,

Correct. The way I’m used to it ( and how I thought the world worked ) is that the IDE gives tab a fixed length or characters. If you set it to 4 it would be the equivalent of 4 spaces or 4 letters or whatever.

If my tab is set to 4 it would take up the width of 4 characters. If I need two indentations I would press tab twice.

If bob then checks out my code and calls me a maniac and sociopath for using indentation and swears by “2”, the code would just look more condensed. The alignment would still work out because that’s done through spaces.


<span style="color:#323232;">var user_name = "Bob"
</span><span style="color:#323232;">var user_age[tab]= "Bob"
</span>

This would align the = for Bob, because it needs two characters to align and that’s what his tab width is. It wouldn’t align for me because my tab width is 4. So I would.pur two spaces instead of the . That way it is aligned for everybody regardless of their tab width settings.

The way you explain it sounds like how tabs works in MS Word ( or other word processors ).

I don’t think I could work like that. I’ve only ever used IDEs to code ( regardless of how primitive they were back when I started). Interesting take though :D

jadero ,

The way you explain it sounds like how tabs works in MS Word ( or other word processors ).

That is exactly how they work, and after 40 years, I still struggle with the whole “tab as a shortcut for spaces” thing. It’s not that I started with word processors, either, just that as soon I started working with them, everything got so much easier for me.

There are some code-specific things that keep me from just going back to a word processor, but I think our code editors are missing some useful features that are found in word processors.

fluckx ,

Generally I’m not very preoccupied with it as the IDE just formats it the way I like it on save :D.

azertyfun ,

The fact that you had to explain this is the reason why tabs are inferior in practice. People just don’t get it and then in collaborative projects you get a completely misaligned mess because not everyone has the same tab size.

fidodo ,

Yeah, I understood the arguments against using tabs for alignment, but never really got the argument against using them for indentation.

kureta ,

I agree, tabs are better but I have been using spaces for so long I can’t even imagine switching to tabs. also I’d have to reformat all my abandoned projects.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines