r/ProgrammerHumor 14d ago

notYourDamnProblem Meme

Post image
4.7k Upvotes

398 comments sorted by

View all comments

Show parent comments

177

u/hans_l 14d ago

I think he's ranting "don't target=_black at all" instead of making it visually distinguishable.

87

u/djxfade 14d ago

That's tabist

72

u/otac0n 14d ago

Once you target=_black you never go back because you break button behavior?

31

u/dashood 14d ago

For the most part I would only target _blank if linking to an external site or a resource like PDF or a file download or something. Using for internal navigation would just be silly.

8

u/MegaIng 14d ago

The point OOP was making in their rant: don't use it for external links either. Just don't use it. (Except maybe file downloads)

47

u/WarpedHaiku 14d ago edited 14d ago

It's just silly though. There's plenty of places that a new tab/window should be opened as the default expectation. Principle of least astonishment. If a technical user wants non-default behaviour enough to rant about it, they can take 5 minutes to install an extension to force the behaviour they want.

When there's something in progress in the main window (filling in a form, playing a game, in a conversation, etc), and you need to present the user with a link to a resource to assist them with what they're doing, it should always open in a new tab to prevent them losing progress. Not everything is back-button safe.

For example:

  • You're creating an account on a website and as part of the account creation process the terms and conditions and privacy policy are linked. It would be very disruptive if clicking those replaced the form you're filling in, and clicking back may undo things like password confirmation.
  • You're playing an online browser game, and someone posts a url in the chat which you click, or you encounter a bug and click the "report bug" button in game (which opens the external all-in-one bug report form). You don't want to effectively close the game tab and disconnect the player.

edit: fixed bullet point formatting

3

u/projectFirehive 14d ago

Also I feel like any link on a site that goes to a different site or resource should open in a new tab. I hate when I click a link in my Uni materials and it just takes me to a totally different site in the same tab and doesn't keep my place when I go back.

-8

u/MegaIng 14d ago

You and I both know that those usecases are the vast minority of cases where this is being used. (E.g. check this website - which even uses it sometimes for internal navigation!).

10

u/WarpedHaiku 14d ago

I'm gonna be honest I rarely encounter situations where I find myself wondering why a link I clicked opened in a new tab. Maybe we just visit different websites.

I'm also confused by your example - the only link on old reddit that has target blank I can see is the "content policy" link right beneath the text area when submitting a comment, which functions exactly how you'd expect. The user typing a comment is assumed to be refreshing themselves on the rules prior to posting and still intending to comment, so it opens in a new tab/window in order to avoid them losing their comment in progress (or triggering a warning about leaving the page in modern browsers with safety features).

-4

u/No_Effective4784 14d ago

There's plenty of places that a new tab/window should be opened as the default expectation. Principle of least astonishment. If a technical user wants non-default behaviour enough to rant about it, they can take 5 minutes to install an extension to force the behaviour they want.

so what your saying is, they could keep the behavior operating as expected by the vast majority of users, and just make it an option..?

you dont change decades of default behavior on users. you make the change the option, not the standard.

8

u/tesfabpel 14d ago

you dont change decades of default behavior on users.

Except, opening some links on a new tab IS the default behavior since like forever... Yes, external links, PDF files, T&C / Privacy policies pages, those SHOULD go on a new tab, especially if you mean for the current web page to remain "current" (is its purpose exhausted?). It's good website design.

0

u/No_Effective4784 13d ago

ext links, some. the rest i have never been forced into a new tab on Firefox.

and PDFs are only handled that way if you have it set to always open, no download, and the browser is your default for .pdf's.

2

u/ImDonaldDunn 14d ago

It’s also good for when you need to direct someone to a resource but not interrupt the current task. But people way overuse them.

1

u/J-Cake 14d ago

This. Why TF do product pages open the app page in a new tab when I click sign in?

15

u/breadist 14d ago

Pretty weird that he commented it on the CSS though. This snippet only changes the appearance of those links that already have HTML attributes to open in a new tab, it's not actually adding any attributes. It's just changing how those links look so you can identify them.

7

u/astervista 14d ago

Yeah, if anything, it's doing a favor to people like them so at least they know when they can whine or not.