this post was submitted on 16 Feb 2024
94 points (83.1% liked)

Programmer Humor

19497 readers
1099 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 1 year ago
MODERATORS
 
top 18 comments
sorted by: hot top controversial new old
[–] Limeey@lemmy.world 82 points 8 months ago (1 children)

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

[–] Xabis@lemmy.world 13 points 8 months ago (3 children)

Asm is compiled too.

Gotta bust out the hex editor.

[–] Shareni@programming.dev 13 points 8 months ago
[–] frezik@midwest.social 3 points 8 months ago* (last edited 8 months 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.

[–] rikudou@lemmings.world 46 points 8 months 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 33 points 8 months ago

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

[–] demesisx@infosec.pub 13 points 8 months 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 6 points 8 months 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 4 points 8 months ago* (last edited 8 months 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.

[–] aubeynarf@lemmynsfw.com 2 points 8 months ago (1 children)
[–] demesisx@infosec.pub 5 points 8 months ago* (last edited 8 months ago)

I have. Edit; I haven’t 🤣 didn’t see the .js at the end of that word so some of the following is probably irrelevant, though I’ll leave it because it took me a while to type it out. Haha

I’d probably be more interested in it if I were being forced by my day job to work in the JVM. I happen to be in a situation where I am my own boss working on projects completely alone and the tech I pick comes from months of wasting time making perfect the enemy of good. I know that raises quite a few red flags but I can’t help the way that they made me. Haha 🥴

From what I’ve gathered from Joseph Gordon Bell at the (IMO best software engineering podcast ever) Co-Recursive podcast, Scala sacrifices some of the purity and safety by its dependence on the the Java cargo cult. Partly, this is also a drawback of Purescript for me (since it’s intended to compile to JavaScript) but Purescript is starting to be able to escape that fate. Also, I’m a HUGE fan of Haskell syntax.

From your perspective, what pros and cons do you see if I were comparing Scala to Purescript?

Ps. The one that is actually really making me take notice lately is OCaml for the browser.

[–] excel@lemmy.megumin.org 10 points 8 months 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 8 months 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.

[–] Vast_Emptiness@programming.dev 2 points 8 months ago

Idk man. I use python ;)

[–] moosetwin@lemmy.dbzer0.com 1 points 8 months ago* (last edited 8 months ago)
[–] baggachipz@sh.itjust.works -3 points 8 months ago (1 children)

Typescript is verbose training wheels for JavaScript, change my mind

[–] fidodo@lemmy.world 1 points 8 months ago

All higher level programming languages are training wheels for programming