this post was submitted on 17 Jan 2026
641 points (98.1% liked)

Programmer Humor

28593 readers
1162 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] folekaule@lemmy.world 43 points 3 days ago (2 children)

This is what source maps are for. With the right tools you can debug the original source instead of the minified version.

[–] lobut@lemmy.ca 18 points 3 days ago (1 children)

Remember to add --enable-source-maps and as long as your tools are configured properly it should point to the right line!

[–] marlowe221@lemmy.world 9 points 3 days ago (1 children)

Thanks for the tip! I’ll double check that when I get back to work next week.

I’ve written a lot of NodeJS apps in vanilla JS, and plenty of .NET backend stuff too. The transition to serious TS has been relatively recent. I like it alright, but dislike the added complexity that comes with all the various config files - vanilla JS has enough of that already!

[–] lobut@lemmy.ca 5 points 3 days ago (1 children)

I'm a former .NET dev ... I stopped quite a few years ago after I joined a Bay Area company. It was quite a change. React 1 was just coming out and I used to just write bad JS on my webpages and I had to rewrite our front-end in React. Also, ES5 or 6 or whatever was getting popular and we had to transition from CoffeeScript.

The JS world gave me whiplash after doing so many years of Enterprise .NET. The .NET tools felt so much more polished.

The fundamentals of Node to me were different than .NET. .NET felt like it had a lot more cruft and "magic" at first. With Node it felt deceptively simpler at first. Then when the require syntax was going away and we had imports but then it wasn't a real import. It was a TypeScript import or a webpack import that did a require behind the scenes. Then I had to understand why we used typescript but then what was the point of tsc vs babel vs webpack vs esbuild what their roles were and I kind got a bit obsessed with understanding what they did and what was happening under the hood. Then Node officially did do import and I had to understand what that was all about and how it affected our compilers or bundlers.

Sorry I rant pointlessly. Godspeed on your journey!

[–] marlowe221@lemmy.world 5 points 3 days ago (1 children)

No worries on the ranting!

In this industry where we are all a little afraid to admit that we don’t know something, it’s nice to be reminded that everyone is always learning all the time and that there’s no way any of us can know everything.

I’m enjoying the learning process, despite its paper cuts, and love where I work. I enjoy TS itself but I do wish the process of setting up a new project/config stuff were more streamlined. Maybe in the future!

[–] lobut@lemmy.ca 2 points 2 days ago (1 children)

Yeah, absolutely agreed.

Btw, you probably already know this, but if you don't. The later versions of Node can run typescript natively. By "run", I mean, it can run a subset of the language, if your project indirectly or indirectly references a file that has "decorators" or something like that, then you'll need to use another compiler.

ts-node or tsx are runners that I use typically if I just want to "run" something. They're basically zero config runners and I can debug with them with VS Code.

[–] marlowe221@lemmy.world 3 points 2 days ago

Yeah, I’ve read about the development of the ability to run TS natively in Node. It sounds really promising!

I’m not familiar with ts-node though. I’ll have to check that out.

[–] marlowe221@lemmy.world 3 points 3 days ago* (last edited 3 days ago) (1 children)

Well sure. But the error messages don’t point to those, which was what had me chuckling about this meme.

[–] MotoAsh@piefed.social 3 points 3 days ago (1 children)

They would point to the right lines if source maps were included in the build.

[–] marlowe221@lemmy.world 2 points 3 days ago (1 children)

Oh, they are included in the build. But I still get error messages that don’t actually point to the line in the TS source file sometimes.

Maybe I have something configured wrong - TS projects always include a more config files of different kinds than I see in other languages I work in - but it happens.

[–] MotoAsh@piefed.social 2 points 2 days ago

If it's only rarely, it might just be some dumb caching issue, or it can be a build ordering issue. Like you have to be careful in Rollup configs or some tasks will mangle the code before a sourcemap is generated. Otherwise iirc it may have to be turned on in browser settings, though hopefully they're on by default these days.