This is a document written using ReMarkable, a shorthand syntax for generating HTML.

{	"date"		:	201101192331,
	"updated"	:	201101192331,
	"licence"	:	"cc-by",
	"tags"		:	["annoyances", "web-dev"]
}

<section>

# Ode to Textarea #

<aside>
	Heavily inspired by <"~Textarea, you are a sunken nothing~" (//web.archive.org/web/20050816051837/http://www.whytheluckystiff.net/2004/05/20.html)>
</aside>

*Textarea, how do I hate thee?* _
Let me count the ways…

:: Undon’t:
	In Firefox, the text selection API is _so_ broken, _so_ useless that developers must replace the whole text of the
	textarea in order to insert something at the insertion point. The effect works as far as inserting, but it kills
	the undo, meaning that when you do an undo, the whole text gets selected.
	
	This has been like this since Firefox 1.0 and likely long, long before in the days of Netscape. This is failure on
	a 400 million user scale. _How_ does this slide? Does _nobody_ in Mozilla use a textarea, ever, never, not even
	once a day? IE has never had this problem. It has a proprietary text-selection API, sure, but at least it works.
	And ``contentEditable`` and ``XMLHTTPRequest`` eventually became standards, so there’s hope yet.

:: Search and Replace:
	Even Notepad supports this. Why, not only in 2011, but _fifteen_ years after textarea was added to HTML 2.0 and
	terabytes upon terabytes of text have been entered into it, has no browser vendor ever thought at any point that
	they should take a day to implement search and replace? This is procrastination on an epic scale.
	What the crap could distract an entire industry for 15 years?
	
	Imagine Microsoft had not yet gotten around to implementing search and replace in Word yet.
	
	I use VB6 (12 years old) when I need to code a simple native applications for Windows, and even VB6 can get this
	right. Hang your heads in shame, browser vendors.

:: Stop making me rush:
	You know why I write my articles in a proper text editor on an OS, instead of a textarea in a web form?
	Because for the last 15 years I have had it drummed—nay pummelled—into me that textarea is not to be trusted with
	valuable content. We have become conditioned to write our thoughts out in one sitting, as quickly as possible, and
	submit. _Nobody_ works on an article for a month in a textarea.
	
	Developers design web sites around this very notion that we must blurt out our intentions as quickly as possible
	and hurry on to the next page before the goblins break down the door.
	
	Imagine a web where I could work on a lengthy, reasoned comment to a blog post over a couple of days.
	Sure, I _could_ do that anyway—nothing is preventing me—writing the text in an editor and copying the text to the
	web, but people don’t. The design of web sites is incredibly powerful and suggestive and textarea throws us into
	a blind panic every single time.

	Comments on the web suck in part because textarea sucks.
	
	Sure many web browsers have session restore. Do you trust it? No, of course not. Do you copy your text before you
	press submit in case the web site you are using is so badly programmed it errors and either kills your text?
	Or the back button does.

:: Style:
	Why has this not been fixed in all these years? Sod existing content, a textarea being a few pixels out of place
	is not going to kill anybody. (((I would like to see that police repot)))
	
	<"Screenshot of two input fields and a textarea in Firefox, the textarea has a different border"
	 /&__HREF__;/firefox_fail.png>
	
	Incredibly, only Opera gets this right. Seems like they stopped to question the stupidity of blindly copying
	everybody else’s mistake.
	
	<"Screenshot of two input fields and a textarea in Opera, they all share the same style"
	 /&__HREF__;/opera_win.png>

* * *

*I don’t want an all singing, all dancing _replacement_ for the textarea.* I don’t want rich text formatting. I don’t want design mode and la-de-da hot new features. Even with all of these things, people will still need to _just type_ some plain text. These features can never replace textarea, they will only offer an alternative.

Browser vendors, stop for just one minute to realise that chasing after a never ending feature set has left you blind to the wake of usability failure you have left unfixed behind you for the last 15 years.

If you want to add something to textarea, don’t wait for a specification. _Nobody_ is interested. Don’t ask for permission, ask for forgiveness. Use vendor prefixes and just go _mad_. Full screen edit? Speech dictation? Syntax highlighting? bbcode helpers / autocorrect? Load / save to file? Inline translation? Detach and float so you can scroll and compare text? If you think it’ll help somebody. Standards can be worked out later once you have something so compelling everybody else just _has_ to implement it.

A billion lines of JavaScript will not solve this problem. It lies squarely with browser vendors, not authors. No amount of JavaScript can integrate textarea with the OS better. No amount of JavaScript will fix all the textareas on all the pages in the web.

Fix textarea now. Not later. Not after you’ve shipped some other constantly changing HTML5 feature. Not when someone else does so first. Now. Please accept the responsibility and the scale of the damage your lackadaisical attitude has wrought.

In centuries to come, a teacher will be showing children a graph of historical life expectancy and a child will raise their hand and ask what that little uptick is in the middle, and the teacher will reply "that’s the year when browsers fixed the textarea".

</section>