this post was submitted on 16 Feb 2024
127 points (84.7% liked)

Programmer Humor

30962 readers
1449 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
all 20 comments
sorted by: hot top controversial new old
[–] Limeey@lemmy.world 99 points 2 years ago (2 children)

If compiled languages bother you, then you’re gonna love assembly.

[–] Xabis@lemmy.world 20 points 2 years ago (3 children)

Asm is compiled too.

Gotta bust out the hex editor.

[–] Shareni@programming.dev 19 points 2 years ago
[–] frezik@midwest.social 7 points 2 years ago* (last edited 2 years ago)

An assembler doesn't have any of the interesting parts of a compiler.

Anyway, the problem with Typescript is that it tends to obscure what's going on one layer below it in ways that don't happen in traditional compiled languages. We've had decades of development on tools that can work together with traditional compilers. Javascript has not, and there are frequent problems getting different tools at different layers of abstraction to march the same direction.

[–] 30p87@feddit.de 4 points 2 years ago

I'd rather read ASM than ... that random crap.

[–] rikudou@lemmings.world 62 points 2 years ago

That looks like a minified webpack (or something similar) output, not a transpiled typescript output. Also the code is not valid.

[–] ptz@dubvee.org 44 points 2 years ago (1 children)

You should see what scary C code turns into (shudders)

[–] SomethingBurger@jlai.lu 6 points 2 years ago

I looked at it once and was scared for my life. I can't imagine what it would look like once compiled.

[–] excel@lemmy.megumin.org 27 points 2 years ago (1 children)

What this shows is how terrible raw JS is, when all of this crap is required to fix all of the edge cases and make things actually work the way it’s supposed to.

[–] fidodo@lemmy.world 1 points 2 years ago

It only looks like this if you want compression and backwards compatibility. All compiled languages have output that is optimized for those things and not readability, but if you turn off minification and use a modern language target then the compiled typescript code will look almost identical to the original code.

[–] demesisx@infosec.pub 24 points 2 years ago (2 children)

I vastly prefer Purescript despite it being the road less traveled. Typescript is just a fake-ish type system on top of JavaScript. But Purescript goes MUCH further in the mission of purity and code safety.

[–] lightnegative@lemmy.world 12 points 2 years ago (1 children)

Purescript is like a modern Haskell. Completely different programming paradigm, much less accessible to your average JS developer just wanting to tighten up their code without having to learn category theory

[–] demesisx@infosec.pub 10 points 2 years ago* (last edited 2 years ago)

I’m no white beard, I don’t know much or really any deep category theory (which is, by the way, just some fancy names for stuff we do CONSTANTLY as software engineers), and I use it every single day. Suit yourself, though.

[–] moosetwin@lemmy.dbzer0.com 3 points 2 years ago* (last edited 2 years ago)
[–] Vast_Emptiness@programming.dev 2 points 2 years ago

Idk man. I use python ;)