Hacker News

6 hours ago by bombcar

For people involved with technology I think this is a perfect response to "how hard can it be" - no matter if they're discussing how to keep toilet paper stocked or why cURL can be replaced with five lines of shell script - it emphatically shows how complicated something apparently simple can be once you start diving into it.

4 hours ago by colllectorof

More often than not a problem that looks simple and has insane complexity once you dig a bit deeper is based on some faulty assumptions. Assumptions that either changed over time or never made sense to begin with. The wast majority of software systems out there are significantly simplifiable. However, not all developers are willing to analyze and question fundamental assumptions about systems they deal with. Most, in fact, are far more comfortable learning to jump through arbitrary hoops. They then brag about their "expertise" in the "domain" (which often doesn't even exist outside of software).

3 hours ago by leoc

Alan Perlis' old motivational-poster slogan "Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it." has a fair bit going for it.

2 hours ago by oneeyedpigeon

I love that apart from the "Some can avoid it" bit — feels out of place with the rest. Who's "some"? Pithy slogans often come in three parts rather than four; I love the overall message, I think I'd just prefer it with that 25% removed.

2 hours ago by alex_smart

Does that mean that Geniuses would be terrible software engineers, since removing complexity is seldom the right thing to do business-decision wise?

2 hours ago by notriddle

> More often than not a problem that looks simple and has insane complexity once you dig a bit deeper is based on some faulty assumptions.

Okay, I'll bite.

What are the faulty assumptions that cause text editing widgets to be so complicated?

an hour ago by exporectomy

Perhaps the assumption by Unicode that we need emoji modifiers instead of just more emojis. All ~2000 valid combinations are enumerated anyway and many require different images so they're effectively different isolated characters.

an hour ago by madhadron

That text is a sequence that we edit by having a cursor into it as opposed to a specialized form of graphics, maybe? We've inherited the controls of a typewriter (which provided a very simple graphical model for a narrow range of languages), but maybe they aren't what we need?

2 hours ago by bsder

> The vast majority of software systems out there are significantly simplifiable.

I think exactly the opposite, actually.

Most programmers don't just write lines of code for no reason. They generally stop when the problem is solved.

So, you might be able to simplify new programs, but I wouldn't put a lot of money on it. The programmer would have had to miss something architecturally up front for that to be the case. It happens, but it's not that common.

So, you might be able to simplify production programs. Maybe, but those have a lot of bug fixes already implemented. And they encode the political state of the entity that built it (see: microservices). So, a program that has existed a while may not encode the current political system, but I don't think fixing that is making things simpler.

So, you might be able to simplify legacy programs. Perhaps, but those have a LOT of business state encoded in them--much of which is still used occasionally but you won't know that until you do a deep dig on the code. That rule for disbursements to Civil War descendants is there because the system still needed it up until a couple years ago.

Oddly, the best way I have found to simplify computer systems is to give the humans more power. Humans are good at exceptions; computers not so much. This is, sadly, anathema to modern programming and modern political/corporate structures.

an hour ago by alex_smart

>The programmer would have had to miss something architecturally up front for that to be the case. It happens, but it's not that common.

It is very, very common indeed. Seldom is software created with all the requirements and complexities of the problem known upfront. In fact, very often the process of development of the software itself reveals all the different ways in which the original specifications were imprecise and not completely thought through. And new features and requirements get added onto later all the time.

Software is created in an iterative process of feedback and development. At each stage, the programmers takes the shortest, most straightforward approach to solve the problem. When the programmers are not careful (or just lazy) they inadvertently add dependencies that shouldn't exist and make the whole thing more complex. Of course, any single infraction seems innocent enough, but eventually you almost always end up with software that is much more complex than it needs to be.

Here is a talk on how software is too complex all the way from 2006. I am more than confident that the problem has only gotten worse in last 15 years.

https://www.kernel.org/doc/ols/2006/ols2006v1-pages-441-450....

11 minutes ago by p1necone

You must have above average programming peers. It's my experience that architectural decisions that could cut future work by orders of magnitude are quite commonly missed.

an hour ago by ratww

> Most programmers don't just write lines of code for no reason. They generally stop when the problem is solved.

If only. Over-engineering is definitely a thing. And programmers definitely miss something more often than not, even when over-engineering. Or even: especially when over-engineering.

2 hours ago by cgriswald

I think there's some context that matters. I often don't need the full functionality of Ăźbertool and can implement the functionality easily because I don't have to worry about 90% of use cases with their associated edge cases. It's dead simple to keep toilet paper stocked in my house. But I would not use the method I use for my house to run inventory for a grocery store chain.

2 hours ago by shard

That's exactly the point. The "how hard can this be" comments are often applying an individual use case, where corner cases can be ignored or worked around, to an enterprise situation, where corner cases may hit some legal constraints (e.g. accessibility) or may no longer be corner cases once in enterprise-scale (e.g. multiple languages / currencies / time zones).

6 hours ago by 7373737373

This seems to be the ideal occasion to show off my latest pet project: https://icebergcharts.com

2 hours ago by shard

Wasn't there a post or (most probably) a comment recently (within a month or so) with an iceberg chart? It looked very much like this site, but I can't find the right subject. Someone even commented that one of the best links in the chart was to a fictional story on the site itself. For the life of me I can't recall what the subject of the iceberg was, except that I think it was technology related, but I did spend several hours digging through all the links.

2 hours ago by 7373737373

Yep, that's where I got my inspiration (and some CSS) from, and I also link to it in the footer on my site: https://suricrasia.online/iceberg/ :)

2 hours ago by shard

Ah, found it in search. It was this one:

The Cursed Computer Iceberg Meme

https://suricrasia.online/iceberg/

5 hours ago by LeifCarrotson

I appreciate that "making a ****ing iceberg chart" is at the bottom of the Hobbies iceberg :)

