logoalt Hacker News

sureglymoplast Sunday at 9:15 PM3 repliesview on HN

A somewhat related thing programmers must understand is that whether you write typescript, JSX, .astro or .svelte files, you are technically not writing JavaScript.

You should occasionally look at the build artifacts of your framework but also ask yourself whether it is worth it to write code that may not represent what actually ends up being executed.

Lately I just use vite with no starter template but with web components and css modules. It at least feels more convenient than using any framework or library.


Replies

wvenablelast Sunday at 10:03 PM

This seems like an issue but in all my practical experience it really isn't. TypeScript becomes JavaScript with the types removed. Then you tree-shake, minify, and whatever is executed is no where near what you actually wrote but at the same it totally is the same because that's no different than any other compilation process.

Occasionally, I have to remember that JavaScript has no types at runtime but it's surprisingly not that often.

show 1 reply
umanwizardlast Sunday at 9:19 PM

> ask yourself whether it is worth it to write code that may not represent what actually ends up being executed.

Doesn't this describe every programming language?

When you write C, you are technically not writing machine code.

Even when you write JavaScript, what actually gets executed is V8 bytecode and/or machine code (depending on whether the JIT fires).

show 2 replies
kaufmannlast Sunday at 9:33 PM

Aren't you loosing a lot of the declarative features like signals or similar, when you do your projects without those frameworks?

(asking to learn)

show 1 reply