Live data from Hacker News

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

kyrylo.org

191–200 of 203 posts

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

#191
post #155

Earlier quoted context omitted.

Why?

Because the JS version will likely take more resources and probably end up being done wrong anyways. I just don't get why front-end devs feel the need to reinvent everything. I mean, for fuck's sake, front-end devs for some reason have a fascination with reinventing fucking SCROLLING. And 100% of the time, it either doesn't work, has less functionality than what was built-in, or is annoying for the simple fact that i…

Scrolling is sort of a strawman here, so I’ll focus on blinking and css features and the need to reinvent these.

First, not all css features are consistent enough from the side you usually tend to approach things, due to various backgrounds and thinking modes. Css is notoriously overcomplicated, nuanced and ad-hoc applicable, and tendency to neglect it is its own self-imposed problem.

Second, there’s no law that dictated some true way to do things. People use instruments they know, and if these work, there’s no need to go and find true ways.

Overall, there’s no difference if you do something in js that css can do, apart from hurting someone’s feelings. All the difference you see is in multi-megabyte tracking scripts, not in js-dom chain per se. The difference betwen css and js ways is barely measurable when you start actually testing it. But js is more powerful in expression and familiar to a developer (except for 60fps+ animations and such).

I say this as a non-frontend dev who makes dashboards and other report/control pages for myself, so opinions may vary. But I’ve never seen a higher resource consumption from avoiding css. To my understanding, literally all sites I ever visited can be implemented in a straightforward way in js and will never “take more resources” and will work as fast as just html. Because it’s literally how any non-C GUI app works on desktops. An interpreted jit-able language controlling some widgets. It’s nothing new or unusual or bizarre. In fact, css is also a language, even if declarative, and keyframes structures and other calc()s also get interpreted many times per second, even if not using a full-blown vm.

In my opinion, people’s web bloat ideas are all over the place and miss the basics comletely, e.g. https://news.ycombinator.com/item?id=42990724 , and tend to blame wrong parts.

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

#192
post #74
post #41

So basically It’s an “_blank” because it is.. Author’s description is, “because if it wasn’t _blank.. it wouldn’t open a new tab.” Reminds me of some university professors I had.

When I built "webapps" in the 90s, they were a collection of frames. You could just do everything as one page, but there were some neat things you could do by dividing the page up into frames + internet connections were not very good so if you had something you needed to update a lot, it was easier to make it it's own .html and server it in an iframe. Because you could "NameAFrameAnyThingYouWanTED" they made some mag…

>(this is how you would bypass the ad some free .coms would inject into your site)

In anglefire and maybe geocities we would serve the document with a .txt extension and it would also skip the ads but browsers, with their liberal acceptance policy, would render normally.

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

#195
post #73

Earlier quoted context omitted.

Yes, many languages use `_` as a placeholder name, and at least in Rust any name starting with `_` is considered intentionally unused.

Aside: many IRC clients would auto-append _ when registering a nick if the desired nick was already registered. Why _? Who knows.

Probably because it has no specific meaning and being almost whitespace is the easiest to mentally ignore out of the set of valid nickname characters. `-` is another candidate but a programmer used to C-like languages will likely intuitively pick `_` just because it’s valid in identifiers unlike `-`.

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

#196
post #105

Earlier quoted context omitted.

This is a direct descendant of ActionScript. It introduced the convention of Instance._getter and Instance.__private.

That looks like ActionScript 2, so the javascript convention was actually well in place by then. I can't speak confidently about the late 90s, but I wouldn't be surprised if it predated Actionscript 1 as well. But doesn't it all trace back to C conventions anyways?

[deleted]

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

#197
post #105

Earlier quoted context omitted.

This is a direct descendant of ActionScript. It introduced the convention of Instance._getter and Instance.__private.

That looks like ActionScript 2, so the javascript convention was actually well in place by then. I can't speak confidently about the late 90s, but I wouldn't be surprised if it predated Actionscript 1 as well. But doesn't it all trace back to C conventions anyways?

Not at all.

AS1 was plain ES3.

movieclip._x or movieclip._alpha (as in position and alpha blending) were accessed by properties with underscore to denote that you were using accessors (getters/setters).

Internally properties like Object.prototype.__proto__ had two underscores to denote they were private.

In AS2 you had:

  class Foo extends Bar implements Xyz {
    private foo
    public function set x (value : Number) : void { ... }
    public function get x () : Number { }
AS2 was based on long forgotten ES4 specification [0]. Under the hood it was still, what we would call today, transpiled to ES3 bytecode, as it run basically on the same VM as AS1.

It's crazy to think it took us 10 years to reinvent the wheel with TypeScript.

AS3 was a complete rework, more akin to Java.

[0] https://evertpot.com/ecmascript-4-the-missing-version/

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

#198

[flagged]

Welcome to Hacker News. Defaulting to kindness, curiosity, and respect will help you get heard. I read the code included version of this comment and it seemed you had some potentially interesting contributions to add to the conversation.

[deleted]

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

#199
post #191

Earlier quoted context omitted.

Because the JS version will likely take more resources and probably end up being done wrong anyways. I just don't get why front-end devs feel the need to reinvent everything. I mean, for fuck's sake, front-end devs for some reason have a fascination with reinventing fucking SCROLLING. And 100% of the time, it either doesn't work, has less functionality than what was built-in, or is annoying for the simple fact that i…

Scrolling is sort of a strawman here, so I’ll focus on blinking and css features and the need to reinvent these. First, not all css features are consistent enough from the side you usually tend to approach things, due to various backgrounds and thinking modes. Css is notoriously overcomplicated, nuanced and ad-hoc applicable, and tendency to neglect it is its own self-imposed problem. Second, there’s no law that dict…

> Scrolling is sort of a strawman here

Fair enough.

And good points all around, especially in your linked comment.

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

#200
post #58

The answer is a little unsatisfying to me. It says that "blank" ca be a frame name, but doesn't say why "_blank" can't be.

In other answer they link to the original specification [1], and it says that names must start with a letter, so anything preceded by "_" cannot be a frame name. [1] https://www.w3.org/TR/WD-frames-970331#frame

Thanks
Post reply on HN