3 hours ago by benboughton1

For someone not overly ear to the ground culturally this is a rabbit hole. The Youtube one fascinates me. I've not heard of most but imagine there are hundreds of interesting stories behind every item. Interesting work and concept. Well done.

4 hours ago by noofen

This is fantastic. My only wish is to be able to export them as a PNG... maybe add a small watermark so people can find you.

4 hours ago by SavantIdiot

See! Irony at work: it wasn't good enough for you so you wanted a feature. That's where it all starts. I'm not dissing you, I'm pointing out how innocuous feature creep can be.

4 hours ago by 7373737373

If you scroll down there is "Download as Image" :)

I'll try to create an unobtrusive watermark

4 hours ago by tonyedgecombe

Strings, dates, floating point, even true and false are messy in some languages.

4 hours ago by pcwalton

> Jonathan Blow, in a talk about how software is getting worse, points to the example of Ken Thompson's text editor, which Ken built in a single week.

This kind of sentiment drives me crazy. Yes, internationalization makes things harder and more complex than they were in the old days. But, back then, only people who lived in one small part of the world were able to usefully use computers in their language. (Simply supporting the Unicode character set is not enough.) Nostalgia for the simplicity of the past ends up having ugly cultural implications. It's easy to say "let's go back to the time when things were simple"; it's a lot harder to say "folks in (e.g.) Israel shouldn't be able to type in their native language".

3 hours ago by colllectorof

>Nostalgia for the simplicity of the past ends up having ugly cultural implications. It's easy to say "let's go back to the time when things were simple"; it's a lot harder to say "folks in (e.g.) Israel shouldn't be able to type in their native language".

This is a ridiculous mischaracterization of what Jonathan Blow was talking about.

Here is the full presentation. Very much worth watching in its entirety and thinking about:

https://www.youtube.com/watch?v=pW-SOdj4Kkk

2 hours ago by slmjkdbtl

> This is a ridiculous mischaracterization of what Jonathan Blow was talking about.

I watched the full presentation and agree with almost everything he said, but I can't find a part matching the conflict between "Simple text editor Vs. Complicated character encoding scheme / rendering / formatting". How would JB make a text editor that works with any kind of character?

an hour ago by alistairw

I agree with the sentiment you're getting at about nostalgia for the past sometimes ignores the homogeneity of the people using those systems and how that reduced complexity. I do think there's an argument there that needs to be explored further to identify what is actually simple and hard/complex in computing.

