eordano.com

Building Webapps in 2024

2024-10-24

A long time ago, I liked the concept of The Most Dangerous Writing App as a way to overcome the white canvas dilemma, or writer's block. Since then, the project got acquired by a company that filled the online version of tracking, ads, and clutter; so now I don't trust that:

  1. my data is private and never leaves the browser
  2. the open source project is secure (dependencies have not been updated in years)

But since the concept is so simple, I was pretty sure that Claude would be able to clone this. I threw in the following prompt:

Please scaffold a project based on this description:

A long time ago, I liked the concept of https://github.com/maebert/themostdangerouswritingapp -- but since then, the company got acquired and now I don't trust that:

1. my data is private and never leaves the browser
2. the open source project is still secure given that dependencies have not been updated in years

This is a rewrite with javascript, no React or other dependencies, that recreates the basic workflow of using TMDWA (abreviation of the most dangerous writing app)
- Landing page shows you a button to start a 5m, 10m, 20m, or custom time
- Hardcore mode doesn't show you what you have typed

Features while writing:
* When the user doesn't type for 7 seconds, the session ends and all data is scrubbed
* After the time is over, you can continue typing and editing
* The background fades from cream yellow to red according to how much time has elapsed since the last key typed
* Backspace doesn't count as a key, neither does navigation (arrows, home, advance, etc)

And I got this extremely acceptable version. I even asked it to generate documentation about how it works and it created a README-like page.

Then, I prompted Claude again to tune the functionality:

This version looks good, but now I'd like:
* The hardcode mode to show * characters for each typed character so the user has some feedback to know that it's actually writing
* on success, keep a local copy of the previous sessions, with the timestamp, and time it took
* show a big failure screen when you fuck it up (and allow the user to copy it if not in hardcore mode)
* make the transition to red more clear after 2 seconds, and fail at 5 seconds instead of 7.

I got this other version that fulfilled my expectations, but it did not work -- typing failed to reset the counter and the sessions were all finished after 5 seconds. But this was only a limitation of localStorage running on Claude -- it worked fine when using it outside of Claude.

I added some more instructions, and the final version can be found here.

Great! Last change: hide "past sessions" when there are none, and when clicking on one, toggle showing the text and add a copy text of the past session.

Greenfield vs Brownfield

It's a lot easier for these kind of projects to start from scratch. LLMs get confused with a lot of context, and real complex projects (Firefox for example) can be millions and millions of lines of code, difficulting the ability of LLMs to modify them. RAG and fine-tuning models can probably help here.

Am I infringing some right of the original creators of this? I don't think so, but I'm often radicalized against copyright. I believe it's good that we create social agreements to ensure creativity and reward original thinkers, but at the same time, I believe those agreements have lately been co-opted by big corporations massively extracting revenue and overly profitting from the laws we created around this.

I reached out to the creator for comments; he liked the idea of using Claude to clone and modernize apps. He also pointed me out to a basic javascript version, which was actually how he started it, available in th git history of the project. The history has a lot of info about what he fixed over time, like character encodings, support for CKJ scripts, disabling certain keys, and others.

Everyone can do this

I believe most uses of our computers in the future will look like this. However, right now, the capabilities to achieve this are not yet well understood or explained. It's possible that some aspects of how I prompt the AI to achieve this may not be clear, even to myself.

This is a common phenomenon: people often learn to do something without being able to fully explain how they do it. It can take a long time for the underlying mechanisms to be understood, even by the people who use them. For example, it took many centuries for psychologists like Freud to develop a technical understanding of concepts that were already intuitively known to artists like Shakespeare.