News for hackers. Stuff that matters.
Re:The JavaScript ecosystem is a hot mess and so is software... by dimgl on Saturday October 16, 2021 @09:26PM (#28893163)
> I made an exception for TypeScript

I was nodding my head until TypeScript. I still don't like it even after years of people telling me it's the future. Maybe this is what it feels like to be older.

Re:The JavaScript ecosystem is a hot mess and so is software... by handrous on Saturday October 16, 2021 @09:38PM (#28893225)
TypeScript's the first thing that's made JS tolerable, if I have to touch or use anyone else's JS code. It's pure misery, otherwise.

Writing solo and using no libraries, plain JS is... OK. Anything else, TS is the only thing that keeps me from hating life the whole time I'm working in JS.

FWIW I'm a huge curmudgeon who's usually (eventually) proven right when I hate some new thing that everyone else seems to think is great. TypeScript is wonderful.

Re:The JavaScript ecosystem is a hot mess and so is software... by Tesl on Saturday October 16, 2021 @09:31PM (#28893187)
Nah you're probably just wrong. Generally speaking it's the older more experienced developers who demand typescript in my experience.

Writing raw javascript is genuinely painful, I literally don't understand how people can even do it. Like, how do you even refactor code safely?

Re:The JavaScript ecosystem is a hot mess and so is software... by FpUser on Saturday October 16, 2021 @09:52PM (#28893297)
>" I literally don't understand how people can even do it."

While I definitely appreciate types and normally work with the languages like C++ sometimes I do some front end JS libs and frankly do not have any mental troubles using plain JS. As for whether it is "safe" - all that matters to me if it works to specs and the customers are happy. Since I am programming since like forever I guess I've got enough discipline, common sense, knowledge and experience to produce decent code.

Re:The JavaScript ecosystem is a hot mess and so is software... by dimgl on Wednesday October 20, 2021 @08:50PM (#28938879)
> Like, how do you even refactor code safely?

I've never had issues doing huge refactors in JS. But thanks for telling me I'm just wrong.

Re:The JavaScript ecosystem is a hot mess and so is software... by ryohkyo on Saturday October 16, 2021 @10:39PM (#28893488)
I think that’s where unit tests come in. In Typescript, I have seen “any” type everywhere that doesn’t make things any clearer.
Re:The JavaScript ecosystem is a hot mess and so is software... by holler on Saturday October 16, 2021 @11:38PM (#28893736)
> Like, how do you even refactor code safely?

for me I make sure to write thorough unit tests along with clear, concise code

Re:The JavaScript ecosystem is a hot mess and so is software... by steve_adams_86 on Sunday October 17, 2021 @12:29AM (#28893953)
I think you can combine that with static types and come out further ahead.

To each their own though. I wrote code without any kind of autocomplete or tooling for a very long time because I felt like it. Sometimes when you don’t have something helping you all the time, it keeps you sharper.

Re:The JavaScript ecosystem is a hot mess and so is software... by grishka on Saturday October 16, 2021 @10:01PM (#28893339)
As someone who has mostly the same approach, I too use TypeScript. It makes JS saner and brings it closer to its more advanced cousin from the past, ActionScript. It also adds proper Java-like classes with inheritance, which I, as primarily a Java developer, appreciate a lot.
Re:The JavaScript ecosystem is a hot mess and so is software... by arrow7000 on Saturday October 16, 2021 @09:30PM (#28893179)
What don't you like about it?
Re:The JavaScript ecosystem is a hot mess and so is software... by moron4hire on Saturday October 16, 2021 @09:52PM (#28893296)
I'm a huge TypeScript proponent, but it took me a long time to get on board because getting it into an existing project structure is not easy. I don't even mean the translation portion (which you're also probably doing as you first learn the language), but the configuration of the tool. There are a lot of options and none of them are labeled "please just find my missing dependencies. I can see them right there".