However, I think this point about how JB specifically would make one with any type of character is not the best direction for exploring that. He's made games and his own presentation software (Used in the presentation linked above) which is able to do that. I doubt he would classify that as one of the actually hard aspects of computing.

an hour ago by peoplefromibiza

upvote and a giant thanks!

this video should be mandatory in every school on the Planet.

22 minutes ago by titzer

> It's easy to say "let's go back to the time when things were simple"; it's a lot harder to say "folks in (e.g.) Israel shouldn't be able to type in their native language".

Is writing a text editor literally so hard that we can't do it twice (or three, or five times)?

There are literally trillions of lines of code in existence now. Instead of making a five hundred thousand line text editor because are terrified of writing one again, maybe we make five ten thousand line editors?

Of course, I'm exaggerating, but do you get my point? There are worse things than duplicated code. Narrowing the requirements for latin and cyrillic left-to-right languages so their code can be made radically simpler seems well worth it! The specialization necessary to make a text editor do Hebrew well, or Chinese or Arabic well is probably way different, and frankly, better done by experts in those languages. From their perspective, to completely flip it around, why should their editors be encumbered by the need to support English? Instead we end up with the proverbial "Jack of all trades, master of none". And we end up with radically complicated, hard to test, terrified-of-breaking-a-language-I-don't understand code that serves no one well.

Editors don't have have to completely diverge in features and feel just because they might have different code bases. Surely we can try to make copy&paste and select all and the common things operate in a fairly standard way across a few different programs.

3 hours ago by hannasanarion

Especially since the text editor in question is `ed`, which is not exactly a pinnacle of utility. We're really comparing apples to moon rockets here.

3 hours ago by qsort

`ed` was developed in 1969. That's a remarkably uncharitable take, considering `ed` itself and its derivatives (like `sed`) are still useful today.

2 hours ago by Groxx

This is accurate in the same way as saying "a rock chiseled into a wheel with a stick as an axle is still useful today". Or maybe "a mechanical calculator and a book of logarithms is still useful today".

Sure, it still exists and still does what it used to do, and its derivatives surround us. But nobody does that any more because nearly everything else is so superior, it'd be ridiculous to do so, except as an art piece or when you literally have no alternative.

3 hours ago by hannasanarion

No more uncharitable than saying that modern developers suck at their jobs because they can't make Sublime Text in the same time as it took Ken Thompson to make ed.

4 hours ago by deckard1

Regarding the vertical cursor movement, back in the day there was an alternative behavior. You can see this in QuickBASIC/QBasic[1]. Here, Microsoft treated the entire screen as a grid. I always thought that was a great UI. It hides the fact that there are line endings (\n on Unix or \r\n for DOS). And why shouldn't it? That's an implementation detail. And as evident by DOS using CR+LF it goes back to the days where you had an actual physical carriage on a typewriter. Nearly every modern text editor you have to type out the spaces/tabs you want to reach the area you what to add text. In QBasic, you just move the cursor wherever you want on the screen with arrow keys and start typing. Because, unlike a typewriter, a computer screen is 2D. Vim has block mode but, AFAIK, can only work on selections. Of course, this is not universal and only works with monospace fonts in certain languages. But back in the day it made it easy to create ASCII/ANSI diagrams and art.

Modern text editing is a multilayered mess. Rendering, input methods, variable width fonts, and the special codes (markdown, etc.). On some sites it's not even self-consistent. Take Jira. Last I checked, they have one editor for creating a ticket and an entirely different editor for editing that same ticket[2] (one of these editors sucks more than the other, but I can never remember which... but neither one is remotely what I would consider a "good" interface). How they got there is truly the 8th Wonder of the World.

[1] https://archive.org/details/msdos_qbasic_megapack

[2] https://community.atlassian.com/t5/Jira-Software-questions/H...

2 hours ago by skymt

Vim supports the style of editing you describe; see the documentation for the 'virtualedit' option.

https://vimhelp.org/options.txt.html#%27virtualedit%27

3 hours ago by billforsternz

