Live data from Hacker News

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

kyrylo.org

201–203 of 203 posts

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

#201
post #197

Earlier quoted context omitted.

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 {…

None of what you say here that is true moves the needle on what you say that isn't true.

Programmers using underscore to denote identifiers for internal use was well-established and in use long before ActionScript even appeared. To claim that it's a "direct descendant" of ActionScript is arbitrary, anachronistic, and odd.

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

#202

Earlier quoted context omitted.

In the Python world I was in, trailing underscores is used to work around the ban on reserved words. The language grabs some of the best names for itself! So a variable that really ought to be named `class` you name `class_`.

In java usually clazz

That's what I used to do before discovering this.

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

#203
post #44

> developers needed a way to explicitly tell the browser to open the link in a new tab, free of frame semantics First, it doesn't say why an underscore does that, because you could totally have underscores in frame names. My guess as others here is that the underscore prefix dates back from reserved names in C and C++. IIRC the reserved names also included "_self" (even if it was the default), "_parent" (to go up a l…

> IE was the most used browser back then, by a large proportion, and it didn't supports tabs at all. Internet Explorer barely even existed back then, it certainly wasn’t the most used browser. That came later. No browser had tabs back in those days.

I distinctly remember IE 5.x and 6.x on Windows and Mac OS with no tab support while Mozilla then Firefox (which had a much smaller users base) had them, at a period where HTML frames were still big.
Post reply on HN