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.

TheBananaKing , in PHP Moment

I don’t care that it’s outdated, everyone still needs to read eev.ee/blog/2012/…/php-a-fractal-of-bad-design/

Omega_Haxors , in wait what

Between this and their declaration to stop using C tells me they’re ramping up for cyberwar.

SendMePhotos , (edited ) in wait what

But like… Correct me if I’m wrong but in my experience tab does not always equal 4 spaces.

E: thanks all. I didn’t fully understand.

KairuByte ,
@KairuByte@lemmy.dbzer0.com avatar

You’re misunderstanding. In this case it means “one tab character” instead of “four space characters”.

dan ,
@dan@upvote.au avatar

That’s one of the benefits of using tabs. Some people might like 4 spaces for indentation, whereas others like 2 spaces. If you use tabs, you can configure your editor to use whatever tab size you want, and they’re just stored as tab characters in the file.

Tabs for indentation, spaces for alignment (eg for ASCII art).

gitamar ,

That’s why it’s also a big accessibility feature. With big font sizes, four spaces are distracting but you can configure tabs to show up as one character, which is way more reasonable with font sizes larger than usual

Waraugh ,

I had a colleague that is legally blind in my second real job. The dude is brilliant (and hilarious) but these things would significantly enable or screw up his productivity. I have always felt fortunate to have had direct butt in seat exposure to the importance of accessibility at such a young age.

MadBob ,

Four? Uh oh…

thechadwick , in wait what

I’ll just leave this here

youtu.be/SsoOG6ZeyUI

AVeryCleverName , in dont();

Import Driving.Self

mke , in PHP Moment

Php also graced us with Unexpected T_PAAMAYIM_NEKUDOTAYIM

MonkderZweite ,

Neku dota yim?

isVeryLoud ,

It’s Hebrew for double colon apparently, it came from the Israeli Zend framework PHP was based on. Some dev thought it would be funny to add an error in a language other than English.

Scoopta , in wait what
@Scoopta@programming.dev avatar

As a fan of tabs I see this as an absolute win

hakunawazo , in wait what

Let’s just avoid indentation at all (jk).
Always remember:
https://lemmy.world/pictrs/image/a621c906-0552-4ebb-b983-597b3d7ff938.jpeg

hansl ,

“He’s me.” - Obi Wan Kenobi

Fargeol , in When data training goes wrong

Plot twist: you were alone

Illecors , in C++ Moment

But it returned 139! That’s a start even without a debugger!

brisk , in C++ Moment

I have segfaulted in all those languages.

brisk , in wait what

The correct answer is, was and always has been elastic tabstops

pohart ,

Any ides have support for this? I feel like I’ve been waiting forever.

BatmanAoD ,

Essentially no. I wish so badly that this had taken off.

Edit: as noted on the website, various plug-ins that attempt support are in fact not correct.

thedevisinthedetails ,

What do you mean? There’s a ton of working plugins listed on the website for many editors.

BatmanAoD ,

Sorry, my phrasing was sloppy. Most popular IDEs and editors do not have a plug-in or setting that implements elastic tabstops correctly. In particular, there’s no implementation for vim, emacs, VSCode, eclipse, or any JetBrains IDEs. (I had forgotten that there’s one for Visual Studio and one for Notepad++.)

Euphoma ,

Looks like there’s an emacs package for elastic tab stops.

KairuByte ,
@KairuByte@lemmy.dbzer0.com avatar

Of-fucking-course there is.

dan ,
@dan@upvote.au avatar

Wow this site is hard to read, at least on mobile (haven’t tried on my PC). The line-height is too small.

fidodo ,

I’ve been hoping someone would try that!

DannyBoy , in C++ Moment

It’s been a minute since I used C/Cpp but if you compile with debugging symbols and using gdb give you info like in Java? At least the location of the crash.

Miaou ,

And then you realise the program doesn’t crash when compiling with debug symbols 😢

Buddahriffic ,

Then it’s time to have a closer look at how your concurrent threads are behaving and where you missed a sync point or mutex.

mrkite ,
@mrkite@programming.dev avatar

That’s when you break out valgrind because you certainly are using uninitialized memory.

Ziglin ,

And much more, it tells you each operation it goes through, where it is in the code, what’s in the registers and more.

mexicancartel , in wait what

Yay at least this comment section has majority tab lovers!

mindbleach , in wait what

Tabs exist specifically for spacing out stops. They’re viewer-configurable, avoiding holy wars about 4 or 8 or that one idiot suggesting 3.

I do not give a shit if your seventeen-argument function has the overflow variables line up exactly with the paren. Just put them one step further in.

mindbleach ,

I just remembered the dumbest argument I’ve ever suffered about this - someone insisting the “length” of one tab changed, depending on what’s before it. As in, is it eight spaces, or seven? Or six! It only goes up to eight spaces! No. It goes one stop. The same way a newline goes one line, and cannot by measured by how many times you’d slap the spacebar to get text to wrap around to the next line.

kogasa ,
@kogasa@programming.dev avatar

Err, why would there ever be something besides a tab before a tab? Are we doing ASCII art?

dan , (edited )
@dan@upvote.au avatar

They mean if you insert a tab after some other text.

Word processors and desktop publishing apps tend to have tab stops (sometimes visible in a ruler at the top of the page) and pressing tab goes to the next tab stop. They’re about an inch apart (assuming letter or A4 paper) by default, and you can usually also add your own tab stops. For example, you might have text like this:


<span style="color:#323232;">Hi
</span><span style="color:#323232;">Hello
</span>

Assuming the next tab stop is to the right of both words, pressing tab at the end of each one would actually bring you to the same indentation level:


<span style="color:#323232;">Hi      |
</span><span style="color:#323232;">Hello   |
</span>

Text editors and IDEs don’t do that, and instead make all tabs the same size regardless of where they are.

Some people want the word processor implementation in text editors though. The comment you replied to is saying that’s dumb, and I agree with them.

kogasa ,
@kogasa@programming.dev avatar

I understand… In a programming environment 99.999% of tabs aren’t after any other text.

pohart ,

Your ide should align things how you configure them to be aligned. Nothing says all my tabs need to be the same length.

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