I think this feature is called 'virtual space'. I like it too and would always look for it and turn it on if available in any text editor I used. But it's not as common as it once was.

4 hours ago by qsort

> you have to type out the spaces/tabs you want to reach the area you what to add text

If you move the cursor to an empty area and start typing, should the missing characters be tabs or spaces then? Or NULs?

Also, how do you insert spaces/newlines/tabs in between other text? Everything would be implicitly modal.

It's good UI for some things, but it's not as good for a general editor like vim. I'm not looking forward to write Python with it, for example :)

IIRC the Commodore 64 did something similar with its built-in Basic prompt.

3 hours ago by deckard1

Fun fact: Python and QBasic both came out in 1991. Though QuickBASIC is a few years older.

> should the missing characters be tabs or spaces then?

I'm not sure what QBasic does. But it's irrelevant since they control the format and the display. All Microsoft needed to care about is whether the file displays the same as before when loaded.

But it's really no different than text editors that let you switch a tab character to insert 2/4/8 spaces. If you've ever had the misfortune of working on a code base that allowed both tabs and spaces (fake tabs) then you'll be keenly aware that plaintext has always been modal. Your editor either has to figure out how many spaces to display a tab character, or how many spaces to insert on the tab key. Even line endings, CR+LF vs. LF. I think Mac even just used a single CR once upon a time.

Makefile is another format that is particular about requiring an actual tab character. The first time I "discovered" this I had the urge to toss my computer out the window. That was probably the late '90s when that sort of information was a bit more difficult to come across.

4 hours ago by crazygringo

Sadly, that's not a possible alternative behavior for a world where proportional fonts exist. It's for monospace only.

4 hours ago by deckard1

as I said

> Of course, this is not universal and only works with monospace fonts in certain languages.

But even then, monospace didn't go away. Most developers are working with code in monospace right now.

3 hours ago by megameter

Monospace is the more sensible option as an editing medium for symbolic content. It's in having "WYSIWYG" editors that do everything in one modeless widget that we start getting this particular kind of feature creep.

And considering how awful it tends to be to navigate a complex word processing task in Word or LibreOffice even now - mystery-meat selections abound - I'm not sure this is the right feature to support all of the time.

3 hours ago by pessimizer

I rarely care about my position on the "page" unless I'm typesetting something (otherwise I'm just typing from X number of tabs in), and when I'm typesetting, I'm not going to use a monospaced font very often.

I liked doing ANSI art back in the 80s, but that's not really interesting outside of terminal connections to a BBS.

5 hours ago by Oddskar

Having touched adjacent technologies to this as well, I could not shake the feeling that text editing on the web, and WYSIWYG text editors especially, would be very well served by some sort of common understanding and agreement of output given certain inputs. As alluded to in the article, the devil really is in the details in this domain. When one knows what to look for, most rich text inputs really miss the mark in understanding intent and doing something reasonable on behalf of the users.

An interesting example is the recent trend to start interpreting selection of text + pasting of a link as "turn this text into a link using the URL in the clipboard". It just makes complete sense. When would I ever want it to be "please delete the selection, and instead paste the URL"? Probably not very often. This is just one tiny example, but there are lots and lots of those in text editing.

My gut feeling is a lot of the time this is all left to individual engineers to try to decipher the user intent; I would assume for the most part they either copy their peers or do a best effort guess.

What if there was some sort of test suite one could run instead? Like a large number of test cases built upon interactions with actual users.

5 hours ago by breischl

>selection of text + pasting of a link as "turn this text into a link using the URL in the clipboard"

Seems like an interesting UX debate. It's a handy shortcut, but it makes "paste" modal depending on what's in the clipboard. Pasting might replace the selected text, or might link it. And because the behavior depends on whether the clipboard text "looks like" a URL, there's an element of DWIM (Do What I Mean) in there. Does it only handle http:// links? What about www.? Or mailto:? etc.

5 hours ago by Steltek

I haven't experienced the behavior described but reading it, I instantly hate it. It would differ from every other program I use.

