News for hackers. Stuff that matters.
Re:Is TypeScript actually worth It? by eitland on Friday January 13, 2023 @05:55AM (#34366179)
Short answer:

It is worth it if you want me on the team. I refuse to work with anyone who throws out TS for JS in 2023.

Slightly longer answer:

I have said a number of times

    "Javascript is a simple version of Java in the same way as a bike with one wheel is a simpler version of an ordinary bike."
The same can be said about JS and TS. If you want to do any serious work you go for the serious thing even if it means occasional adjustment of brakes and gears, or in Typescripts case, sometimes figuring out something.

If anybody suggest to use Javascript today I won't take them seriously.

i) I have used Typeescript since 2017. For some reason I don't have these problems and never had.

ii) Yes, some libraries are poorly documented, that is for me a reason to prove why I am a software engineer by either figuring it out, complain until they fix it or even better use my gut feeling and use some libraries that aren't stuck 10 years ago.

iii) Error messages can be hard, but compared to debugging the mess that happens without typing it isn't hard at all.

iv) Have someone look at your project setup.

And before someone says I don't know Javascript: I wrote my first javascript application (OK ECMAScript since it was in Adobes SVG plugin), which was a working map, dynamically updated based on GPS position, back in the spring of 2005, that is half a year or so before Google Maps and years before most people took Javascript seriously so I should be qualified to have opinings. Yes, it wasn't production quality, but I built the logic more or less alone in 5 months in between other school work.

Re:Is TypeScript actually worth It? by zabzonk on Friday January 13, 2023 @06:19AM (#34366344)
whoever said that javascript was a simple version of java? the two languages have almost nothing in common - at least a unicycle and a bicycle share the concepts of "wheel" and "pedals".
Re:Is TypeScript actually worth It? by once_inc on Friday January 13, 2023 @06:46AM (#34366527)
Java has wheels and pedals. Javascript only has objects that say they are wheels, and objects that say they are pedals, but which are really both and neither at the same time.
Re:Is TypeScript actually worth It? by jacooper on Friday January 13, 2023 @07:10AM (#34366703)
Schrödingers Java
Re:Is TypeScript actually worth It? by xigoi on Friday January 13, 2023 @07:52AM (#34367027)
Smalltalk has wheels and pedals. Java has AbstractBicyclePartFactoryBuilderSingletons.
Re:Is TypeScript actually worth It? by eitland on Friday January 13, 2023 @08:13AM (#34367210)
The syntax is very similar on the surface, at least compared to Perl, PHP, Python, C and - I would personally say - C++ and a number of other languages.

Yes, there is no way you'd mistake one for another if you have worked in any of them - but they look superficially similar.

Re:Is TypeScript actually worth It? by kamranjon on Friday January 13, 2023 @09:05AM (#34367877)
No they really do not
Re:Is TypeScript actually worth It? by dfreire on Friday January 13, 2023 @06:59AM (#34366623)
I don’t want to sound harsh, but saying Javascript is a simpler version of Java just tells me you have never used Java seriously.

It’s like saying Korean is a simpler version of Spanish.

Yes, Java and Javascript are both programming languages, but they don’t even share the same paradigm.

You might be confusing the motivation that led to the creation of Javascript with the actual implementation.

Having said that, I have used Java professionally for more than 7 years, then I switched to mainly Javascript, and later to Typescript, and I’m never going back. I agree with your overall point.

Re:Is TypeScript actually worth It? by rcruzeiro on Friday January 13, 2023 @07:33AM (#34366868)
I don't think that's what he meant.
Re:Is TypeScript actually worth It? by zild3d on Friday January 13, 2023 @07:43AM (#34366941)
He said "in the same way as a bike with one wheel is a simpler version of an ordinary bike." Meaning, not the same thing.
Re:Is TypeScript actually worth It? by eitland on Friday January 13, 2023 @08:10AM (#34367183)
You misunderstood it : )

I love Java and despise Javascript.

In my opinion it is up there with null and other billion dollar mistakes.

The language only works as well as it does because hundreds of people smarter than me have spent hundreds of man-years creating toolings and ecosystems around it to work around all its problems.

This is not to be read as a dismissal of Brendan Eich or anyone - it is totally amazing that he threw together a language that has worked so amazingly well in three weeks.

But everytime one switches between TS and JS one wonders how much money could have been saved if he had somehow invented TS instead back then.

Re:Is TypeScript actually worth It? by osigurdson on Friday January 13, 2023 @08:38AM (#34367445)
How about instead of analogies (which we've misunderstood even on this thread), just say this: "Java and Javascript are very different languages, don't be confused by the similarity of the names".

Of course, at this point virtually everyone knows this, now we are only arguing about which analogy to use to describe something we all understand.

Re:Is TypeScript actually worth It? by caporaltito on Friday January 13, 2023 @07:13AM (#34366726)
Comparing Java & Javascript? This reminds me the last recruiter message I got on LinkedIn. "You are a Javascript expert, I have this mission for you with the same language! They're looking for a Java expert!"
Re:Is TypeScript actually worth It? by eitland on Friday January 13, 2023 @08:10AM (#34367184)
I am pointing out that they are not comparable except very superficially.
Re:Is TypeScript actually worth It? by jwozn on Friday January 13, 2023 @10:26AM (#34369025)
It's a pointless point to make, and I think people are rightfully calling you out for it. "If my grandmother had wheels she'd be a bicycle."
Re:Is TypeScript actually worth It? by nforgerit on Friday January 13, 2023 @07:26AM (#34366814)
ha, If I was on that team I'd seriously consider opting for vanilla JS just for not having to work with you.

People who make such absolute claims are in my experience causing more trouble than they're worth. They will always nit-pick on anything anyone is saying causing a toxic atmosphere. Frequently a little later I then figured out that such people think like that because they haven't seen enough of the world and the gigantic amount of options you have to solve your technical problems.

Re:Is TypeScript actually worth It? by eitland on Friday January 13, 2023 @08:09AM (#34367172)
Totally fine with me.

If you don't need my advice you can save a lot of money by not hiring me. Edit: The reason why people hire me as a consultant is hopefully because I give clear and valuable advice, and on JS/TS, if TS doesn't work better you are very probably doing something wrong.

But don't complain to me when JS bites you behind again and again.

Re:Is TypeScript actually worth It? by nforgerit on Friday January 13, 2023 @08:20AM (#34367265)
q.e.d.
Re:Is TypeScript actually worth It? by phazeedae on Friday January 13, 2023 @08:13AM (#34367212)
With a attitude like that, I wonder if it is worth having you on the team. Might just push me to pick JS then.