Live data from Hacker News

Why does target="_blank" have an underscore in front? (2024)

kyrylo.org

151–160 of 203 posts

Re: Why does target="_blank" have an underscore in front? (2024)

#151

Why did we move away from this model of web development? If I remember back that far, it seems like fairly soon after this was when the meta starting telling us that frames were bad, and using was bad, etc. It all honestly seemed a lot easier than what has come after.

The direct answer to your question is that the idea of "responsive" web design gradually took over when smartphones became popular. People liked the idea of not needing to create a separate mobile version of their frontend, and instead simply adjusting the styling and structure of the page in response to the size of the viewport. Tables were bad at this because you couldn't use CSS to arbitrarily move around the way…

> The direct answer to your question is that the idea of "responsive" web design gradually took over when smartphones became popular. People liked the idea of not needing to create a separate mobile version of their frontend, and instead simply adjusting the styling and structure of the page in response to the size of the viewport.

Table-based layout was already falling out of favour before this happened. Even when you had fixed sites that were predominantly desktop, divs and spans (coupled with CSS) made life a lot easier to put things where you wanted them and lay out a site faster. It was also cleaner when reading the markup.

From what I remember, the move away from tables happened around the same time external CSS took off and you could partition your site with reusable styling instead of framesets or tables.

Responsive design then sped up the process a few years later.

Re: Why does target="_blank" have an underscore in front? (2024)

#152
On this topic: Please NEVER use target=_blank. If the user wants a new window or tab, then they can open a new window or tab. There are so many websites where navigating around for a bit makes you end up with 5-6 tabs open, all with broken history, thanks to this mis-feature.

_blank is evil and user hostile. Don't be evil and user hostile.

Re: Why does target="_blank" have an underscore in front? (2024)

#153

On this topic: Please NEVER use target=_blank. If the user wants a new window or tab, then they can open a new window or tab. There are so many websites where navigating around for a bit makes you end up with 5-6 tabs open, all with broken history, thanks to this mis-feature. _blank is evil and user hostile. Don't be evil and user hostile.

It's too bad that you have to resort to pleading with the 10s of 1000s of web-site owners because the place where this problem is most easily addressed is with the 4 major browser owners (Apple, Google, Microsoft and Mozilla). I.e., they have the power to remove the _blank functionality from the browsers.

Re: Why does target="_blank" have an underscore in front? (2024)

#154

Earlier quoted context omitted.

The direct answer to your question is that the idea of "responsive" web design gradually took over when smartphones became popular. People liked the idea of not needing to create a separate mobile version of their frontend, and instead simply adjusting the styling and structure of the page in response to the size of the viewport. Tables were bad at this because you couldn't use CSS to arbitrarily move around the way…

> The direct answer to your question is that the idea of "responsive" web design gradually took over when smartphones became popular. People liked the idea of not needing to create a separate mobile version of their frontend, and instead simply adjusting the styling and structure of the page in response to the size of the viewport. Table-based layout was already falling out of favour before this happened. Even when y…

[deleted]

Re: Why does target="_blank" have an underscore in front? (2024)

#155

Earlier quoted context omitted.

> I'm so tired of having to write my own JavaScript to get annoying flashy text Fret no more: .blink { animation: blink 1s steps(2, start) infinite; } @keyframes blink { 50% { visibility: hidden; } } Lorem ipsum https://jsfiddle.net/xrkLt2nz/

If front-end devs would stop reinventing things using JS that can be done in CSS, I'd be so happy.

Why?

Re: Why does target="_blank" have an underscore in front? (2024)

#156

Earlier quoted context omitted.

The direct answer to your question is that the idea of "responsive" web design gradually took over when smartphones became popular. People liked the idea of not needing to create a separate mobile version of their frontend, and instead simply adjusting the styling and structure of the page in response to the size of the viewport. Tables were bad at this because you couldn't use CSS to arbitrarily move around the way…

> The direct answer to your question is that the idea of "responsive" web design gradually took over when smartphones became popular. People liked the idea of not needing to create a separate mobile version of their frontend, and instead simply adjusting the styling and structure of the page in response to the size of the viewport. Table-based layout was already falling out of favour before this happened. Even when y…

"Made life a lot easier" wasn't my experience. I always found early CSS much more fiddly than tables, and less capable in many ways.

It's funny looking back at this SO question from 2009, and its answers: https://stackoverflow.com/questions/426253/why-use-tables-to...

There was definitely an ongoing culture war between people who felt like using tables was not "proper", and people who just wanted their site layout to work consistently in IE6.

Re: Why does target="_blank" have an underscore in front? (2024)

#157
post #18

I was expecting this post to explain why it's an underscore specifically, as opposed to a dollar sign, an asterisk, a caret, a tilde or some other special character. I can only assume it's a holdover of languages like C where the standard library has some reserved names that start with an underscore. https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=10...

As another borrowed convention, JS developers of yore (and likely some today still) used an _ prefix to denote “private” function/methods. Quotes as it’s just a convention - today JS supports # for actual private members in class syntax.

Another weird case: In Google's server-side JS environment Apps Script, function names that end with _ are treated as private functions that cannot be called directly by the user or enumerated.

1. https://developers.google.com/apps-script/guides/html/commun...

Re: Why does target="_blank" have an underscore in front? (2024)

#158
post #18

I was expecting this post to explain why it's an underscore specifically, as opposed to a dollar sign, an asterisk, a caret, a tilde or some other special character. I can only assume it's a holdover of languages like C where the standard library has some reserved names that start with an underscore. https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=10...

As another borrowed convention, JS developers of yore (and likely some today still) used an _ prefix to denote “private” function/methods. Quotes as it’s just a convention - today JS supports # for actual private members in class syntax.

I use underscore to prevent shadowing of variables names. Not sure where I picked up that habit though.

Re: Why does target="_blank" have an underscore in front? (2024)

#159
Underscore prefix in a label has conferred a meaning of private or reserved in the C programming language since at least Unix Version 6 in 1975, which had underscores to denote system level functions and variables. MUMPS in 1966 reserved a % prefix to indicate system variables and routines, so a convention of using a non-alphanumeric character to distinguish scope has been around about as long as ASCII has been the dominant standard for text.

Re: Why does target="_blank" have an underscore in front? (2024)

#160

It's crappy design. Instead of using a separate property for different functionality like target-new-window=true or sth. They wanted to be clever. I think this is misinterpreting Simplicuty by thinking that an additional property is complicating things

That just opens the door for invalid combinations. As others said there is not only "_blank" but other special values like "_top".

  
Now the browser needs to define and document some kind of priority to solve those situations. If you can have only one target anyway why not simply give special targets special values.
Post reply on HN