I'd counter with there should be two different paste actions in every program: plain and smart. I almost always don't want to preserve rich formatting when I paste text. It looks like my cat walked over the keyboard while I was typing. The action to paste as plain text versus a fancier/DWIMy method is often different from program to program.

5 hours ago by ptr

Slack does it, and I had it happen to me once. It was unexpected and added extra frustration when I was already stressed.

5 hours ago by ska

This is why you eventually end up with Word's paste modifier icon....

5 hours ago by crazygringo

> all left to individual engineers to try to decipher the user intent

When it comes to a lot of text rendering, Unicode does specify most of it along with test suites.

While text input is really mainly two large teams: one at Microsoft and one at Apple. While they probably don't talk to each other much, they probably do wind up copying each other for the benefit of users.

I'm not really sure what open-source GUI's do, but probably mainly try to copy Microsoft+Apple.

6 hours ago by jll29

A good article, which shows that even plain text editing (without any formatty) is already way more complex than a layperson may appreciate.

For the developer, there are some gems to be discovered when writing a text editor; recall that using regular expressions coverted to finite state machines saw the light as part of editing, and I remember being given a very cool paper (from the 1960s!) by my undergrad compiler construction professor that proposed an efficient algorithm for testing whether a string containing a line of text can possibly be a substring of any valid Pascal program (it was a piece of theory invented while and for a syntax-aware Pascal editor, possibly from IBM but not sure). Another thing is data structures: I learned of ropes, an alternative to strings for representing text (optimized for fast editing) in the context of text editing: https://dl.acm.org/doi/10.1002/spe.4380251203

5 hours ago by jmcphers

There's a new(ish) editor called Xi that's built on the rope data structure: https://github.com/xi-editor/xi-editor

4 hours ago by reificator

Just a heads up: That editor project, while conceptually interesting, is currently abandoned.

3 hours ago by Narishma

I don't think that's still actively developed.

an hour ago by pcr910303

> This is why, on the web, text input and keypresses are separate events. Terminals conflate these two, causing problems.

Yeah, so please don’t create terminal TUIs please. Very disturbing to use TUIs that don’t work with CJK languages at all. Please, please create GUIs instead of TUIs. (I’m not blaming programs reading from stdin and printing data to stdout, but the ones based on ncurse and fill the terminal screen.)

Unfortunately the status quo on text editing didn’t improve since the last time this came up on HN. Unfortunately everything I said the last time[0] still applies…

[0]: https://news.ycombinator.com/item?id=21384596

42 minutes ago by Aeolun

But uh, I create these UI’s for myself. Why would I consider CJK languages?

4 hours ago by phkahler

On the emoji color (skintone) modifier... A normal person wants to select their emoji from a set. Only a programmer would allow the user to input a tiny program with a symbol and a color modifier and then interpret it.

If you want to make text editing a little easier, treat every character along with any style applied to it as a single entity. This way you avoid a lot of potential problems like in TFA as well as things like nesting of modifiers that may not be allowed to overlap - output those when all the characters are complete. In other words, don't track tags but generate them as a post-process when storing the data.

4 hours ago by akersten

Yeah, the "Bad #2" example, how Chrome does it, makes perfect sense and seems correct to me. Modifiers get removed when the character they're modifying is removed. I would say leaving the modifier and applying it to the previous character would be certainly incorrect (unless you're in a hex editor, in which case combining the bytes as emoji at all is questionable). Imagine it were two different emojis and a skin color modifier after the last one (and somehow, through a rendering bug, the skin color modifier hadn't auto-combined) - OP's precedent for what happens when deleting the middle emoji would move the modifier to the first emoji! Clearly wrong, especially if it then decides to auto-combine.

I mean, the example is pretty contrived in the first place:

> Whoops, I didn't mean to put the a there.

How in the world are you typing emoji such that you have to add the skin color modifier separately that would even afford an opportunity for an errant character to get inserted between? Windows numpad alt codes?

6 hours ago by floatingatoll

Also “Text Rendering Hates You”, referenced by this post, previously: https://news.ycombinator.com/item?id=21105625

Daily digest email

Get a daily email with the the top stories from Hacker News. No spam, unsubscribe at any time.