I was wrong, just use typescript

preview_player
Показать описание
after wasting 10 minutes on a simple bug because I mistyped an argument, I decided I'm done with js.

------------

Рекомендации по теме
Комментарии
Автор

I've been in situations where typescript is telling something could be undefined or something, and I'm like, "yeah, but it's not", then get burned by a random edge case I didn't consider. Typescript is built around an error-first approach to coding, in which you code defensively. What happens if something I didn't consider causes this function to fail? Typescript is trying to make your code-base bullet-proof. Don't fight it. Embrace it. You're already a wonderful programmer... this will make you even better.

ozzyfromspace
Автор

I also started to feel like typescript wasn't worth the hassle. Utill I HAD to write a module in JS. I spent more time debugging randomness like this than I would have spend on adding typescript to the project

xerotolerant
Автор

Good job babe! Way to admit when you’re wrong or change your mind ❤️

SeibertSwirl
Автор

Looking forward to your follow-up, "I was really wrong - use TypeScript everywhere!"

All it will take is coming back to your codebase to do bug fixes a few months from now. ;)

danielgilleland
Автор

how do I enable live error linting like yours?

x
Автор

can u explain how to setup a project with type script if I'm already using js on all of the files? I mean how I can transfer all of my code base to use ts in React

mohammed.haydar
Автор

Does anyone know how the plugin is called that shows the TS errors directly besides the code? Is there an equivalent for Intellij? That is awesome :)

patrickkelleter
Автор

thanks, what the name of the extension to have the red error shown in the same line?
thanks.

calcio
Автор

what plugin are you using to show inline errors?

LifeShortBeNatty
Автор

What extension are you using that gives you messages on the same line as the code?:)

jonnawiberg
Автор

What font is this? I've been searching this for a long time. Looks like "hack" but the 'i's are different?

Anto-mipn
Автор

what extention do you use to show to errors on lines?

volodymyrlomaka
Автор

lol. Can you make a tutorial on how did you make the minecraft hosting server?

jasneet
Автор

I'm sorry, but untyped languages lost the war. Even Python now has those sad little type indicators. It was trendy 20 years ago because it was fresh and new, but not all new things are necessarily better.

darkwoodmovies
Автор

The tooling alone makes it worth it IMO. And I feel you man, I avoid using linters if I don’t have to instead I just use Prettier.

NaqqashLatif
Автор

session?.data?.user should fix your errors. Also doing a check above that either returns or having that block only execute inside a block will help

TomDoesTech
Автор

just by curiosity . That backend folder is ur node js api?

stunna
Автор

Love that theme, what's the name of it?

developerspoot
Автор

in your example you can create extra useSession hook where you will check null fields to show ts you have not-null fields or throw erros in other way

volodymyrlomaka
Автор

give me your extension visual studio code please!
I means wrong error text, too history git leans

songaming