unemployable
For other event listeners, they get removed when the DOM element is removed.
The frameworks do not solve this to any greater degree. They also just make everything invisible and behind-the-scenes and hard to debug due to their declarative nature, but that is another topic.
In this example, the event is on the Window. There is no bubbling. It is already at the top level.
>Believe me, you don’t want to use the standard event handling API without a framework. Adding, deleting, cloning, firing, removing, fire once etc on many elements can have serious unwanted side effects.
I don't know what this means. The frameworks do not have much to do with this topic.
Show HN: Quietone – search audio and video by transcript
https://andrewitsover.com/quietone
Hey. This is my first electron app. It is called Quietone and I just thought it would be cool to navigate and manipulate videos by their transcript because searching through videos for the things I was looking for was very slow otherwise.I used whisper.cpp to do the transcribing. It has held up really well. The tiny model (the fastest one) can transcribe 2 hours of video in a couple of minutes...
Reading through the first part of the series of posts, I see a few issues. Firstly, React seems like a terrible idea. I imagine the staff were just familiar with it. I use straight JavaScript and DOM manipulation. Secondly, it mentions stuttering at certain times. There should be no stuttering because you can just offload to web workers. There will just be delays in painting things.
I think SVG is fast enough to get the job done. I mean, you can even just use it without all of the DOM elements and make everything a big path and then manually handle the events if you really want.
Anyway, converting between GPS, mercator, viewbox, etc really sucks!
I have inherited code written by teams and it was not good quality. I just rewrote each section when I needed to change something. This seems like a much better approach then trying to write maintainable code - write code that can be thrown out and rewritten.
Comparing React to VanillaJS
Projects using Artwork can be run without any transpiling or compiling thanks to import maps and CSS imports.
I am very happy with it. Maybe it is not for you, but I like it.
Artwork – a simple front-end framework with no HTML
I don't think so. For example, pgsql had an array type before it got JSON, so the drivers can't automatically convert arrays that you want to insert into JSON. With my SQLite ORM, you can just insert arrays and objects and it knows to convert them automatically to JSON.
I like that SQLite just has a few primitive types. My ORM will be able to build on top of them. For example, JavaScript will soon be adding new date types (Temporal), and I will create new types for that, which will be stored as text ultimately.
I believe this is a reference to enterprises that have different users querying the database directly with SQL that they wrote over a network to a central database.
users.Where(u => u.id == id);
means. It can get a string representation, eg. 'u => u.id == id', but it has no access to id, so it won't know what to put in place of $id here: select * from users where id = $id
I used to use EF a lot, and it does feel very easy to write non-complex queries that traverse whatever abstraction it represents the database as, but ultimately, that abstraction is not really what the database is at all, and that can have some downsides.I feel like there are two different types of people, who work very differently. There are the highly collaborative people who work in large groups and use certain types of tools that have a large social aspect to them, and then there are the more individualistic people who work alone or in small teams and have a different set of tools.
I personally write code quickly, and only neat enough for myself to understand. When the code hampers my own ability to progress, I refactor it until it stays within a certain range of maintainability. On the other hand, some people write very structured code that is very easy to maintain, but they write it at a much slower pace. These are the more collaborative people, who are writing code that will be used and changed by many random people.
TypeScript is much slower to write than JavaScript.
The other tools I have seen that try to figure out SQL types do not accurately create types for things like left joins.
That is the point of Flyweight. The API is very small, and for everything else you use SQL. The ORM parses the SQL to figure out the types, and when you want it to, it maps the SQL into more complex data structures.
include: ['posts']
in SQL, you will write join posts on p.authorId = a.id
I would argue an ORM is more about getting the flat structure of the result set into an hierarchical set of objects with more complex types.Flyweight: An ORM for SQLite
The comments in this thread say that the way you are writing TypeScript is wrong. What they are advocating for is essentially turning TypeScript into Java in terms of its style. This is what good TypeScript codebases end up looking like. They don't look like JavaScript. You could take all of the type information out and they still wouldn't look like JavaScript.
I think that when people find that their ex-JavaScript, now TypeScript codebases have become Java codebases, many of them will realise they don't really like TypeScript anymore. If they are the people that said "You aren't professional if you don't use TypeScript", etc, then they are not welcome back into the JavaScript cult. If they are not one of those people, they must profess their hatred of TypeScript, and then we will let them back in.
Anyway, no matter what, you still have to work with the native APIs and so on, which just don't work with TypeScript. Take Web Components for example. You create a web component by defining a class, but you never instantiate the class yourself. You use document.createElement('my-component'). Good luck typing that. Good luck typing proxies.
I hate TypeScript.
These days I use a deleted table as per the article as I decided it would be better to deal with the more complex undelete process. It keeps that process to a single section instead of spreading it all throughout your database.
Some of the suggestions here like "use views" don't really work for two reasons - sometimes the is_deleted check must be performed in the ON clause, not in the WHERE clause, and sometimes you want to count the deleted or show the deleted, while other times you don't.